NAV -image
bash javascript php python

Introduction

This documentation aims to provide all the information you need to work with our API.

Here is a API key to test our service as a demo mode ... but please note that all responses are replaced by falses positions when demo api key is used !

DEMO API KEY : "2|1whnHvTEzUTpCqza6jpdrVGZQeorprB3Kw8vI0Hk"

Base URL

http://localhost:8000

Authenticating requests

Authenticate requests to this API's endpoints by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

City management

Display a listing of cities matching search query

requires authentication

Example request:

curl -X GET \
    -G "http://localhost:8000/api/cities?s=arcachon" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cities"
);

let params = {
    "s": "arcachon",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://localhost:8000/api/cities',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            's'=> 'arcachon',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://localhost:8000/api/cities'
params = {
  's': 'arcachon',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

{
    "message": "Unauthenticated."
}

Request      

GET api/cities

Query Parameters

s  string  
city name or zip code to search.

Distance management

Display a distance matching search query

requires authentication

Example request:

curl -X GET \
    -G "http://localhost:8000/api/distances?sid=facilis&eid=esse" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/distances"
);

let params = {
    "sid": "facilis",
    "eid": "esse",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://localhost:8000/api/distances',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'sid'=> 'facilis',
            'eid'=> 'esse',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://localhost:8000/api/distances'
params = {
  'sid': 'facilis',
  'eid': 'esse',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

{
    "message": "Unauthenticated."
}

Request      

GET api/distances

Query Parameters

sid  string  
start track city id (city id comes from /api/cities/ results)

eid  string  
end track city id (city id comes from /api/cities/ results)

Display a distance matching search query with precise GPS points

requires authentication

Example request:

curl -X GET \
    -G "http://localhost:8000/api/distances/gps/qui/culpa/molestiae/molestiae" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/distances/gps/qui/culpa/molestiae/molestiae"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://localhost:8000/api/distances/gps/qui/culpa/molestiae/molestiae',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://localhost:8000/api/distances/gps/qui/culpa/molestiae/molestiae'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

{
    "message": "Unauthenticated."
}

Request      

GET api/distances/gps/{slat}/{slng}/{elat}/{elng}

URL Parameters

slat  string  

slng  string  

elat  string  

elng  string  

FullAddr management

Display a listing of addresses matching search query

requires authentication

Example request:

curl -X GET \
    -G "http://localhost:8000/api/fullAddrs?s=voluptatem" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/fullAddrs"
);

let params = {
    "s": "voluptatem",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://localhost:8000/api/fullAddrs',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            's'=> 'voluptatem',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://localhost:8000/api/fullAddrs'
params = {
  's': 'voluptatem',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

{
    "message": "Unauthenticated."
}

Request      

GET api/fullAddrs

Query Parameters

s  string  
search address