POST /api/v1/stops/{id}/lines/{lineid}/change-status

This API endpoint is used to change the status of a stop line. It is an HTTP POST request to the specified URL. The request payload is in raw format and includes parameters such as stopLineId, oldStatus, newStatus, location, isManualEntry, and actionDate.

Input parameters:

id

Stop id of the stop for which you want to update the status of the attached line item. Required field with type string (path).

lineid

Unique id of the line id to be updated. Required field with type string (path)

Example request body:

The request body should be in raw format and should include the following parameters:

{
  "stopLineId": 101,
  "oldStatus": "Created",
  "newStatus": "Onboard",
  "location": {
    "latitude": -33.8706672,
    "longitude": 151.192487
  },
  "isManualEntry": true,
  "actionDate": "2024-03-04T09:20:20.917Z"
}
  • stopLineId (number): The ID of the stop line.
  • oldStatus (string): The previous status of the stop line.
  • newStatus (string): The new status to be updated.
  • location (object): The location coordinates with latitude and longitude.
    • latitude (number): The latitude of the location.
    • longitude (number): The longitude of the location.
  • isManualEntry (boolean): Indicates if the status change is a manual entry.
  • actionDate (string): The date of the action.
Example request:

Sample code

C#
Java
NodeJS
PHP
Python
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.locate2u.com/api/v1/stops/5176243/lines/3963073/change-status");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent("{\r\n  \"stopLineId\": 3963073,\r\n  \"oldStatus\": \"Created\",\r\n  \"newStatus\": \"Onboard\",\r\n  \"location\": {\r\n    \"latitude\": -33.8706672,\r\n    \"longitude\": 151.192487\r\n  },\r\n  \"isManualEntry\": true,\r\n  \"actionDate\": \"2024-02-01T09:37:07.525Z\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n  \"stopLineId\": 3963073,\r\n  \"oldStatus\": \"Created\",\r\n  \"newStatus\": \"Onboard\",\r\n  \"location\": {\r\n    \"latitude\": -33.8706672,\r\n    \"longitude\": 151.192487\r\n  },\r\n  \"isManualEntry\": true,\r\n  \"actionDate\": \"2024-02-01T09:37:07.525Z\"\r\n}");
Request request = new Request.Builder()
  .url("https://api.locate2u.com/api/v1/stops/5176243/lines/3963073/change-status")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer yourBearerTokenHere")
  .build();
Response response = client.newCall(request).execute();
var https = require('follow-redirects').https;
var fs = require('fs');


var options = {
  'method': 'POST',
  'hostname': 'api.locate2u.com',
  'path': '/api/v1/stops/5176243/lines/3963073/change-status',
  'headers': {
    'Content-Type': 'application/json',
    '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);
  });
});


var postData = JSON.stringify({
  "stopLineId": 3963073,
  "oldStatus": "Created",
  "newStatus": "Onboard",
  "location": {
    "latitude": -33.8706672,
    "longitude": 151.192487
  },
  "isManualEntry": true,
  "actionDate": "2024-02-01T09:37:07.525Z"
});


req.write(postData);


req.end();
$curl = curl_init();


curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.locate2u.com/api/v1/stops/5176243/lines/3963073/change-status',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "stopLineId": 3963073,
  "oldStatus": "Created",
  "newStatus": "Onboard",
  "location": {
    "latitude": -33.8706672,
    "longitude": 151.192487
  },
  "isManualEntry": true,
  "actionDate": "2024-02-01T09:37:07.525Z"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer yourBearerTokenHere'
  ),
));


$response = curl_exec($curl);


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


url = "https://api.locate2u.com/api/v1/stops/5176243/lines/3963073/change-status"


payload = json.dumps({
  "stopLineId": 3963073,
  "oldStatus": "Created",
  "newStatus": "Onboard",
  "location": {
    "latitude": -33.8706672,
    "longitude": 151.192487
  },
  "isManualEntry": True,
  "actionDate": "2024-02-01T09:37:07.525Z"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer yourBearerTokenHere'
}


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


print(response.text)

Response

The response to the request has a status code of 200 and the content type is text/xml. The response body is null.

200 Success

401 Unauthorized

403 Forbidden