VehicleList
- This method contains the latest, most up-to-date vehicle list details
-
Returns the following required data:
- sourceId (The ID used to represent the entity in the TYT system)
- status (The status in the TYT system)
- vin
- name (ex. Bob’s Truck, 2018 F250…)
- groups
- oldestDate (Returns the oldest truck date available in the TYT system)
- licensePlate.state
- licensePlate.number
Use Case
- Use to query vehicle details and identification information
Use an HTTP GET request to obtain your list of vehicles:
[GET] https://secure.trackyourtruck.com/WebApi/api/v2.2/VehicleList
Request Header
The request header should contain the API Access Token obtained from the authentication process. Get Access Token.
| Header Name | Description |
|---|---|
| Authorization | Access Token obtained from the 1st step's authentication process. |
Create VehicleList Object
Below is the VehicleList request API examples:
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization","Bearer YOUR_API_TOKEN")
var response = await client.GetAsync("https://secure.trackyourtruck.com/WebApi/api/v2.2/VehicleList");
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: "GET",
url: "https://secure.trackyourtruck.com/WebApi/api/v2.2/VehicleList",
dataType: "json",
success: function(data){
//data object will contain the result as a JSON object
}
});
Sample VehicleList Object
$.ajax({
beforeSend: function(xhrObj){
xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
},
type: "GET",
url: "https://secure.trackyourtruck.com/WebApi/api/v2.2/VehicleList",
dataType: "json",
success: function(data){
//data object will contain the result as a JSON object
}
});
A successful request will return the following JSON result:
{
"StatusCode": "200",
"Message": "OK",
"pagination": {
"PageNumber": 1,
"PageSize": 100,
"TotalRecords": 1250,
"TotalPages": 13,
"HasMore": true
},
"Results":[
{
"sourceId": "5555",
"status": "active",
"vin": "1N4AL11D75C109151",
"name": "Blue Runner",
"groups": [
"439"
],
"oldestDate": "2024-01-15",
"licensePlate": {
"state": "TX",
"number": "KLM-4821"
}
},
{
"sourceId": "5654",
"status": "active",
"vin": "2T1BR32E54C287945",
"name": "Green Hauler",
"groups": [
"440"
],
"oldestDate": "2023-11-03",
"licensePlate": {
"state": "CA",
"number": "8ZQX317"
}
}
]
}
Test
Test the VehicleList using your AccessToken by entering it below:
Clicking the test button will send a request to the TYT API and display the result below.