Ingest device events
curl --request POST \
--url https://api.example.com/v1/device_events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"id": "<string>",
"device": "<string>",
"at": "2023-11-07T05:31:56Z",
"barcode": {
"symbology": "<string>",
"value": "<string>"
},
"parent": "<string>",
"reason": "<string>",
"location": {
"facility": "<string>",
"zone": "<string>"
},
"readings": {},
"latitude": 123,
"longitude": 123,
"speed": {
"value": 123,
"unit": "<string>"
},
"geofence": "<string>",
"slot": "<string>",
"pin_issued": true
}
]
}
'import requests
url = "https://api.example.com/v1/device_events"
payload = { "events": [
{
"id": "<string>",
"device": "<string>",
"at": "2023-11-07T05:31:56Z",
"barcode": {
"symbology": "<string>",
"value": "<string>"
},
"parent": "<string>",
"reason": "<string>",
"location": {
"facility": "<string>",
"zone": "<string>"
},
"readings": {},
"latitude": 123,
"longitude": 123,
"speed": {
"value": 123,
"unit": "<string>"
},
"geofence": "<string>",
"slot": "<string>",
"pin_issued": True
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
id: '<string>',
device: '<string>',
at: '2023-11-07T05:31:56Z',
barcode: {symbology: '<string>', value: '<string>'},
parent: '<string>',
reason: '<string>',
location: {facility: '<string>', zone: '<string>'},
readings: {},
latitude: 123,
longitude: 123,
speed: {value: 123, unit: '<string>'},
geofence: '<string>',
slot: '<string>',
pin_issued: true
}
]
})
};
fetch('https://api.example.com/v1/device_events', 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.example.com/v1/device_events",
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([
'events' => [
[
'id' => '<string>',
'device' => '<string>',
'at' => '2023-11-07T05:31:56Z',
'barcode' => [
'symbology' => '<string>',
'value' => '<string>'
],
'parent' => '<string>',
'reason' => '<string>',
'location' => [
'facility' => '<string>',
'zone' => '<string>'
],
'readings' => [
],
'latitude' => 123,
'longitude' => 123,
'speed' => [
'value' => 123,
'unit' => '<string>'
],
'geofence' => '<string>',
'slot' => '<string>',
'pin_issued' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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.example.com/v1/device_events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"id\": \"<string>\",\n \"device\": \"<string>\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"barcode\": {\n \"symbology\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"parent\": \"<string>\",\n \"reason\": \"<string>\",\n \"location\": {\n \"facility\": \"<string>\",\n \"zone\": \"<string>\"\n },\n \"readings\": {},\n \"latitude\": 123,\n \"longitude\": 123,\n \"speed\": {\n \"value\": 123,\n \"unit\": \"<string>\"\n },\n \"geofence\": \"<string>\",\n \"slot\": \"<string>\",\n \"pin_issued\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/device_events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"id\": \"<string>\",\n \"device\": \"<string>\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"barcode\": {\n \"symbology\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"parent\": \"<string>\",\n \"reason\": \"<string>\",\n \"location\": {\n \"facility\": \"<string>\",\n \"zone\": \"<string>\"\n },\n \"readings\": {},\n \"latitude\": 123,\n \"longitude\": 123,\n \"speed\": {\n \"value\": 123,\n \"unit\": \"<string>\"\n },\n \"geofence\": \"<string>\",\n \"slot\": \"<string>\",\n \"pin_issued\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/device_events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"id\": \"<string>\",\n \"device\": \"<string>\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"barcode\": {\n \"symbology\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"parent\": \"<string>\",\n \"reason\": \"<string>\",\n \"location\": {\n \"facility\": \"<string>\",\n \"zone\": \"<string>\"\n },\n \"readings\": {},\n \"latitude\": 123,\n \"longitude\": 123,\n \"speed\": {\n \"value\": 123,\n \"unit\": \"<string>\"\n },\n \"geofence\": \"<string>\",\n \"slot\": \"<string>\",\n \"pin_issued\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 123,
"rejected": 123,
"errors": [
{
"index": 123,
"code": "<string>",
"message": "<string>"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}IoT
Ingest device events
POST
/
v1
/
device_events
Ingest device events
curl --request POST \
--url https://api.example.com/v1/device_events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"id": "<string>",
"device": "<string>",
"at": "2023-11-07T05:31:56Z",
"barcode": {
"symbology": "<string>",
"value": "<string>"
},
"parent": "<string>",
"reason": "<string>",
"location": {
"facility": "<string>",
"zone": "<string>"
},
"readings": {},
"latitude": 123,
"longitude": 123,
"speed": {
"value": 123,
"unit": "<string>"
},
"geofence": "<string>",
"slot": "<string>",
"pin_issued": true
}
]
}
'import requests
url = "https://api.example.com/v1/device_events"
payload = { "events": [
{
"id": "<string>",
"device": "<string>",
"at": "2023-11-07T05:31:56Z",
"barcode": {
"symbology": "<string>",
"value": "<string>"
},
"parent": "<string>",
"reason": "<string>",
"location": {
"facility": "<string>",
"zone": "<string>"
},
"readings": {},
"latitude": 123,
"longitude": 123,
"speed": {
"value": 123,
"unit": "<string>"
},
"geofence": "<string>",
"slot": "<string>",
"pin_issued": True
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
id: '<string>',
device: '<string>',
at: '2023-11-07T05:31:56Z',
barcode: {symbology: '<string>', value: '<string>'},
parent: '<string>',
reason: '<string>',
location: {facility: '<string>', zone: '<string>'},
readings: {},
latitude: 123,
longitude: 123,
speed: {value: 123, unit: '<string>'},
geofence: '<string>',
slot: '<string>',
pin_issued: true
}
]
})
};
fetch('https://api.example.com/v1/device_events', 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.example.com/v1/device_events",
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([
'events' => [
[
'id' => '<string>',
'device' => '<string>',
'at' => '2023-11-07T05:31:56Z',
'barcode' => [
'symbology' => '<string>',
'value' => '<string>'
],
'parent' => '<string>',
'reason' => '<string>',
'location' => [
'facility' => '<string>',
'zone' => '<string>'
],
'readings' => [
],
'latitude' => 123,
'longitude' => 123,
'speed' => [
'value' => 123,
'unit' => '<string>'
],
'geofence' => '<string>',
'slot' => '<string>',
'pin_issued' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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.example.com/v1/device_events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"id\": \"<string>\",\n \"device\": \"<string>\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"barcode\": {\n \"symbology\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"parent\": \"<string>\",\n \"reason\": \"<string>\",\n \"location\": {\n \"facility\": \"<string>\",\n \"zone\": \"<string>\"\n },\n \"readings\": {},\n \"latitude\": 123,\n \"longitude\": 123,\n \"speed\": {\n \"value\": 123,\n \"unit\": \"<string>\"\n },\n \"geofence\": \"<string>\",\n \"slot\": \"<string>\",\n \"pin_issued\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/device_events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"id\": \"<string>\",\n \"device\": \"<string>\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"barcode\": {\n \"symbology\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"parent\": \"<string>\",\n \"reason\": \"<string>\",\n \"location\": {\n \"facility\": \"<string>\",\n \"zone\": \"<string>\"\n },\n \"readings\": {},\n \"latitude\": 123,\n \"longitude\": 123,\n \"speed\": {\n \"value\": 123,\n \"unit\": \"<string>\"\n },\n \"geofence\": \"<string>\",\n \"slot\": \"<string>\",\n \"pin_issued\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/device_events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"id\": \"<string>\",\n \"device\": \"<string>\",\n \"at\": \"2023-11-07T05:31:56Z\",\n \"barcode\": {\n \"symbology\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"parent\": \"<string>\",\n \"reason\": \"<string>\",\n \"location\": {\n \"facility\": \"<string>\",\n \"zone\": \"<string>\"\n },\n \"readings\": {},\n \"latitude\": 123,\n \"longitude\": 123,\n \"speed\": {\n \"value\": 123,\n \"unit\": \"<string>\"\n },\n \"geofence\": \"<string>\",\n \"slot\": \"<string>\",\n \"pin_issued\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 123,
"rejected": 123,
"errors": [
{
"index": 123,
"code": "<string>",
"message": "<string>"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}Authorizations
apiKeyoauth2
sk_test_ / sk_live_ / rk_test_ / rk_live_ keys
Headers
Act on behalf of a connected account (acct_...)
Body
application/json
Maximum array length:
1000Show child attributes
Show child attributes