Skip to main content

Fetch API

Retrieve raw vehicle data objects and index keys from cloud storage.

Overview

The Fetch API provides access to raw vehicle data stored in the cloud. It allows developers to retrieve CloudEvent-formatted data objects and their corresponding index keys for a given vehicle. You can search by various criteria including time range, producer, source, and data type. This API requires a Vehicle JWT obtained via the Token Exchange API.

Base URL

https://fetch-api.dimo.zone

Endpoints

Get multiple index keys

Retrieves a list of index keys that match the provided search options. Index keys reference stored data objects and can be filtered by time range, producer, source, and type.

Parameters

tokenIdstringRequired
The Vehicle Token ID to retrieve index keys for.
typestringOptional
Filter by event type (e.g. reverse-DNS format).
sourcestringOptional
Filter by the source context where the event occurred.
producerstringOptional
Filter by the instance, process, or device that created the event.
idstringOptional
Filter by event identifier.
afterstringOptional
Return results after this timestamp.
beforestringOptional
Return results before this timestamp.
limitintegerOptional
Maximum number of results to return.
GET/v1/vehicle/index-keys/:tokenId
const indexKeys = await dimo.fetch.getIndexKeys({
vehicleJwt: "eyJhbGc...ILlujqw",
tokenId: 123456,
type: "dimo.status",
limit: 10
})
Response
[
{
"id": "2rFsUBSVMeMbhuto7EST0ISqPMX",
"source": "dimo/integration/2lcaMFuCO2MroGjBYuFqLhwPn9v",
"producer": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"specversion": "1.0",
"subject": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"time": "2024-06-01T12:00:00Z",
"type": "dimo.status",
"datacontenttype": "application/json",
"dataversion": "fleet/2.0",
"data": {
"key": "some/object/key"
}
}
]

Get latest index key

Retrieves the most recent index key that matches the provided search options. Useful for quickly finding the latest data point without fetching the full object.

Parameters

tokenIdstringRequired
The Vehicle Token ID to retrieve the latest index key for.
typestringOptional
Filter by event type (e.g. reverse-DNS format).
sourcestringOptional
Filter by the source context where the event occurred.
producerstringOptional
Filter by the instance, process, or device that created the event.
idstringOptional
Filter by event identifier.
afterstringOptional
Return results after this timestamp.
beforestringOptional
Return results before this timestamp.
limitintegerOptional
Maximum number of results to return.
GET/v1/vehicle/latest-index-key/:tokenId
const latestIndexKey = await dimo.fetch.getLatestIndexKey({
vehicleJwt: "eyJhbGc...ILlujqw",
tokenId: 123456,
type: "dimo.status"
})
Response
{
"id": "2rFsUBSVMeMbhuto7EST0ISqPMX",
"source": "dimo/integration/2lcaMFuCO2MroGjBYuFqLhwPn9v",
"producer": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"specversion": "1.0",
"subject": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"time": "2024-06-01T12:00:00Z",
"type": "dimo.status",
"datacontenttype": "application/json",
"dataversion": "fleet/2.0",
"data": {
"key": "some/object/key"
}
}

Get latest object

Retrieves the content of the most recent data object that matches the provided search options. Returns the full CloudEvent with the raw data payload.

Parameters

tokenIdstringRequired
The Vehicle Token ID to retrieve the latest object for.
typestringOptional
Filter by event type (e.g. reverse-DNS format).
sourcestringOptional
Filter by the source context where the event occurred.
producerstringOptional
Filter by the instance, process, or device that created the event.
idstringOptional
Filter by event identifier.
afterstringOptional
Return results after this timestamp.
beforestringOptional
Return results before this timestamp.
limitintegerOptional
Maximum number of results to return.
GET/v1/vehicle/latest-object/:tokenId
const latestObject = await dimo.fetch.getLatestObject({
vehicleJwt: "eyJhbGc...ILlujqw",
tokenId: 123456,
type: "dimo.status"
})
Response
{
"id": "2rFsUBSVMeMbhuto7EST0ISqPMX",
"source": "dimo/integration/2lcaMFuCO2MroGjBYuFqLhwPn9v",
"producer": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"specversion": "1.0",
"subject": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"time": "2024-06-01T12:00:00Z",
"type": "dimo.status",
"datacontenttype": "application/json",
"dataschema": "",
"dataversion": "fleet/2.0",
"signature": "0x...",
"tags": ["status"],
"data": { ... }
}

Get multiple objects

Retrieves the content of multiple data objects that match the provided search options. Returns an array of full CloudEvents with raw data payloads.

Parameters

tokenIdstringRequired
The Vehicle Token ID to retrieve objects for.
typestringOptional
Filter by event type (e.g. reverse-DNS format).
sourcestringOptional
Filter by the source context where the event occurred.
producerstringOptional
Filter by the instance, process, or device that created the event.
idstringOptional
Filter by event identifier.
afterstringOptional
Return results after this timestamp.
beforestringOptional
Return results before this timestamp.
limitintegerOptional
Maximum number of results to return.
GET/v1/vehicle/objects/:tokenId
const objects = await dimo.fetch.getObjects({
vehicleJwt: "eyJhbGc...ILlujqw",
tokenId: 123456,
type: "dimo.status",
limit: 10
})
Response
[
{
"id": "2rFsUBSVMeMbhuto7EST0ISqPMX",
"source": "dimo/integration/2lcaMFuCO2MroGjBYuFqLhwPn9v",
"producer": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"specversion": "1.0",
"subject": "did:nft:1:0xbA5738a18d83D41847dfFbDC6101d37C69c9B0cF_123456",
"time": "2024-06-01T12:00:00Z",
"type": "dimo.status",
"datacontenttype": "application/json",
"dataschema": "",
"dataversion": "fleet/2.0",
"signature": "0x...",
"tags": ["status"],
"data": { ... }
}
]