GET /api/v1/team-members/{publicUserId}/reports/location-data
The API endpoint retrieves location data reports for a specific team member’s trip on a given date.
Request Method: GET
URL: https://api.locate2u.com/api/v1/team-members/{publicUserId}/reports/location-data?tripDate=yyyy-MM-dd
Input parameters:
publicUserId
Required* publicUserId (string) in the path which is the Public identifier for the team-member/user.
tripDate
Optional query parameter, Type : string ($date) with format “yyyy-MM-dd”
Specifies the trip date of the location-data report.
Sample code
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.locate2u.com/api/v1/team-members/{publicUserId}/reports/location-data?tripDate=yyyy-MM-dd");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.locate2u.com/api/v1/team-members/{publicUserId}/reports/location-data?tripDate=yyyy-MM-dd")
.method("GET", body)
.addHeader("Authorization", "Bearer yourBearerTokenHere")
.build();
Response response = client.newCall(request).execute();
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.locate2u.com',
'path': '/api/v1/team-members/{publicUserId}/reports/location-data?tripDate=yyyy-MM-dd',
'headers': {
'Authorization': 'Bearer yourBearerTokenHere'
},
'maxRedirects': 20
};
var req = https.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();
'https://api.locate2u.com/api/v1/team-members/{publicUserId}/reports/location-data?tripDate=yyyy-MM-dd',
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 yourBearerTokenHere'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.locate2u.com/api/v1/team-members/{publicUserId}/reports/location-data?tripDate=yyyy-MM-dd"
payload = {}
headers = {
'Authorization': 'Bearer yourBearerTokenHere'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Response
The response returned is a JSON array with the following schema:
JSON
[
{
“timeStamp”: “string”,
“location”: {
“latitude”: 0,
“longitude”: 0
},
“speedKph”: 0
}
]
The response includes the timestamp, latitude, longitude, and speed in kilometers per hour for the team member’s location data during the trip.
Sample response:
[
{
"timeStamp": "2024-06-06T04:41:07.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T05:41:26.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T06:41:36.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T07:41:47.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:21:29.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:21:29.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:22:29.0000000+10:00",
"location": {
"latitude": -33.8741892,
"longitude": 151.1875748
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:23:38.0000000+10:00",
"location": {
"latitude": -33.8764073,
"longitude": 151.1885252
},
"speedKph": 34
},
{
"timeStamp": "2024-06-06T08:24:38.0000000+10:00",
"location": {
"latitude": -33.8756488,
"longitude": 151.1900155
},
"speedKph": 20
},
{
"timeStamp": "2024-06-06T08:25:32.0000000+10:00",
"location": {
"latitude": -33.8791995,
"longitude": 151.1934134
},
"speedKph": 26
},
{
"timeStamp": "2024-06-06T08:26:32.0000000+10:00",
"location": {
"latitude": -33.8808066,
"longitude": 151.1954724
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T08:27:32.0000000+10:00",
"location": {
"latitude": -33.8816646,
"longitude": 151.1961871
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:28:32.0000000+10:00",
"location": {
"latitude": -33.8812652,
"longitude": 151.1959733
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:28:32.0000000+10:00",
"location": {
"latitude": -33.8812652,
"longitude": 151.1959733
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:31:22.0000000+10:00",
"location": {
"latitude": -33.8811965,
"longitude": 151.1959623
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:31:22.0000000+10:00",
"location": {
"latitude": -33.8811965,
"longitude": 151.1959623
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:32:22.0000000+10:00",
"location": {
"latitude": -33.8815782,
"longitude": 151.1962299
},
"speedKph": 1
},
{
"timeStamp": "2024-06-06T08:33:22.0000000+10:00",
"location": {
"latitude": -33.8815685,
"longitude": 151.196353
},
"speedKph": 16
},
{
"timeStamp": "2024-06-06T08:34:22.0000000+10:00",
"location": {
"latitude": -33.8815536,
"longitude": 151.1967831
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:35:22.0000000+10:00",
"location": {
"latitude": -33.8808038,
"longitude": 151.1966941
},
"speedKph": 39
},
{
"timeStamp": "2024-06-06T08:36:22.0000000+10:00",
"location": {
"latitude": -33.8793651,
"longitude": 151.1949952
},
"speedKph": 37
},
{
"timeStamp": "2024-06-06T08:37:22.0000000+10:00",
"location": {
"latitude": -33.876444,
"longitude": 151.1910489
},
"speedKph": 37
},
{
"timeStamp": "2024-06-06T08:38:22.0000000+10:00",
"location": {
"latitude": -33.8765471,
"longitude": 151.1884562
},
"speedKph": 0
},
{
"timeStamp": "2024-06-06T08:39:22.0000000+10:00",
"location": {
"latitude": -33.8743593,
"longitude": 151.1874427
},
"speedKph": 20
},
{
"timeStamp": "2024-06-06T08:40:22.0000000+10:00",
"location": {
"latitude": -33.87411,
"longitude": 151.1875514
},
"speedKph": 9
},
{
"timeStamp": "2024-06-06T08:41:19.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T08:41:19.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T09:41:24.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T10:41:34.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T11:41:44.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T12:41:54.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T13:42:04.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T14:42:14.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T15:42:24.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T16:42:34.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T17:42:45.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T18:42:56.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T19:45:25.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T20:45:35.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T21:45:45.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T22:45:55.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-06T23:46:05.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-07T00:46:15.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-07T01:46:25.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-07T02:46:34.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
},
{
"timeStamp": "2024-06-07T03:46:44.0000000+10:00",
"location": {
"latitude": -33.8741247,
"longitude": 151.1870726
},
"speedKph": 14
}
]