Create a map share
curl --request POST \
--url https://api.hellotracks.com/v1/maps/shares \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"title": "Today's places",
"layers": [
{
"kind": "places"
},
{
"kind": "zones"
}
],
"expiresIn": "7d"
}
EOFimport requests
url = "https://api.hellotracks.com/v1/maps/shares"
payload = {
"title": "Today's places",
"layers": [{ "kind": "places" }, { "kind": "zones" }],
"expiresIn": "7d"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Today\'s places',
layers: [{kind: 'places'}, {kind: 'zones'}],
expiresIn: '7d'
})
};
fetch('https://api.hellotracks.com/v1/maps/shares', 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.hellotracks.com/v1/maps/shares",
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([
'title' => 'Today\'s places',
'layers' => [
[
'kind' => 'places'
],
[
'kind' => 'zones'
]
],
'expiresIn' => '7d'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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.hellotracks.com/v1/maps/shares"
payload := strings.NewReader("{\n \"title\": \"Today's places\",\n \"layers\": [\n {\n \"kind\": \"places\"\n },\n {\n \"kind\": \"zones\"\n }\n ],\n \"expiresIn\": \"7d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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.hellotracks.com/v1/maps/shares")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Today's places\",\n \"layers\": [\n {\n \"kind\": \"places\"\n },\n {\n \"kind\": \"zones\"\n }\n ],\n \"expiresIn\": \"7d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hellotracks.com/v1/maps/shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Today's places\",\n \"layers\": [\n {\n \"kind\": \"places\"\n },\n {\n \"kind\": \"zones\"\n }\n ],\n \"expiresIn\": \"7d\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"share": {
"id": "map_abcdefghijk234567mnop2",
"token": "map_abcdefghijk234567mnop2",
"url": "https://live.hellotracks.com/share/maps/map_abcdefghijk234567mnop2",
"apiUrl": "https://api.hellotracks.com/api/share/maps/map_abcdefghijk234567mnop2",
"title": "Hellotracks places",
"kind": "places",
"source": "public_api",
"companyId": "c1d2e3",
"companyName": "Example Plumbing",
"createdById": "c1d2e3",
"createdByName": "Example Plumbing",
"createdAt": 1793520000000,
"expiresAt": 1794124800000,
"revokedAt": 0,
"expired": false,
"revoked": false,
"featureCount": 2,
"hasMore": false,
"aborted": false,
"spec": {
"kind": "places",
"layers": [
{
"kind": "places",
"id": "places",
"title": "Hellotracks places",
"featureCount": 2,
"hasMore": false,
"aborted": false
}
]
},
"layers": [
{
"kind": "places",
"id": "places",
"title": "Hellotracks places",
"featureCount": 2,
"hasMore": false,
"aborted": false
}
],
"bounds": {
"minLng": -122.4194,
"minLat": 37.7749,
"maxLng": -122.3937,
"maxLat": 37.7955
}
}
},
"error": null,
"meta": {
"path": "/v1/maps/shares",
"method": "POST"
}
}{
"data": null,
"error": {
"code": "invalid_request",
"message": "date must be YYYY-MM-DD"
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "invalid_api_key",
"message": "Invalid Hellotracks API key."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "forbidden",
"message": "No permission."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "invalid_request",
"message": "<string>"
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "throttled",
"message": "Too many requests."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "internal_error",
"message": "Hellotracks API is temporarily unavailable."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}Maps
Create a map share
Renders the map like POST /maps/render, stores the result as a snapshot and returns a public link that needs no API key. The link lives 7 days by default, at most 30 days. A snapshot over 8 MB is refused with 413 (code too_large_for_share). Status 200, not 201. Workers are refused with 403 (code permission_denied).
POST
/
maps
/
shares
Create a map share
curl --request POST \
--url https://api.hellotracks.com/v1/maps/shares \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"title": "Today's places",
"layers": [
{
"kind": "places"
},
{
"kind": "zones"
}
],
"expiresIn": "7d"
}
EOFimport requests
url = "https://api.hellotracks.com/v1/maps/shares"
payload = {
"title": "Today's places",
"layers": [{ "kind": "places" }, { "kind": "zones" }],
"expiresIn": "7d"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Today\'s places',
layers: [{kind: 'places'}, {kind: 'zones'}],
expiresIn: '7d'
})
};
fetch('https://api.hellotracks.com/v1/maps/shares', 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.hellotracks.com/v1/maps/shares",
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([
'title' => 'Today\'s places',
'layers' => [
[
'kind' => 'places'
],
[
'kind' => 'zones'
]
],
'expiresIn' => '7d'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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.hellotracks.com/v1/maps/shares"
payload := strings.NewReader("{\n \"title\": \"Today's places\",\n \"layers\": [\n {\n \"kind\": \"places\"\n },\n {\n \"kind\": \"zones\"\n }\n ],\n \"expiresIn\": \"7d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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.hellotracks.com/v1/maps/shares")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Today's places\",\n \"layers\": [\n {\n \"kind\": \"places\"\n },\n {\n \"kind\": \"zones\"\n }\n ],\n \"expiresIn\": \"7d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hellotracks.com/v1/maps/shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Today's places\",\n \"layers\": [\n {\n \"kind\": \"places\"\n },\n {\n \"kind\": \"zones\"\n }\n ],\n \"expiresIn\": \"7d\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"share": {
"id": "map_abcdefghijk234567mnop2",
"token": "map_abcdefghijk234567mnop2",
"url": "https://live.hellotracks.com/share/maps/map_abcdefghijk234567mnop2",
"apiUrl": "https://api.hellotracks.com/api/share/maps/map_abcdefghijk234567mnop2",
"title": "Hellotracks places",
"kind": "places",
"source": "public_api",
"companyId": "c1d2e3",
"companyName": "Example Plumbing",
"createdById": "c1d2e3",
"createdByName": "Example Plumbing",
"createdAt": 1793520000000,
"expiresAt": 1794124800000,
"revokedAt": 0,
"expired": false,
"revoked": false,
"featureCount": 2,
"hasMore": false,
"aborted": false,
"spec": {
"kind": "places",
"layers": [
{
"kind": "places",
"id": "places",
"title": "Hellotracks places",
"featureCount": 2,
"hasMore": false,
"aborted": false
}
]
},
"layers": [
{
"kind": "places",
"id": "places",
"title": "Hellotracks places",
"featureCount": 2,
"hasMore": false,
"aborted": false
}
],
"bounds": {
"minLng": -122.4194,
"minLat": 37.7749,
"maxLng": -122.3937,
"maxLat": 37.7955
}
}
},
"error": null,
"meta": {
"path": "/v1/maps/shares",
"method": "POST"
}
}{
"data": null,
"error": {
"code": "invalid_request",
"message": "date must be YYYY-MM-DD"
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "invalid_api_key",
"message": "Invalid Hellotracks API key."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "forbidden",
"message": "No permission."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "invalid_request",
"message": "<string>"
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "throttled",
"message": "Too many requests."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}{
"data": null,
"error": {
"code": "internal_error",
"message": "Hellotracks API is temporarily unavailable."
},
"meta": {
"path": "/jobs",
"method": "GET"
}
}Authorizations
Body
application/json
Same fields as MapRenderRequest, plus the link lifetime.