Post /api/v1/stops/{id}/notes

Add Note to Shipment.

This endpoint allows you to add a note to a specific shipment identified by the stop ID.

Add Shipment Note https://api.locate2u.com/api/v1/shipments/{id}/notes

Input parameters:
id

id * required integer($int32)(path)

This id here is the unique shipment id for shipment in your Locate2u account.

Request Body

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

  • shipmentId (integer): The ID of the shipment to which the note is being added.
  • note (string): The content of the note.
  • type (string): The type of the note.
  • photoFileNames (array of strings): Names of the photo files associated with the note.
  • documentFileNames (array of strings): Names of the document files associated with the note.
  • metadata (object): Additional metadata related to the note.
{
  "shipmentId": 158969,
  "note": "Please call before you deliver",
  "type": "Shipment Note",
  "photoFileNames": [
    "FileNames1.png",
    "FileNames2.jpg"
  ],
  "documentFileNames": [
    "DocumentFileNames1.docx",
    "DocumentFileNames2.xlsx"
  ],
  "metadata": null
}

Sample code

C#
Java
NodeJS
PHP
Python
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.locate2u.com/api/v1/shipments/175370/notes");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent("{\r\n  \"shipmentId\": 175368,\r\n  \"note\": \"Please call before you deliver\",\r\n  \"type\": \"Shipment Note\",\r\n  \"photoFileNames\": [\r\n    \"FileNames1.png\",\r\n    \"FileNames2.jpg\"\r\n  ],\r\n  \"documentFileNames\": [\r\n    \"DocumentFileNames1.docx\",\r\n    \"DocumentFileNames2.xlsx\"\r\n  ],\r\n  \"metadata\": null\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  \"shipmentId\": 175368,\r\n  \"note\": \"Please call before you deliver\",\r\n  \"type\": \"Shipment Note\",\r\n  \"photoFileNames\": [\r\n    \"FileNames1.png\",\r\n    \"FileNames2.jpg\"\r\n  ],\r\n  \"documentFileNames\": [\r\n    \"DocumentFileNames1.docx\",\r\n    \"DocumentFileNames2.xlsx\"\r\n  ],\r\n  \"metadata\": null\r\n}");
Request request = new Request.Builder()
  .url("https://api.locate2u.com/api/v1/shipments/175370/notes")
  .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/shipments/175370/notes',
  '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({
  "shipmentId": 175368,
  "note": "Please call before you deliver",
  "type": "Shipment Note",
  "photoFileNames": [
    "FileNames1.png",
    "FileNames2.jpg"
  ],
  "documentFileNames": [
    "DocumentFileNames1.docx",
    "DocumentFileNames2.xlsx"
  ],
  "metadata": null
});


req.write(postData);


req.end();
 'https://api.locate2u.com/api/v1/shipments/175370/notes',
  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 =>'{
  "shipmentId": 175368,
  "note": "Please call before you deliver",
  "type": "Shipment Note",
  "photoFileNames": [
    "FileNames1.png",
    "FileNames2.jpg"
  ],
  "documentFileNames": [
    "DocumentFileNames1.docx",
    "DocumentFileNames2.xlsx"
  ],
  "metadata": null
}',
  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/shipments/175370/notes"


payload = json.dumps({
  "shipmentId": 175368,
  "note": "Please call before you deliver",
  "type": "Shipment Note",
  "photoFileNames": [
    "FileNames1.png",
    "FileNames2.jpg"
  ],
  "documentFileNames": [
    "DocumentFileNames1.docx",
    "DocumentFileNames2.xlsx"
  ],
  "metadata": None
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer yourBearerTokenHere'
}


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


print(response.text)

Response

Response

  • noteId (integer): The ID of the added note.
  • shipmentId (integer): The ID of the shipment to which the note is added.
  • photoUploadUrls (array of objects): URLs for uploading photos associated with the note.
    • newFileName (string): The new file name for the uploaded photo.
    • originalFileName (string): The original file name of the photo.
    • uploadUrl (string): The URL for uploading the photo.
  • documentUploadUrls (array of objects): URLs for uploading documents associated with the note.
    • newFileName (string): The new file name for the uploaded document.
    • originalFileName (string): The original file name of the document.
    • uploadUrl (string): The URL for uploading the document.
200 Success

401 Unauthorized

403 Forbidden