PostTruckLoading
- This is a POST method, using this method a client can inform the AutoGuard Fleet System which Vehicle is currently loading the products.
Use Case
- Use to query to Post Loading Status
Use an HTTP Post request to obtain your vehicles' Current Loading Status:
[POST] https://secure.autoguardtracking.com/WebApi/api/v2.0/PostTruckLoading
Request Header
The request header should contain the API Token obtained from the authentication process. Get Access Token.
Header Name | Description |
---|---|
Authorization | API Token obtained from the 1st step's authentication process. |
Request Parameters
The Request should contain the following parameters:
Parameter Name | Description | Value Format | Example |
---|---|---|---|
Vehicle ID | To load specefic vehicle. | numeric | 825 |
Source Id | Loading point of specefic vehicle. | numeric | 2403905 |
Destination Id | Unloading point of specefic vehicle. | numeric | 2403905 |
Loading Status | Loading Status for loaded specific vehicle. | string | "LOADED", |
Time | Loadign complete Date/Time of specefic vehicle. | MM/dd/yyyy hh:mm tt | 08/08/2018 11:00 PM |
Create PostTruckLoading Object
Below is the PostTruckLoading POST request examples:
var client = new HttpClient();
var values = new Dictionary
{"
[
{
"VehicleId": 22643,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 PM",
},
{
"VehicleId": 12255,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 AM",
}]
"
};
client.DefaultRequestHeaders.Add("Authorization","Bearer YOUR_API_TOKEN")
var content = new FormUrlEncodedContent(values);
var response = await client.PostAsync("https://secure.autoguardtracking.com/WebApi/api/v2.0/PostTruckLoading", content);
var responseString = await response.Content.ReadAsStringAsync();();
//responseString will contain the response in JSON format
$.ajax({
beforeSend: function(xhrObj){
xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
},
type: "POST",
url: "https://secure.autoguardtracking.com/WebApi/api/v2.0/PostTruckLoading",
data:"[
{
"VehicleId": 22643,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 PM",
},
{
"VehicleId": 12255,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 AM",
}
]",
contentType: "application/json",
success: function(data){
//data object will contain the result as a JSON object
}
});
Sample PostTruckLoading Object
$.ajax({
beforeSend: function(xhrObj){
xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
},
type: "POST",
url: "https://secure.autoguardtracking.com/WebApi/api/v2.0/PostTruckLoading",
data:"[
{
"VehicleId": 22643,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 PM",
},
{
"VehicleId": 12255,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 AM",
}]",
contentType: "application/json",
success: function(data){
//data object will contain the result as a JSON object
}
});
Sample of Post JSON Data
[
{
"VehicleId": 22643,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 AM",
},
{
"VehicleId": 12255,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "08/08/2018 11:00 PM",
},
.............
.............
.............
]
A successful request will return the following JSON result:
{
"StatusCode": "200",
"Message": "OK",
"Data": [
{
"VehicleId": 22643,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "2022-10-26T16:00:00",
"LoadCompleteStatus": "Truck Loaded complete successfully."
},
{
"VehicleId": 12255,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "2022-10-26T16:00:00",
"LoadCompleteStatus": "Truck route plan not found."
},
{
"VehicleId": 12255,
"DestinationId": 2403905,
"SourceId": 2403889,
"LoadingStatus": "LOADED",
"Time": "2022-10-26T16:00:00",
"LoadCompleteStatus": "Truck Loading complete failed."
},
.............
.............
.............
]
}
Test
Test your Post Truck Loading JSON object using your AccessToken by entering it below:
Clicking the test button will send a request to the AutoGuard API and display the result below.