VehicleList

  • This method contains the latest, most up-to-date VehicleID and Vehicle Name
  • Returns two pieces of information:
    1. TYT Unique Vehicle Identification number
    2. Vehicle common Name (ex. Bob’s Truck, 2018 F250…)

Use Case

  • Use to query the vehicleID and associated Vehicle Name
  • Vehicle Names can change but VehicleID will never change

Use an HTTP GET request to obtain your list of vehicles:

[GET] https://secure.trackyourtruck.com/WebApi/api/v2.0/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.0/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.0/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.0/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",
    "Data":[
        {
            "VehicleId": "5555",
            "VehicleName": "Bob’s Truck"
        },
        {
            "VehicleId": "5654",
            "VehicleName": "John’s Truck"
        },
        ..........
    ]
}

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.