GET /api/v1/team-members
The endpoint retrieves a list of team members via an HTTP GET request to http://api.locate2u.com/api/v1/team-members.
Input parameters:
includeCurrentLocation
includeCurrentLocation (boolean, query) has a default value as true and returns the current location of the team members.
This request’s response is a JSON array containing objects with the following properties:
- firstName (string): The first name of the team member.
- lastName (string): The last name of the team member.
- bio (string or null): The biography of the team member, if available.
- email (string): The email address of the team member.
- industry (string or null): The industry of the team member, if specified.
- timeZone (string): The time zone of the team member.
- teamMemberId (string): The unique identifier of the team member.
- teamRegionId (string or null): The identifier of the team region, if applicable.
- phone (string): The phone number of the team member.
- regionCode (string): The region code of the team member.
- vehicleType (string or null): The type of vehicle used by the team member, if applicable.
- photoUrl (string): The URL of the team member’s photo.
- routeDetails (object): Details about the route of the team member, including coordinates, last location update, stops count, route, speed, battery, and accuracy.
- status (string or null): The status of the team member, if available.
- role (string): The role of the team member.
- skills (array): An array of skills possessed by the team member.
Please note that the actual values in the response may vary and are intentionally masked for privacy.
Sample code
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
// Specify the API endpoint
string apiUrl = "http://api.locate2u.com/api/v1/team-members";
// Bearer token for authorization
string bearerToken = "your_bearer_token_here";
// Create an instance of HttpClient
using (var client = new HttpClient())
{
// Set the authorization header with bearer token
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
try
{
// Make the GET request
HttpResponseMessage response = await client.GetAsync(apiUrl);
// Check if request was successful
if (response.IsSuccessStatusCode)
{
// Read the response content as string
string responseBody = await response.Content.ReadAsStringAsync();
// Deserialize the JSON response to array of Team Members
var teamMembers = JsonConvert.DeserializeObject(responseBody);
// Print details of each team member
foreach (var member in teamMembers)
{
Console.WriteLine($"Name: {member.FirstName} {member.LastName}, Email: {member.Email}, Status: {member.Status}");
}
}
else
{
// Print the error status code
Console.WriteLine($"Error: {response.StatusCode}");
}
}
catch (Exception ex)
{
// Print any exceptions that occur
Console.WriteLine($"Exception: {ex.Message}");
}
}
}
}
// Define a class to represent the structure of a Team Member
public class TeamMember
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Status { get; set; }
// Add other properties as needed
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("http://api.locate2u.com/api/v1/team-members")
.method("GET", body)
.addHeader("Authorization", "Bearer your-bearer-token-here")
.build();
Response response = client.newCall(request).execute();
var http = require('follow-redirects').http;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.locate2u.com',
'path': '/api/v1/team-members',
'headers': {
'Authorization': 'Bearer your-bearer-token-here'
},
'maxRedirects': 20
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
'http://api.locate2u.com/api/v1/team-members',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer your-bearer-token-here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "http://api.locate2u.com/api/v1/team-members"
payload = {}
headers = {
'Authorization': 'Bearer your-bearer-token-here'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Response
Example response:
[
{
"firstName": "John",
"lastName": "Doe",
"bio": null,
"email": "john.doe@email.com",
"industry": null,
"timeZone": "AUS Eastern Standard Time",
"teamMemberId": "ee59-b174-4698-ac55-81d9d",
"teamRegionId": 293617,
"phone": "+0234234",
"regionCode": null,
"vehicleType": "Car",
"photoUrl": null,
"routeDetails": {
"coordinates": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"lastLocationUpdate": "2024-04-25T04:12:28.766Z",
"stopsCount": 0,
"route": null,
"speed": null,
"battery": null,
"accuracy": null
},
"status": "At work",
"role": "Team Owner",
"skills": []
},
{
"firstName": "John",
"lastName": "Doe",
"bio": null,
"email": "john.doe@email.com",
"industry": null,
"timeZone": "AUS Eastern Standard Time",
"teamMemberId": "ee59-b174-4698-ac55-81d9d",
"teamRegionId": 293617,
"phone": "+0234234",
"regionCode": null,
"vehicleType": "Car",
"photoUrl": null,
"routeDetails": {
"coordinates": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"lastLocationUpdate": "2024-04-25T04:12:28.766Z",
"stopsCount": 0,
"route": null,
"speed": null,
"battery": null,
"accuracy": null
},
"status": "At work",
"role": "Team Owner",
"skills": []
}
]