Seach historical carrier SMS records by USDOT number.

Requires Authentication via 'x-api-key' header.

Returns an array of recorded SMS (Hazmat & Non-Hazmat) entries for a given USDOT number


Code Examples



curl --request GET \
  --url /v3/history/sms/:USDotNumber \
  --header 'x-api-key: YourApiKey'

Source on Github


CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://saferwebapi.com/v3/history/sms/:USDotNumber");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: YourApiKey");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Source on Github


var client = new RestClient("https://saferwebapi.com/v3/history/sms/:USDotNumber");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "YourApiKey");
IRestResponse response = client.Execute(request);

Source on Github


package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://saferwebapi.com/v3/history/sms/:USDotNumber"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "YourApiKey")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Source on Github


HttpResponse response = Unirest.get("https://saferwebapi.com/v3/history/sms/:USDotNumber")
  .header("x-api-key", "YourApiKey")
  .asString();

Source on Github


var axios = require("axios").default;

var options = {
  method: 'GET',
  url: 'https://saferwebapi.com/v3/history/sms/:USDotNumber',
  headers: {'x-api-key': 'YourApiKey'}
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});

Source on Github


#import 

NSDictionary *headers = @{ @"x-api-key": @"YourApiKey" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://saferwebapi.com/v3/history/sms/:USDotNumber"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];

Source on Github


 "https://saferwebapi.com/v3/history/sms/:USDotNumber",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-api-key: YourApiKey"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Source on Github


import requests

url = "https://saferwebapi.com/v3/history/sms/:USDotNumber"

headers = {"x-api-key": "YourApiKey"}

response = requests.request("GET", url, headers=headers)

print(response.text)

Source on Github


require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://saferwebapi.com/v3/history/sms/:USDotNumber")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["x-api-key"] = 'YourApiKey'

response = http.request(request)
puts response.read_body

Source on Github


import Foundation

let headers = ["x-api-key": "YourApiKey"]

let request = NSMutableURLRequest(url: NSURL(string: "https://saferwebapi.com/v3/history/sms/:USDotNumber")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Source on Github
Endpoints
  • GET /v3/history/sms/:USDotNumber
Response Example

{
  "sms_records": [
    {
      "batch_date": "January, 2021",
      "inspection_total": 611,
      "driver": {
        "inspection_total": 611,
        "out_of_service_total": 3
      },
      "vehicle": {
        "inspection_total": 266,
        "out_of_service_total": 29
      },
      "unsafe_driving": {
        "inspections_with_violations": 85,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 18,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 5,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 84,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "February, 2021",
      "inspection_total": 607,
      "driver": {
        "inspection_total": 607,
        "out_of_service_total": 4
      },
      "vehicle": {
        "inspection_total": 263,
        "out_of_service_total": 31
      },
      "unsafe_driving": {
        "inspections_with_violations": 84,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 17,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 7,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 85,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "March, 2021",
      "inspection_total": 598,
      "driver": {
        "inspection_total": 598,
        "out_of_service_total": 4
      },
      "vehicle": {
        "inspection_total": 259,
        "out_of_service_total": 30
      },
      "unsafe_driving": {
        "inspections_with_violations": 82,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 18,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 7,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 81,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "April, 2021",
      "inspection_total": 579,
      "driver": {
        "inspection_total": 579,
        "out_of_service_total": 4
      },
      "vehicle": {
        "inspection_total": 255,
        "out_of_service_total": 26
      },
      "unsafe_driving": {
        "inspections_with_violations": 81,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 17,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 7,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 77,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "May, 2021",
      "inspection_total": 605,
      "driver": {
        "inspection_total": 605,
        "out_of_service_total": 5
      },
      "vehicle": {
        "inspection_total": 275,
        "out_of_service_total": 32
      },
      "unsafe_driving": {
        "inspections_with_violations": 78,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 16,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 8,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 86,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "June, 2021",
      "inspection_total": 604,
      "driver": {
        "inspection_total": 598,
        "out_of_service_total": 5
      },
      "vehicle": {
        "inspection_total": 275,
        "out_of_service_total": 32
      },
      "unsafe_driving": {
        "inspections_with_violations": 75,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 16,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 8,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 86,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "July, 2021",
      "inspection_total": 612,
      "driver": {
        "inspection_total": 606,
        "out_of_service_total": 4
      },
      "vehicle": {
        "inspection_total": 276,
        "out_of_service_total": 32
      },
      "unsafe_driving": {
        "inspections_with_violations": 74,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 15,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 7,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 87,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    },
    {
      "batch_date": "August, 2021",
      "inspection_total": 604,
      "driver": {
        "inspection_total": 598,
        "out_of_service_total": 4
      },
      "vehicle": {
        "inspection_total": 276,
        "out_of_service_total": 35
      },
      "unsafe_driving": {
        "inspections_with_violations": 74,
        "performance_measure_value": 1,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "hours_of_service": {
        "inspections_with_violations": 14,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "driver_fitness": {
        "inspections_with_violations": 7,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "controlled_substance": {
        "inspections_with_violations": 0,
        "performance_measure_value": 0,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      },
      "vehicle_maintenance": {
        "inspections_with_violations": 91,
        "performance_measure_value": 2,
        "acute_critical_indicator": false,
        "percentile": null,
        "over_intervention_threshold": false,
        "basic_alert": false
      }
    }
  ]
}