Authentication
Public Token Exchange
Authentication
Vehicles
Drivers
Devices
Groups
Data Management
Providers
Webhook Events
- Event Types
- connection.created
- connection.disconnected
- connection.reconnected
- connection.completed
- connection.updated
- sync.requested
- sync.started
- sync.completed
- sync.failed
- connection.first_sync_completed
- issue.reported
- issue.resolved
- unsupported_provider.requested
- vehicle.added
- vehicle.modified
- vehicle.removed
- driver.added
- driver.modified
- driver.removed
- safety_event.added
- safety_event.modified
Authentication
Public Token Exchange
Exchange the publicToken
returned by our hosted authentication flow for a long lived connection token that will be used when requesting data from a customer’s TSP.
POST
/
public-token
/
exchange
curl --request POST \
--url https://api.withterminal.com/tsp/v1/public-token/exchange \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"publicToken": "pub_tkn_9jNzH26e5b9RgErDnRt8zfm5emDUUyyG"
}'
{
"id": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
"company": {
"name": "Frank's Trucking",
"dotNumbers": [
"1234567"
]
},
"account": {
"name": "Frank's Trucking",
"dotNumbers": [
"1234567"
],
"user": {
"sourceId": "1234567",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
}
},
"status": "connected",
"provider": {
"code": "geotab",
"name": "Geotab"
},
"externalId": "1234",
"sourceId": "123456789",
"syncMode": "automatic",
"token": "con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4",
"tags": [
"Tag Name"
],
"options": {
"ingestHistoryFromSourceSystem": true
},
"filters": {
"vehicles": {
"status": "active",
"excludeIds": [
"vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC"
]
},
"drivers": {
"status": "active",
"excludeIds": [
"drv_01D8ZQFGHVJ858NBF2Q7DV9MNC"
]
}
},
"linkUrl": "https://link.withterminal.com/connection/{CONNECTION_ID}?key={PUBLISHABLE_KEY}",
"createdAt": "2021-01-06T03:24:53.000Z",
"updatedAt": "2021-01-06T03:24:53.000Z"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200
application/json
OK
The connection your application has with your customer's TSP.
curl --request POST \
--url https://api.withterminal.com/tsp/v1/public-token/exchange \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"publicToken": "pub_tkn_9jNzH26e5b9RgErDnRt8zfm5emDUUyyG"
}'
{
"id": "conn_01GV12VR4DJP70GD1ZBK0SDWFH",
"company": {
"name": "Frank's Trucking",
"dotNumbers": [
"1234567"
]
},
"account": {
"name": "Frank's Trucking",
"dotNumbers": [
"1234567"
],
"user": {
"sourceId": "1234567",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
}
},
"status": "connected",
"provider": {
"code": "geotab",
"name": "Geotab"
},
"externalId": "1234",
"sourceId": "123456789",
"syncMode": "automatic",
"token": "con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4",
"tags": [
"Tag Name"
],
"options": {
"ingestHistoryFromSourceSystem": true
},
"filters": {
"vehicles": {
"status": "active",
"excludeIds": [
"vcl_01D8ZQFGHVJ858NBF2Q7DV9MNC"
]
},
"drivers": {
"status": "active",
"excludeIds": [
"drv_01D8ZQFGHVJ858NBF2Q7DV9MNC"
]
}
},
"linkUrl": "https://link.withterminal.com/connection/{CONNECTION_ID}?key={PUBLISHABLE_KEY}",
"createdAt": "2021-01-06T03:24:53.000Z",
"updatedAt": "2021-01-06T03:24:53.000Z"
}