GET /api/v1/team-members/{publicUserId}

The endpoint retrieves the details of a specified team member via an HTTP GET request to http://api.locate2u.com/api/v1/team-members/{publicUserId}

Input parameters:

publicUserId

Required* publicUserId (string) in the path which is the Public identifier for the user.

Please note that the teamMemberId returned in the GET /api/v1/team-members call is the Public user id of the team members.

The response body includes the following fields:

  • 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.

Sample code

C#
Java
NodeJS
PHP
Python
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        // Specify the API endpoint with the public user ID
        string apiUrl = "http://api.locate2u.com/api/v1/team-members/{pubicUserId}";

        // 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();

                    // Print the response body
                    Console.WriteLine(responseBody);
                }
                else
                {
                    // Print the error status code
                    Console.WriteLine($"Error: {response.StatusCode}");
                }
            }
            catch (Exception ex)
            {
                // Print any exceptions that occur
                Console.WriteLine($"Exception: {ex.Message}");
            }
        }
    }
}
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/{pubicUserId}")
  .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/{pubicUserId}',
  '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/3c58073e-500b-46f2-89d6-c80ca0963853',
  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 import requests

url = "http://api.locate2u.com/api/v1/team-members/{pubicUserId}"

payload = {}
headers = {
  'Authorization': 'Bearer your_bearer_token_here'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "http://api.locate2u.com/api/v1/team-members/{pubicUserId}"

payload = {}
headers = {
  'Authorization': 'Bearer your_bearer_token_here'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response

Upon a successful request, the server will respond with a status code of 200 and a JSON object containing the details of the team member.

{
  "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.776Z",
    "stopsCount": 0,
    "route": null,
    "speed": null,
    "battery": null,
    "accuracy": null
  },
  "status": "At work",
  "role": "Team Owner",
  "skills": []
}

401	Unauthorized

403	Forbidden

404	If the team member cannot be found.