SDKs and Libraries
The Pointeron REST API is the primary way to integrate with the platform. You can use any HTTP client in any language. Below are ready-to-use examples for the most common languages, along with information about code generation from our OpenAPI specification.
Official SDKs for JavaScript, Python, PHP, and Go are coming soon. In the meantime, use the REST API directly with any HTTP client. The examples below will get you started quickly.
cURL
cURL is available on virtually every platform and is the simplest way to test the API.
List assets with cURL
curl https://api.pointeron.com/v2/assets \
-H "Authorization: Bearer sk_live_your_api_key_here"
Create an asset with cURL
curl -X POST https://api.pointeron.com/v2/assets \
-H "Authorization: Bearer sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"name": "Delivery Van 01", "type": "vehicle"}'
JavaScript / Node.js
Use the built-in fetch API (Node.js 18+) or any HTTP library like axios.
List assets
const API_KEY = process.env.POINTERON_API_KEY
const response = await fetch('https://api.pointeron.com/v2/assets', {
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
})
const { data, meta } = await response.json()
console.log(`Fetched ${data.length} assets, has_more: ${meta.has_more}`)
Push a location point
const response = await fetch('https://api.pointeron.com/v2/locations', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
device_id: 'dev_xgQQXg3hrtjh7AvZ',
latitude: 46.0569,
longitude: 14.5058,
speed: 45.2,
recorded_at: new Date().toISOString(),
}),
})
const location = await response.json()
console.log('Location created:', location.data.id)
Python
Use the requests library for straightforward HTTP calls.
List assets
import os
import requests
API_KEY = os.environ['POINTERON_API_KEY']
BASE_URL = 'https://api.pointeron.com/v2'
response = requests.get(
f'{BASE_URL}/assets',
headers={'Authorization': f'Bearer {API_KEY}'},
)
data = response.json()
for asset in data['data']:
print(f"{asset['id']}: {asset['name']}")
Create an asset
response = requests.post(
f'{BASE_URL}/assets',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json',
},
json={
'name': 'Delivery Van 01',
'type': 'vehicle',
'metadata': {'plate': 'LJ-AB-123'},
},
)
asset = response.json()
print(f"Created asset: {asset['data']['id']}")
PHP
Use Guzzle or any PSR-18 compliant HTTP client.
List assets
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'https://api.pointeron.com/v2/',
'headers' => [
'Authorization' => 'Bearer ' . getenv('POINTERON_API_KEY'),
'Content-Type' => 'application/json',
],
]);
$response = $client->get('assets');
$data = json_decode($response->getBody(), true);
foreach ($data['data'] as $asset) {
echo $asset['id'] . ': ' . $asset['name'] . PHP_EOL;
}
Push a location point
$response = $client->post('locations', [
'json' => [
'device_id' => 'dev_xgQQXg3hrtjh7AvZ',
'latitude' => 46.0569,
'longitude' => 14.5058,
'speed' => 45.2,
'recorded_at' => gmdate('Y-m-d\TH:i:s\Z'),
],
]);
$location = json_decode($response->getBody(), true);
echo 'Location created: ' . $location['data']['id'] . PHP_EOL;
OpenAPI code generation
The Pointeron API publishes an OpenAPI 3.0 specification that you can use to auto-generate client libraries in any language.
Download the OpenAPI spec
curl -o pointeron-openapi.json https://api.pointeron.com/v2/openapi.json
You can feed this specification into tools like OpenAPI Generator, Speakeasy, or your language's native code generation tooling to produce a fully typed client.
Generate a TypeScript client
npx @openapitools/openapi-generator-cli generate \
-i pointeron-openapi.json \
-g typescript-fetch \
-o ./pointeron-client