TopTracking Logo

Carrier API Documentation v1.0

Access your fleet data through our RESTful API
Test Endpoints in Swagger Download Postman Collection

TopTracking Carrier API Documentation

Base URL

Production: https://vendor.toptracking.com

Overview

The TopTracking Carrier API provides secure access to carrier-specific data and fleet information. All endpoints require API key authentication via the x-api-key header.

Authentication

All endpoints require an API key to be provided in the request header.

API Key Authentication

Include your API key in the x-api-key header with every request:

GET /carrier/v1/company/info
x-api-key: your-api-key-here

Important: Keep your API key secure and never expose it in client-side code or public repositories.

Rate Limiting

API requests are subject to rate limiting to ensure fair usage and system stability. Rate limits are applied per API key.

Rate Limit Headers

The API includes rate limit information in response headers:

Rate Limit Tiers

Tier Requests per Minute Requests per Day Requests per Month
Basic 60 5,000 100,000

If you exceed the rate limit, you will receive a 429 Too Many Requests response.

Common Response Codes

Status Code Description Error Code
200 Success -
400 Bad Request - Invalid parameters bad_request
401 Unauthorized - Invalid or missing API key unauthorized
404 Not Found - Resource not found not_found
429 Too Many Requests - Rate limit exceeded too_many_requests
500 Internal Server Error internal_server_error
503 Service Unavailable - External service unavailable service_unavailable

Error Response Format

When an error occurs, the API returns a standardized JSON object with error details:

{
  "error": "bad_request",
  "errorDescription": "VIN is required"
}

Error Field Values:

Endpoints

Get Company Information

Retrieves basic information about the authenticated carrier company.

Endpoint: GET /carrier/v1/company/info

Headers:

Response: 200 OK

{
  "name": "ABC Trucking Company",
  "dotNumber": "1234567",
  "isOwnerOperator": false
}

Response Fields:

Error Responses:

Example Request:

curl -X GET "https://vendor.toptracking.com/carrier/v1/company/info" \
  -H "x-api-key: your-api-key-here"

Example Response:

{
  "name": "ABC Trucking Company",
  "dotNumber": "1234567",
  "isOwnerOperator": false
}

Get Vehicle Snapshots

Retrieves snapshot data for all vehicles in the carrier's fleet.

Endpoint: GET /carrier/v1/snapshots

Headers:

Response: 200 OK

Returns an array of vehicle snapshot objects.

Example Request:

curl -X GET "https://vendor.toptracking.com/carrier/v1/snapshots" \
  -H "x-api-key: your-api-key-here"

Example Response:

[
  {
    "assetId": 12345,
    "number": "TRUCK-001",
    "vin": "1HGBH41JXMN109186",
    "location": {
      "latitude": 40.7128,
      "longitude": -74.0060,
      "timestamp": "2024-01-15T10:30:00Z"
    },
    "dotNumber": "1234567"
  },
  {
    "assetId": 12346,
    "number": "TRUCK-002",
    "vin": "1HGBH41JXMN109187",
    "location": {
      "latitude": 40.7580,
      "longitude": -73.9855,
      "timestamp": "2024-01-15T10:25:00Z"
    },
    "dotNumber": "1234567"
  }
]

Response Fields:

Error Responses:


Get Vehicle Snapshot by Asset ID

Retrieves snapshot data for a specific vehicle/asset.

Endpoint: GET /carrier/v1/snapshots/{assetId}

Path Parameters:

Headers:

Response: 200 OK

Returns a single vehicle snapshot object.

Example Request:

curl -X GET "https://vendor.toptracking.com/carrier/v1/snapshots/12345" \
  -H "x-api-key: your-api-key-here"

Example Response:

{
  "assetId": 12345,
  "number": "TRUCK-001",
  "vin": "1HGBH41JXMN109186",
  "location": {
    "latitude": 40.7128,
    "longitude": -74.0060,
    "timestamp": "2024-01-15T10:30:00Z"
  },
  "dotNumber": "1234567"
}

Response Fields:

Error Responses:


Get Tractors

Retrieves all tractors/vehicles in the carrier's fleet.

Endpoint: GET /carrier/v1/tractors

Headers:

Response: 200 OK

Returns an array of tractor/vehicle objects.

Example Request:

curl -X GET "https://vendor.toptracking.com/carrier/v1/tractors" \
  -H "x-api-key: your-api-key-here"

Example Response:

[
  {
    "assetId": 12345,
    "number": "TRUCK-001",
    "vin": "1HGBH41JXMN109186"
  },
  {
    "assetId": 12346,
    "number": "TRUCK-002",
    "vin": "1HGBH41JXMN109187"
  }
]

Response Fields:

Error Responses:


Get DOT Number by VIN

Retrieves the DOT number associated with a vehicle by its VIN (Vehicle Identification Number).

Endpoint: GET /carrier/v1/vehicles/{vin}/dot-number

Path Parameters:

Headers:

Response: 200 OK

{
  "vin": "1HGBH41JXMN109186",
  "dotNumber": "1234567"
}

Response Fields:

Example Request:

curl -X GET "https://vendor.toptracking.com/carrier/v1/vehicles/1HGBH41JXMN109186/dot-number" \
  -H "x-api-key: your-api-key-here"

Example Response:

{
  "vin": "1HGBH41JXMN109186",
  "dotNumber": "1234567"
}

Error Responses:


Best Practices

API Key Security

  1. Never commit API keys to version control
  2. Use environment variables to store API keys in your application
  3. Rotate API keys periodically for enhanced security
  4. Use HTTPS only - Never make API calls over unencrypted connections

Error Handling

Always implement proper error handling in your application:

  1. Check response status codes before processing response data
  2. Handle rate limiting - Implement exponential backoff when receiving 429 responses
  3. Retry logic - For transient errors (503), implement retry logic with exponential backoff
  4. Log errors - Log API errors for debugging and monitoring

Rate Limiting

  1. Monitor rate limit headers to avoid hitting limits
  2. Implement caching where appropriate to reduce API calls
  3. Batch requests when possible to minimize API usage
  4. Respect rate limits - Do not attempt to bypass or exceed rate limits

Request Optimization

  1. Use appropriate endpoints - Use specific endpoints (e.g., by asset ID) when you only need specific data
  2. Cache responses - Cache data that doesn't change frequently
  3. Minimize requests - Combine multiple data needs into fewer requests when possible

Support

For API support, rate limit increases, or to report issues, please contact your TopTracking account representative.

Changelog

Version 1.0