Track (API v1.0.0)
Pour faciliter l’exploitation des données collectées par l’application TRACK™. Cette API est mise à disposition des utilisateurs.
Veuillez nous contacter pour demander votre clé.
Les réponses sont au format JSONAPI
application/vnd.api+json
sauf les données strictements géographiques qui sont au format GeoJSONapplication/vnd.geo+json
Organisations ¶
Chez Tag-IP, chaque client facturé est une organisation. Sur la v3, un utilisateur peut appartenir à un ou plusieurs organisations. Une clé d’API correspond toujours à une seule Organisation.
Liste des organisations ¶
GET/organizations{?sort}
Example URI
- sort
array
(optional) Example: -nameAjouter un
-
pourdesc
default
:name
,id
Choices:
name
-name
id
-id
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/organizations"
},
"data": [
{
"type": "organization",
"id": "2MI",
"attributes": {
"name": "2MI",
"description": "Matériels et Maintenance Informatique"
},
"links": {
"self": "https://api.tag-ip.com/track/organizations/2MI"
}
},
{
"type": "organization",
"id": "TGP",
"attributes": {
"name": "Tag-IP",
"description": "Tag-IP Madagascar"
},
"links": {
"self": "https://api.tag-ip.com/track/organizations/TGP"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
}
},
"oneOf": [
{
"properties": {
"data": {
"type": "array"
}
}
},
{
"properties": {
"errors": {
"type": "array"
}
}
}
]
}
Afficher une organisation ¶
GET/organizations/{organization_id}
Example URI
- organization_id
string
(required) Example: TGP
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/organizations/TGP"
},
"data": {
"type": "organization",
"id": "TGP",
"attributes": {
"name": "Tag-IP",
"description": "Tag-IP Madagascar",
"billing_informations": {
"billable": "false"
},
"address": {
"city": "Antananarivo, Madagascar"
}
},
"relationships": {
"works_with": {
"data": [
{
"type": "organization",
"id": "2MI"
}
]
},
"fleets": {
"links": {
"self": "https://api.tag-ip.com/track/organizations/TGP/fleets"
},
"data": [
{
"type": "fleet",
"id": "TGP"
},
{
"type": "fleet",
"id": "TGP.TECH"
}
]
}
},
"included": [
{
"type": "organization",
"id": "2MI",
"attributes": {
"name": "2MI",
"links": {
"self": "https://api.tag-ip.com/track/organizations/2MI"
}
}
},
{
"type": "fleet",
"id": "TGP",
"attributes": {
"name": "Flotte racine"
},
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP"
}
},
{
"type": "fleet",
"id": "TGP.TECH",
"attributes": {
"name": "Techniciens"
},
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP.TECH"
}
}
]
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"billing_informations": {
"type": "object",
"properties": {
"billable": {
"type": "string"
}
}
},
"address": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
}
}
},
"required": [
"name"
]
},
"relationships": {
"type": "object",
"properties": {
"works_with": {
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
},
"fleets": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
}
},
"included": {
"type": "array"
}
},
"required": [
"type",
"id"
]
}
}
}
Flottes ¶
Une flotte est un regroupement d’objets trackables, elle permet de regrouper des règles de surveillances, de créer des rapports ou seulement de faciliter la surveillance.
Liste des flottes ¶
GET/fleets{?sort}
Lister les flottes accessibles à l’utilisateur.
Example URI
- sort
array
(optional) Example: -nameAjouter un
-
pourdesc
default
:/fleets (?sort=id)
Choices:
name
-name
id
-id
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/fleets/"
},
"data": [
{
"type": "fleet",
"id": "TGP",
"attributes": {
"name": "Tag-IP",
"description": "Flotte racine de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP"
}
},
{
"type": "fleet",
"id": "2MI",
"attributes": {
"name": "2MI",
"description": "Flotte racine de 2MI"
},
"links": {
"self": "https://api.tag-ip.com/track/fleets/2MI"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher une flotte ¶
GET/fleets/{id}
Example URI
- id
string
(required) Example: TGP
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP"
},
"data": {
"type": "fleet",
"id": "TGP",
"attributes": {
"name": "Tag-IP",
"description": "Flotte racine de Tag-IP"
},
"included": [
{
"type": "trackable",
"id": "TGP0001",
"attributes": {
"name": "Voiture 001"
},
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001"
}
},
{
"type": "event-description",
"id": "EE.TGP.GFC-OUT-1",
"attributes": {
"name": "Sortie zone de parking Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/event-descriptions/EE.TGP.GFC-OUT-1"
}
},
{
"type": "feature-collection",
"id": "TGP.POI",
"attributes": {
"name": "POI de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.POI"
}
},
{
"type": "feature-collection",
"id": "TGP.GFC",
"attributes": {
"name": "Géofences de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.GFC"
}
}
],
"relationships": {
"events": {
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP/events"
}
},
"trackables": {
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP/trackables"
},
"data": [
{
"type": "trackable",
"id": "TGP0001"
}
]
},
"event_descriptions": {
"links": {
"self": "https://api.tag-ip.com/track/event-descriptions"
},
"data": [
{
"type": "event-description",
"id": "EE.TGP.GFC-OUT-1"
}
]
},
"reports": {
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP/reports"
}
},
"feature-collections": {
"links": {
"self": "https://api.tag-ip.com/track/fleets/TGP/feature-collections"
},
"data": [
{
"type": "feature-collection",
"id": "TGP.POI"
},
{
"type": "feature-collection",
"id": "TGP.GFC"
}
]
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"included": {
"type": "array"
},
"relationships": {
"type": "object",
"properties": {
"events": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
}
}
},
"trackables": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
},
"event_descriptions": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
},
"reports": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
}
}
},
"feature-collections": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
}
}
}
}
}
}
Ajouter une flotte ¶
Ajouter une flotte
Request body details
-
id: 2MI (string, required)
-
name: 2MI (string, required)
-
description: 2MI (string, required)
-
feature_collection_ids: [] (array) - default value
-
is_visible: false (string) - default value
-
report-type_ids: [] (array) - default value
-
assigner_ids: [] (array) - default value
POST/fleets
Example URI
Headers
Authorization: Bearer <TOKEN>
Body
{
"id": "2MI",
"name": "2MI",
"description": "2MI",
"is_visible": false,
"feature_collection_ids": "2MI.GFC.2MI, 2MI.POI.2MIPOI",
"report_type_ids": "RPT.2MI.008",
"assigner_ids": "TGP"
}
201
Body
Creation of TGP fleet success
Modifier une flotte ¶
Modifier une flotte
Request body details
-
id: 2MI (string, required)
-
name: 2MI (string, required)
-
description: 2MI (string, required)
-
feature_collection_ids: [] (array) - default value
-
is_visible: false (string) - default value
-
report-type_ids: [] (array) - default value
-
assigner_ids: [] (array) - default value
PUT/fleets/{id}
Example URI
- id
string
(required) Example: TGP
Headers
Authorization: Bearer <TOKEN>
Body
{
"fleet_id": "2MI",
"name": "2MI",
"description": "2MI",
"is_visible": false,
"feature_collection_ids": "2MI.GFC.2MI, 2MI.POI.2MIPOI",
"report_type_ids": "RPT.2MI.008",
"assigner_ids": "TGP"
}
200
Body
Fleet TGP is updated with success
Traçables ¶
Un Traçable peut être un véhicule, un object, une personne associée à un traceur. Elle appartient à une Organisation. Elle peut être associée à 1 ou plusieurs Flottes.
Liste des traçables ¶
Afficher la liste des traçables visibles par l’utilisateur identifié
GET/trackables{?sort}
Example URI
- sort
array
(optional) Example: -nameAjouter un
-
pourdesc
default
:name
,id
,registration-number
Choices:
name
-name
id
-id
registration-number
-registration-number
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/trackables"
},
"data": [
{
"type": "trackable",
"id": "TGP0001",
"attributes": {
"name": "Véhicule 001"
},
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher un traçable ¶
Afficher un traçable.
GET/trackables/{trackable_id}
Example URI
- trackable_id
string
(required) Example: TGP0001
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001"
},
"data": {
"type": "trackable",
"id": "TGP0001",
"attributes": {
"name": "Véhicule 001",
"description": "Véhicule de test de Tag-IP"
}
},
"relationships": {
"status": {
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001/status"
}
},
"events": {
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001/events"
}
},
"activities": {
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001/activities"
}
},
"fleets": {
"data": [
{
"type": "fleet",
"id": "TGP"
}
]
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
}
},
"relationships": {
"type": "object",
"properties": {
"status": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
}
}
},
"events": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
}
}
},
"activities": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
}
}
},
"fleets": {
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
}
}
}
}
}
Afficher le status ¶
Afficher le status d’un traçable
Clé | Description | Format | Exemple |
---|---|---|---|
received_at |
Date de reception de l’information | string, ISO8601 | 2017-06-28T05:35:24.000Z |
fixed_at |
Date de la position GPS | string, ISO8601 | 2017-06-28T05:35:23.000Z |
valid_until |
Date d’expiration de l’information | string, ISO8601 | 2017-06-28T05:36:54.000Z |
connected |
Le traceur est connecté | string, boolean (true , false ) |
true |
ignition |
Contact allumé | string, boolean (true , false ) |
true |
engine |
Moteur démarré | string, boolean (true , false ) |
true |
coordinates |
Coordonées, [lon, lat] (GeoJSON) | array[float] | [47.52094, -18.87754] |
altitude |
Altitude en mètres | integer | 1259 |
heading |
Cap/Direction en degrés | integer | 342 |
speed |
Vitesse en km/h | integer | 22 |
satellites |
Nombre de satellites (0..12 ) |
integer | 10 |
accuracy |
Précision de la position GPS en % | integer | 97 |
state |
MOV le traçable est en mouvement. PRK le traçable est à l’arrêt |
string (MOV , PRK ) |
MOV |
departed_at |
Date de début du déplacement (départ), indéfinie si le traçable est à l’arrêt | string, ISO8601 | 2017-06-28T05:33:23.000Z |
mileage |
Distance parcourue depuis le départ en mètres | integer | 966 |
arrived_at |
Date de début de l’arrêt (arrivée), indéfinie si le traçable est en mouvement | string, ISO8601 | - |
inside |
À l’intérieur de la zone | relationships | - |
entered |
Entrée dans la zone | relationships | - |
exited |
Sortie de la zone | relationships | - |
near |
Arrêté à côté de POI | relationships | - |
GET/trackables/{trackable_id}/status
Example URI
- trackable_id
string
(required) Example: TGP0001
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001/status",
"related": "https://api.tag-ip.com/track/trackables/TGP0001"
},
"data": {
"type": "trackable-status",
"id": "TGP0001",
"attributes": {
"received_at": "2017-06-28T05:35:24.000Z",
"fixed_at": "2017-06-28T05:35:23.000Z",
"valid_until": "2017-06-28T05:36:54.000Z",
"connected": true,
"ignition": true,
"engine": true,
"coordinates": [
47.52094,
-18.87754
],
"altitude": 1259,
"heading": 342,
"speed": 22,
"satellites": 12,
"accuracy": 97,
"state": "MOV",
"departed_at": "2017-06-28T05:33:23.000Z",
"mileage": "966",
"arrived_at": "null"
}
},
"relationships": {
"trackable": {
"links": {
"self": "https://api.tag-ip.com/track/trackable/TGP0001"
},
"data": {
"type": "trackable",
"id": "TGP0001"
}
},
"entered": {
"data": [
{
"type": "feature",
"id": "GFC1234"
},
{
"type": "feature",
"id": "GFC1235"
},
{
"type": "feature",
"id": "GFC1236"
}
]
},
"inside": {
"data": [
{
"type": "feature",
"id": "GFC1234"
},
{
"type": "feature",
"id": "GFC1235"
},
{
"type": "feature",
"id": "GFC1236"
},
{
"type": "feature",
"id": "GFC1237"
}
]
},
"exited": {
"data": [
{
"type": "feature",
"id": "GFC1233"
}
]
},
"near": {
"data": [
{
"type": "feature",
"id": "POI1234"
}
]
}
},
"included": [
{
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001"
},
"type": "trackable",
"id": "TGP0001",
"attributes": {
"name": "Véhicule 001"
}
},
{
"links": {
"self": "https://api.tag-ip.com/track/features/GFC1234"
},
"type": "feature",
"id": "GFC1234",
"attributes": {
"name": "Zone surveillée"
}
},
{
"links": {
"self": "https://api.tag-ip.com/track/features/GFC1235"
},
"type": "feature",
"id": "GFC1235",
"attributes": {
"name": "Zone 30km/h"
}
},
{
"links": {
"self": "https://api.tag-ip.com/track/features/GFC1236"
},
"type": "feature",
"id": "GFC1236",
"attributes": {
"name": "Zone à risque"
}
},
{
"links": {
"self": "https://api.tag-ip.com/track/features/GFC1237"
},
"type": "feature",
"id": "GFC1237",
"attributes": {
"name": "Zone tampon"
}
},
{
"links": {
"self": "https://api.tag-ip.com/track/features/GFC1233"
},
"type": "feature",
"id": "GFC1233",
"attributes": {
"name": "Zone 50km/h"
}
},
{
"links": {
"self": "https://api.tag-ip.com/track/features/POI1234"
},
"type": "feature",
"id": "POI1234",
"attributes": {
"name": "Pont bascule"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
},
"related": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"received_at": {
"type": "string",
"description": "Date de reception du point"
},
"fixed_at": {
"type": "string",
"description": "Date d'acquisition de la position GPS"
},
"valid_until": {
"type": "string",
"description": "Date de validité du status"
},
"connected": {
"type": "boolean",
"description": "Le traceur est connecté au serveur"
},
"ignition": {
"type": "boolean",
"description": "État du contact ON/OFF"
},
"engine": {
"type": "boolean",
"description": "État du moteur ON/OFF"
},
"coordinates": {
"type": "array",
"description": "longitude, latitude"
},
"altitude": {
"type": "number"
},
"heading": {
"type": "number",
"description": "Direction en degrés"
},
"speed": {
"type": "number",
"description": "Vitesse en km/h"
},
"satellites": {
"type": "number",
"description": "Nombre de satellites"
},
"accuracy": {
"type": "number",
"description": "Précision de la position GPS en %"
},
"state": {
"type": "string",
"enum": [
"MOV",
"PRK"
],
"description": "État courant (en mouvement MOV, à l'arrêt PRK)"
},
"departed_at": {
"type": "string",
"description": "Date de départ"
},
"mileage": {
"type": "string",
"description": "Distance parcourue depuis le départ en mètres"
},
"arrived_at": {
"type": "string",
"description": "Date de l'arrivée si le véhicule est à l'arrêt"
}
}
}
}
},
"relationships": {
"type": "object",
"properties": {
"trackable": {
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
}
}
},
"entered": {
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
},
"inside": {
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
},
"exited": {
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
},
"near": {
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
}
}
},
"included": {
"type": "array"
}
}
}
Afficher les événements d'un traçable ¶
Un événement a les mêmes attributs qu’un status. Si l’événement a un début et une fin, une clé end
contient un objet avec les mêmes attributs que le status.
Par exemple, un dépassement de limite de vitesse a une clé end.at
qui définit la fin du dépassement.
GET/trackables/{trackable_id}/events
Example URI
- trackable_id
string
(required) Example: TGP0001
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001/events",
"related": "https://api.tag-ip.com/track/trackables/TGP0001"
},
"data": [
{
"links": {
"self": "https://api.tag-ip.com/track/events/59537ae3b9a023ad5c0b5244"
},
"id": "59537ae3b9a023ad5c0b5244",
"type": "trackable-event",
"attributes": {
"at": "",
"duration": 0,
"position_ids": [],
"starting-position": {
"tags": [],
"speed": 0,
"satellites": 0,
"reverse_geocoding": "",
"realtime": false,
"near_feature_ids": [],
"mileage": 0,
"ignition": "",
"heading": 0,
"fixed_at": "",
"exited_feature_ids": [],
"entered_feature_ids": [],
"engine": "",
"coordinates": [],
"altitude": 0,
"accuracy": 0,
"acceleration": 0
},
"ending-position": {
"tags": [],
"speed": 0,
"satellites": 0,
"reverse_geocoding": "",
"realtime": false,
"near_feature_ids": [],
"mileage": 0,
"ignition": "",
"heading": 0,
"fixed_at": "",
"exited_feature_ids": [],
"entered_feature_ids": [],
"engine": "",
"coordinates": [],
"altitude": 0,
"accuracy": 0,
"acceleration": 0
}
},
"relationships": {
"event_description": {
"data": {
"type": "event-description",
"id": "DEP"
}
},
"trackable": {
"data": {
"type": "trackable",
"id": "TGP0001"
}
}
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
},
"related": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher les activités d'un traçable ¶
Cette ressource liste les activités du traçable: Déplacements et Arrêts depuis le début de la journée.
GET/trackables/{trackable_id}/activities
Example URI
- trackable_id
string
(required) Example: TGP0001
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/trackables/TGP0001/activities",
"related": "https://api.tag-ip.com/track/trackables/TGP0001"
},
"data": [
{
"links": {
"self": "https://api.tag-ip.com/track/events/59537ae3b9a023ad5c0b5244"
},
"id": "59537ae3b9a023ad5c0b5244",
"type": "trackable-event",
"attributes": {
"at": "",
"duration": 0,
"position_ids": [],
"starting-position": {
"tags": [],
"speed": 0,
"satellites": 0,
"reverse_geocoding": "",
"realtime": false,
"near_feature_ids": [],
"mileage": 0,
"ignition": "",
"heading": 0,
"fixed_at": "",
"exited_feature_ids": [],
"entered_feature_ids": [],
"engine": "",
"coordinates": [],
"altitude": 0,
"accuracy": 0,
"acceleration": 0
},
"ending-position": {
"tags": [],
"speed": 0,
"satellites": 0,
"reverse_geocoding": "",
"realtime": false,
"near_feature_ids": [],
"mileage": 0,
"ignition": "",
"heading": 0,
"fixed_at": "",
"exited_feature_ids": [],
"entered_feature_ids": [],
"engine": "",
"coordinates": [],
"altitude": 0,
"accuracy": 0,
"acceleration": 0
}
},
"relationships": {
"event_description": {
"data": {
"type": "event-description",
"id": "PRK"
}
},
"trackable": {
"data": {
"type": "trackable",
"id": "TGP0001"
}
}
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
},
"related": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Système d'Informations Géographiques ¶
On distigue deux sortes d’éléments:
-
les zones (Géofences)
Utilisées pour faire des règles de surveillances qui fonctionnent tout le temps. Et qui peuvent gérer les entrées et les sorties.
-
les points d’intêrets (POI)
Utilisés pour identifier les lieux d’arrêts. La detection se fait 150m autour du point.
Ces éléments sont regroupés dans des groupes, chaque élément peut appartenir à un ou plusieurs groupes. Seuls les groupes sont utilisés dans les règles de surveillances.
-
groupe de zones (ex: Zones 50km/h)
-
groupe de POI (ex: Clients, points de collectes)
Inserer un nouveau groupe d'éléments géographiques ¶
Request body details
-
id: TGP (string, required)
-
name: TGP (string, required)
-
description: TGP (string, required)
-
feature_collection_type: (string, required)
-
is_visible: false (boolean, optional) - default value
-
is_active: false (boolean, optional) - default value
POST/feature-collections
Example URI
Headers
Authorization: Bearer <TOKEN>
Body
{
"id": "TEST",
"name": "nom",
"description": "description",
"feature_collection_type": "type",
"is_active": "false",
"is_visible": "false"
}
201
Headers
Content-Type: text/html
Body
feature collection TGP.POI.TEST inserted with success!
Modifier un nouveau groupe d'élément géographique ¶
Request body details
-
id: TGP (string, required)
-
name, description, feature_collection_type: (string, can’t be empty when update)
PUT/feature-collections/feature_collection_id
Example URI
Headers
Authorization: Bearer <TOKEN>
Body
{
"id": "TEST",
"name": "nom",
"description": "description",
"feature_collection_type": "type",
"is_active": "false",
"is_visible": "false"
}
200
Headers
Content-Type: text/html
Body
feature collection TGP.POI.TEST updated with success!
Supprimer un groupe d'élément géographique ¶
DELETE/feature-collections/feature_collection_id
Example URI
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: text/html
Body
feature collection TGP.POI.TEST deleted with success!
Liste des groupes d'éléments géographiques ¶
GET/feature-collections{?sort}
Example URI
- sort
array
(optional) Example: -nameAjouter un
-
pourdesc
default
:/feature-collections (?sort=id)
Choices:
name
-name
id
-id
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/feature-collections"
},
"data": [
{
"type": "feature-collection",
"id": "TGP.POI",
"attributes": {
"name": "POI de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.POI"
}
},
{
"type": "feature-collection",
"id": "TGP.GFC",
"attributes": {
"name": "Géofences de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.GFC"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher un groupe d'éléments géographiques ¶
GET/feature-collections/{feature_collection_id}
Example URI
- feature_collection_id
string
(required) Example: TGP.GFC
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/feature-collections"
},
"data": [
{
"type": "feature-collection",
"id": "TGP.POI",
"attributes": {
"name": "POI de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.POI"
}
},
{
"type": "feature-collection",
"id": "TGP.GFC",
"attributes": {
"name": "Géofences de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.GFC"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher un groupe d'éléments géographiques au format geojson ¶
GET/feature-collections/{feature_collection_id}.geojson
Example URI
- feature_collection_id
string
(required) Example: TGP.POI
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.geo+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/feature-collections"
},
"data": [
{
"type": "feature-collection",
"id": "TGP.POI",
"attributes": {
"name": "POI de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.POI"
}
},
{
"type": "feature-collection",
"id": "TGP.GFC",
"attributes": {
"name": "Géofences de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/feature-collections/TGP.GFC"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Liste des éléments géographiques ¶
Afficher toute la liste des éléments géographiques accessibles à l’utilisateur identifié.
GET/features{?sort}
Example URI
- sort
array
(optional) Example: -nameAjouter un
-
pourdesc
default
:/features (?sort=id)
Choices:
name
-name
id
-id
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.geo+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/features"
},
"data": [
{
"type": "feature",
"id": "POI1234",
"attributes": {
"name": "Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/features/POI1234"
}
},
{
"type": "feature-collection",
"id": "GFC1234",
"attributes": {
"name": "Parking de Tag-IP"
},
"links": {
"self": "https://api.tag-ip.com/track/features/GFC1234"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Ajouter un élément géographique ¶
Ajouter une élément géographique
Request body details
-
id: GFC0002 (string, required)
-
coordinates:[[[47.495,-18.875],[47.515,-18.875],[47.515,-18.899],[47.495,-18.899],[47.495,-18.875]]] (array, required)
-
geometry_type: Polygon (string, required)
-
property_id: GF02 (string, required)
-
property_name: GF02-TNR NE (string, required)
-
property_speed: 50 (string)
-
property_tags: “TGM.GFC, TTR.GFC” (array, required)
POST/features
Example URI
Headers
Authorization: Bearer <TOKEN>
Body
{
"id": "GFC0002",
"coordinates": [
[
[
47.495,
-18.875
],
[
47.515,
-18.875
],
[
47.515,
-18.899
],
[
47.495,
-18.899
],
[
47.495,
-18.875
]
]
],
"geometry_type": "Polygon",
"property_id": "GF02",
"property_name": "GF02-TNR NE",
"property_speed": "50",
"property_tags": "TGM.GFC, TTR.GFC"
}
201
Body
Creation of GFC0002 feature success
Modifier un élément géographique ¶
Request body details
-
id: TGP (string, required)
-
coordinates : [47.515, -18.815] (Array[float], required)
-
geometry_type : (string, required)
-
property_id : (string, required)
-
property_name : (string, required)
-
property_speed : (string)
-
property_tags : (string, required)
PUT/features/feature_id
Example URI
Headers
Authorization: Bearer <TOKEN>
Body
{
"id": "TST0001",
"coordinates": [
[
[
0,
0
],
[
10,
10
],
[
10,
0
],
[
0,
0
]
]
],
"geometry_type": "Polygon",
"property_id": "TS001",
"property_name": "TS001-TNR NE",
"property_speed": "50",
"property_tags": "TGP.TEST, TGP.TEST2"
}
200
Headers
Content-Type: text/html
Body
Feature TST0001 updated with success!
Supprimer un élément géographique ¶
DELETE/features/{feature_id}
Example URI
- feature_id
string
(required) Example: GFC0002
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: text/plain
Body
"1 feature was deleted"
Afficher un élément géographique ¶
GET/features/{feature_id}
Example URI
- feature_id
string
(required) Example: POI1234
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Afficher un élément géographique au format geojson ¶
GET/features/{feature_id}.geojson
Example URI
- feature_id
string
(required) Example: POI1234
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.geo+json
Description d'événements ¶
Chaque événement a son identifiant, son nom et sa description.
Liste des déscriptions d'événements ¶
GET/event-descriptions{?sort}
Example URI
- sort
array
(optional) Example: -nameAjouter un
-
pourdesc
default
:/event_descriptions (?sort=id)
Choices:
name
-name
id
-id
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/event-descriptions"
},
"data": [
{
"type": "event-description",
"id": "EEE.2MI.ENT.ZONE",
"attributes": {
"name": "Entrée en Zone",
"description": "Arrivées dans des zones identifiées",
"is_active": "true"
},
"links": {
"self": "https://api.tag-ip.com/track/event-descriptions/EEE.2MI.ENT.ZONE"
}
},
{
"type": "EventDescriptions",
"id": "EEE.HLE.OGF_TOWN",
"attributes": {
"name": "Sortie ville de Tananarive ou Tamatave",
"description": "Surveillance du départ des Villes de Antananarivo et Tamatave",
"is_active": "false"
},
"links": {
"self": "https://api.tag-ip.com/track/event-descriptions/EEE.HLE.OGF_TOWN"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher une description d'événement ¶
GET/event-descriptions/{event_description_id}
Example URI
- event_description_id
string
(required) Example: EEE.2MI.ENT.ZONE
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/track/event-descriptions/EEE.2MI.ENT.ZONE"
},
"data": {
"type": "EventDescription",
"id": "EEE.2MI.ENT.ZONE",
"attributes": {
"name": "Entrée en Zone",
"description": "Arrivées dans des zones identifiées",
"is_active": "true"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"is_active": {
"type": "string"
}
}
}
}
}
}
}
Inserer une nouvelle description d'événement ¶
Request body details
-
id: ARR (string, required)
-
name: Arrivée (string, required)
-
description: Début d’arrêt (string, required)
-
is_active: true (boolean, required)
POST/event-descriptions
Example URI
Headers
Content-Type: application/json
Body
{
"id": "ARR",
"name": "Arrivée",
"description": "Début d'arrêt",
"is_active": true
}
200
Headers
Content-Type: text/plain
Body
"Success"
Modifier une descriptions d'événement ¶
Request body details
-
name: Arrivée (string, optional)
-
description: Début d’arrêt (string, optional)
-
is_active: true (boolean, optional)
PUT/event-descriptions/
Example URI
- event_description_id
string
(required) Example: EEE.2MI.ENT.ZONE
Headers
Content-Type: application/json
Body
{
"name": "Arrivée",
"description": "Début d'arrêt",
"is_active": true
}
200
Headers
Content-Type: text/plain
Body
"item updated"
Tokens ¶
Liste des tokens ¶
GET/tokens
Example URI
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/tokens/application_track"
},
"data": [
{
"type": "Tokens",
"label": "application_track",
"attributes": {
"version": "1500901352",
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOi",
"user_id": "null",
"organization_id": "2MI",
"label": "applicatio_track",
"created_by": "cli",
"created_at": "1500901352",
"claims": {
"default": [
"get_fleets",
"post_fleets"
],
"admin": [
"delete_fleets"
]
}
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "array"
}
}
}
Afficher une description d'un token ¶
GET/tokens/{label}
Example URI
- label
string
(required) Example: application_track
Headers
Authorization: Bearer <TOKEN>
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/tokens/application_track"
},
"data": {
"type": "Tokens",
"label": "application_track",
"attributes": {
"version": "1500901352",
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOi",
"user_id": "null",
"organization_id": "2MI",
"label": "applicatio_track",
"created_by": "cli",
"created_at": "1500901352",
"claims": {
"default": [
"get_fleets",
"post_fleets"
],
"admin": [
"delete_fleets"
]
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"value": {
"type": "string"
},
"user_id": {
"type": "string"
},
"organization_id": {
"type": "string"
},
"label": {
"type": "string"
},
"created_by": {
"type": "string"
},
"created_at": {
"type": "string"
},
"claims": {
"type": "object",
"properties": {
"default": {
"type": "array"
},
"admin": {
"type": "array"
}
}
}
}
}
}
}
}
}
Inserer un nouveau token ¶
Request body details
-
label: application_track (string, required)
-
claims_default: [get_fleets, get_tokens] (array, required) - default permission
-
claims_admin: [delete_fleets] (array, required) - admin permission
POST/tokens
Example URI
Headers
Content-Type: application/json
Body
{
"label": "application_track",
"claims_default": [
"get_fleets",
"get_tokens"
],
"claims_admin": [
"delete_tokens"
],
"created_by": "Rakoto"
}
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/tokens/application_track"
},
"data": {
"type": "Tokens",
"label": "application_track",
"attributes": {
"version": "1500901352",
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOi",
"user_id": "null",
"organization_id": "2MI",
"label": "application_track",
"created_by": "cli",
"created_at": "1500901352",
"claims": {
"default": [
"get_fleets",
"post_fleets"
],
"admin": [
"delete_fleets"
]
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"value": {
"type": "string"
},
"user_id": {
"type": "string"
},
"organization_id": {
"type": "string"
},
"label": {
"type": "string"
},
"created_by": {
"type": "string"
},
"created_at": {
"type": "string"
},
"claims": {
"type": "object",
"properties": {
"default": {
"type": "array"
},
"admin": {
"type": "array"
}
}
}
}
}
}
}
}
}
Modifier un token ¶
Request body details
-
claims_default: [get_fleets, get_tokens] (array, required) - default permission
-
claims_admin: [delete_fleets] (array, required) - admin permission
PUT/tokens/{label}
Example URI
- label
string
(required) Example: application_track
Headers
Content-Type: application/json
Body
{
"claims_default": [
"get_fleets",
"get_tokens"
],
"claims_admin": [
"delete_tokens"
],
"created_by": "Rakoto"
}
200
Headers
Content-Type: application/vnd.api+json
Body
{
"links": {
"self": "https://api.tag-ip.com/tokens/application_track"
},
"data": {
"type": "Tokens",
"label": "application_track",
"attributes": {
"version": "1500901352",
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOi",
"user_id": "null",
"organization_id": "2MI",
"label": "application_track",
"created_by": "cli",
"created_at": "1500901352",
"claims": {
"default": [
"get_fleets",
"post_fleets"
],
"admin": [
"delete_fleets"
]
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"value": {
"type": "string"
},
"user_id": {
"type": "string"
},
"organization_id": {
"type": "string"
},
"label": {
"type": "string"
},
"created_by": {
"type": "string"
},
"created_at": {
"type": "string"
},
"claims": {
"type": "object",
"properties": {
"default": {
"type": "array"
},
"admin": {
"type": "array"
}
}
}
}
}
}
}
}
}