SpeedLimit

  • This method is associated with the "Speed Limit" Report in NetTrack and contains Speed Limit violations over a given threshold
  • Returns following information:
    • Vehicle Name in violation
    • Date and Time of violation
    • Location of violation
    • Vehicle Actual Speed
    • Posted Speed Limit *

* Please note: Google’s speed limit approach, although very accurate, can sometimes extract speed limits for the wrong street at cross streets and overpasses. Verify correct street and corresponding speed limit prior to taking action with driver.

Use Case

  • Use to query vehicle(s) speed limit violations

Use an HTTP POST request to obtain your vehicle's Speed Limit:

[POST] https://secure.trackyourtruck.com/WebApi/api/v2.1/SpeedLimit?IsUtcTimeZone={IsUtcTimeZone}

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
FromDateTime Beginning Date/Time for your query* MM/dd/yyyy hh:mm tt 08/08/2018 05:00 AM
ToDateTime Ending Date/Time for your query* MM/dd/yyyy hh:mm tt 08/08/2018 11:00 PM
Is12HrsFormat "True" value for 12-Hour formatting of time;
"False"/"Blank" for 24-Hour formatting
true or false true
SpeedLimitOverageFilter Filter by Miles Per Hour over posted speed limit. Default/”Blank” value = 10 MPH. numeric 10
VehicleId (Optional) Filter by a specific VehicleID; "blank" returns all Vehicles numeric 825
IsUtcTimeZone (optional) "True" returns Event Time in UTC
"False"/"Blank" returns Event Time in Vehicle Time Zone
true or false true

* Date/Time will return all matching events without consideration of Vehicle Time Zone. However, the Event Time returned will include the Time Zone designation.

Create SpeedLimit Object

Below is the SpeedLimit request API examples:


var client = new HttpClient();
var values = new Dictionary
    {
        { "FromDateTime", "08/08/2018 05:00 AM " },
        { "ToDateTime", "08/08/2018 11:00 PM " },
        { "Is12HrsFormat", "true" },
        { "SpeedLimitOverageFilter", "10" },
        { "VehicleId","845" }
    };
    client.DefaultRequestHeaders.Add("Authorization","Bearer YOUR_API_TOKEN")
    var content = new FormUrlEncodedContent(values);
    var response = await client.PostAsync("https://secure.trackyourtruck.com/WebApi/api/v2.1/SpeedLimit", content);
    var responseString = await response.Content.ReadAsStringAsync();

//responseString will contain a Credential Object in JSON format
$.ajax({
    beforeSend: function(xhrObj){
            xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
    },
    type: "POST",
    url: "https://secure.trackyourtruck.com/WebApi/api/v2.1/SpeedLimit",
    dataType: "json",
    data:{
        FromDateTime : "08/08/2018 05:00 AM" ,
        ToDateTime: "08/08/2018 11:00 PM",
        Is12HrsFormat: true,
        SpeedLimitOverageFilter: "10",
        VehicleId: "845"
    },
    success: function(data){
                    //data object will contain the result as a JSON object
    }
});

Sample SpeedLimit Object

$.ajax({
    beforeSend: function(xhrObj){
            xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
    },
    type: "POST",
    url: "https://secure.trackyourtruck.com/WebApi/api/v2.1/SpeedLimitOverageFilter",
    dataType: "json",
    data:{
        FromDateTime : "08/08/2018 05:00 AM" ,
        ToDateTime: "08/08/2018 11:00 PM",
        Is12HrsFormat: true,
        SpeedLimitOverageFilter: "35",
        VehicleId: "845"
    },
    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":[
            {
                "VehicleName": "Alison-4509",
                "GPSDate": "08/01/2018",
                "Time": "09:54:03 (CST)",
                "Location": "1936 South 13th Street, Omaha, NE 68108",
                "ActualSpeed": "35.625",
                "SpeedLimit": "35.000"
            },
            {
                "VehicleName": "Alison-4509",
                "GPSDate": "08/01/2018",
                "Time": "09:57:03 (CST)",
                "Location": " Interstate 80, Omaha, NE 68108",
                "ActualSpeed": "63.125",
                "SpeedLimit": "55.000"
            },
            {
                "VehicleName": "Alison-4509",
                "GPSDate": "08/01/2018",
                "Time": "09:58:03 (CST)",
                "Location": " Interstate 80, Omaha, NE 68105",
                "ActualSpeed": "72.500",
                "SpeedLimit": "60.000"
            },
            {
                "VehicleName": "Alison-4509",
                "GPSDate": "08/01/2018",
                "Time": "09:59:02 (CST)",
                "Location": " Interstate 80, Omaha, NE 68106",
                "ActualSpeed": "73.750",
                "SpeedLimit": "60.000"
            },
            .............
            .............
            .............
        ]
    }

Test

Test the SpeedLimit using your AccessToken by entering it below:

Clicking the test button will send a request to the TYT API and display the result below.