curl --request POST \
--url https://api.withterminal.com/tsp/v1/passthrough \
--header 'Authorization: Bearer <token>' \
--header 'Connection-Token: <connection-token>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "POST",
"path": "/reports",
"headers": {},
"body": "{\"reportId\":\"1234\"}"
}
'import requests
url = "https://api.withterminal.com/tsp/v1/passthrough"
payload = {
"method": "POST",
"path": "/reports",
"headers": {},
"body": "{\"reportId\":\"1234\"}"
}
headers = {
"Connection-Token": "<connection-token>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connection-Token': '<connection-token>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method: 'POST',
path: '/reports',
headers: {},
body: JSON.stringify('{"reportId":"1234"}')
})
};
fetch('https://api.withterminal.com/tsp/v1/passthrough', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withterminal.com/tsp/v1/passthrough",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'POST',
'path' => '/reports',
'headers' => [
],
'body' => '{"reportId":"1234"}'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connection-Token: <connection-token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withterminal.com/tsp/v1/passthrough"
payload := strings.NewReader("{\n \"method\": \"POST\",\n \"path\": \"/reports\",\n \"headers\": {},\n \"body\": \"{\\\"reportId\\\":\\\"1234\\\"}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connection-Token", "<connection-token>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withterminal.com/tsp/v1/passthrough")
.header("Connection-Token", "<connection-token>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"POST\",\n \"path\": \"/reports\",\n \"headers\": {},\n \"body\": \"{\\\"reportId\\\":\\\"1234\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withterminal.com/tsp/v1/passthrough")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connection-Token"] = '<connection-token>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"POST\",\n \"path\": \"/reports\",\n \"headers\": {},\n \"body\": \"{\\\"reportId\\\":\\\"1234\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"method": "POST",
"path": "/reports",
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
},
"response": {
"reportId": "1234"
}
}{
"code": "bad_request",
"message": "Invalid request body",
"detail": [
{
"message": "'vehicleId' property must be a valid ulid",
"path": "{requestQuery}.vehicleId",
"suggestion": "Please ensure you submit a valid 'vehicleId' property",
"context": {}
}
]
}{
"code": "unauthorized",
"message": "Unauthorized Request",
"detail": "Please ensure you have a valid API key"
}{
"code": "forbidden",
"message": "Forbidden Request",
"detail": "Please ensure the connection token matches the resource you are attempting to access."
}{
"code": "connection_deleted",
"message": "Connection has been deleted, cannot execute action"
}{
"code": "connection_disconnected",
"message": "Connection must be connected to perform this action",
"detail": []
}{
"code": "too_many_requests",
"message": "Too Many Requests",
"retryAfter": 60,
"detail": "You have exceeded your rate limit. Please try again later."
}{
"code": "internal_server_error",
"message": "Internal Server Error",
"detail": "Something went wrong"
}{
"code": "not_implemented",
"message": "Not Implemented",
"detail": "This endpoint is not yet implemented"
}{
"code": "bad_gateway",
"message": "Provider Unavailable",
"detail": "Error response received from provider with status 500"
}{
"code": "gateway_timeout",
"message": "Gateway Timeout"
}Passthrough
Make an authenticated request to the underlying telematics provider.
curl --request POST \
--url https://api.withterminal.com/tsp/v1/passthrough \
--header 'Authorization: Bearer <token>' \
--header 'Connection-Token: <connection-token>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "POST",
"path": "/reports",
"headers": {},
"body": "{\"reportId\":\"1234\"}"
}
'import requests
url = "https://api.withterminal.com/tsp/v1/passthrough"
payload = {
"method": "POST",
"path": "/reports",
"headers": {},
"body": "{\"reportId\":\"1234\"}"
}
headers = {
"Connection-Token": "<connection-token>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connection-Token': '<connection-token>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method: 'POST',
path: '/reports',
headers: {},
body: JSON.stringify('{"reportId":"1234"}')
})
};
fetch('https://api.withterminal.com/tsp/v1/passthrough', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withterminal.com/tsp/v1/passthrough",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'POST',
'path' => '/reports',
'headers' => [
],
'body' => '{"reportId":"1234"}'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connection-Token: <connection-token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withterminal.com/tsp/v1/passthrough"
payload := strings.NewReader("{\n \"method\": \"POST\",\n \"path\": \"/reports\",\n \"headers\": {},\n \"body\": \"{\\\"reportId\\\":\\\"1234\\\"}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connection-Token", "<connection-token>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withterminal.com/tsp/v1/passthrough")
.header("Connection-Token", "<connection-token>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"POST\",\n \"path\": \"/reports\",\n \"headers\": {},\n \"body\": \"{\\\"reportId\\\":\\\"1234\\\"}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withterminal.com/tsp/v1/passthrough")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connection-Token"] = '<connection-token>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"POST\",\n \"path\": \"/reports\",\n \"headers\": {},\n \"body\": \"{\\\"reportId\\\":\\\"1234\\\"}\"\n}"
response = http.request(request)
puts response.read_body{
"method": "POST",
"path": "/reports",
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
},
"response": {
"reportId": "1234"
}
}{
"code": "bad_request",
"message": "Invalid request body",
"detail": [
{
"message": "'vehicleId' property must be a valid ulid",
"path": "{requestQuery}.vehicleId",
"suggestion": "Please ensure you submit a valid 'vehicleId' property",
"context": {}
}
]
}{
"code": "unauthorized",
"message": "Unauthorized Request",
"detail": "Please ensure you have a valid API key"
}{
"code": "forbidden",
"message": "Forbidden Request",
"detail": "Please ensure the connection token matches the resource you are attempting to access."
}{
"code": "connection_deleted",
"message": "Connection has been deleted, cannot execute action"
}{
"code": "connection_disconnected",
"message": "Connection must be connected to perform this action",
"detail": []
}{
"code": "too_many_requests",
"message": "Too Many Requests",
"retryAfter": 60,
"detail": "You have exceeded your rate limit. Please try again later."
}{
"code": "internal_server_error",
"message": "Internal Server Error",
"detail": "Something went wrong"
}{
"code": "not_implemented",
"message": "Not Implemented",
"detail": "This endpoint is not yet implemented"
}{
"code": "bad_gateway",
"message": "Provider Unavailable",
"detail": "Error response received from provider with status 500"
}{
"code": "gateway_timeout",
"message": "Gateway Timeout"
}/passthrough.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The token returned when a user authenticated their account. This authorizes access to a specific account.
^con_tkn_\S+$"con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4"
Body
The method for the third-party request, such as GET or POST.
GET, POST, PUT, PATCH, DELETE "POST"
The path for the third-party request, such as /reports
"/reports"
The headers to use for the request (Terminal will handle the connection's authorization headers)
The request body
"{\"reportId\":\"1234\"}"
Response
OK
The HTTP method that was used when making the request.
"POST"
The path that was called with the passthrough request.
"/reports"
The resulting status code from the passthrough request.
200
Any returned headers from the passthrough request.
{ "Content-Type": "application/json" }
The response body from the passthrough request
{ "reportId": "1234" }