POST
/
vehicles
/
{id}
/
batch
curl "https://api.smartcar.com/v2.0/vehicles/{id}/batch" \
-H "Authorization: Bearer {token}" \
-X "POST" \
-H "Content-Type: application/json" \
-d '{"requests": [{ "path" : "/odometer" }, { "path" : "/location" }]}'

{
  "responses": [
    {
      "path": "/odometer",
      "body": {
        "distance": 37829
      },
      "code": 200,
      "headers": {
        "sc-data-age": "2019-10-24T00:43:46.000Z",
        "sc-unit-system": "metric"
      }
    },
    {
      "path": "/location",
      "body": {
        "latitude": 37.4292,
        "longitude": 122.1381
      },
      "code": 200,
      "headers": {
        "sc-data-age": "2019-10-24T00:43:46.000Z"
      }
    }
  ]
}

Each endpoint in the batch counts against your request limit for a vehicle.

Request

Path

id
string
required

The vehicle ID of the vehicle you are making a request to.

Body

requests
array
required

An array of requests to make.

curl "https://api.smartcar.com/v2.0/vehicles/{id}/batch" \
-H "Authorization: Bearer {token}" \
-X "POST" \
-H "Content-Type: application/json" \
-d '{"requests": [{ "path" : "/odometer" }, { "path" : "/location" }]}'

Response

responses
array

The responses from Smartcar.

{
  "responses": [
    {
      "path": "/odometer",
      "body": {
        "distance": 37829
      },
      "code": 200,
      "headers": {
        "sc-data-age": "2019-10-24T00:43:46.000Z",
        "sc-unit-system": "metric"
      }
    },
    {
      "path": "/location",
      "body": {
        "latitude": 37.4292,
        "longitude": 122.1381
      },
      "code": 200,
      "headers": {
        "sc-data-age": "2019-10-24T00:43:46.000Z"
      }
    }
  ]
}