API Visites du portail Force Réseau - ntlm-technologies/fr.doc.visits.api GitHub Wiki

Introduction

Ces API exposent les visites présentes sur le Portail Force Réseau. Elles permettent de consulter, d'ajouter ou de modifier une visite.

Notion de ressource

Chaque visite est perçu comme une ressource. Cette dernière appartient donc à une entité. Dans les exemples ci-dessous, nous utiliserons fleetone.visits avec comme URL :

GET /resources/fleetone/...

Et dans les objets envoyés :

"source_Name": "fleetone.visits",

Pour KerTrucks, il faudra utiliser dans l'url :

GET /resources/fakir/...

et dans les objets envoyés :

"source_Name": "fakir.visits",

Adresse de base

Production

http://visits.vehicles.fr.ntlm.tech

Sécurisée : https://visits-vehicles-fr.ntlm.tech

Test

http://test.visits.vehicles.fr.ntlm.tech

Sécurisée : https://test-visits-vehicles-fr.ntlm.tech

Headers

Le Token d'identification obtenu à la suite de l'authentification doit être placé dans le Authorization Header de chaque Request.

API

Historique

Ajouté le 06/12/2018 : Ajout de la date de prochaine alerte. Ajout de Licence dans la recherche d'une visite. Une recherche retourne maintenant une visite dans son ensemble.

Ajouté le 11/10/2018 : possibilité d'indiquer les différents montants rattachés à un taux de TVA ainsi que le numéro de facture.

Format :

    "totalVAT20" : {
    	"amount" : "1.2"
    },
    "totalVAT13" : {
    	"amount" : "3.4"
    },
    "totalVAT10" : {
    	"amount" : "5.6"
    },
    "totalVAT8" : {
    	"amount" : "7.8"
    },
    "ctTax" : {
    	"amount" : "9.0"
    },
    "invoiceNumber" : "12345679"

Recherche de visites par date et ou plaque d'immatriculation

GET /resources/fleetone/visits/?after=2017-11-01&before=2017-12-09

Format de date accepté : yyyy-mm-dd

Retourne les visites dont la date de début est comprise entre les bornes définies.

GET /resources/fleetone/visits/?licence=AW809PG&after=2018-07-01&before=2018-07-31

licence peut contenir une plaque d'immatriculation avec ou dans un tiret (-)

Consultation d'une visite (ici la 987456AASS101)

GET /resources/fleetone/visits/987456AASS101

Résultat :

{
    "cause": {
        "key": "1",
        "value": "Usure anormale"
    },
    "qualification": {
        "key": "1",
        "value": "Règlementaire"
    },
    "interventions": [
        {
            "organ": {
                "key": "58",
                "value": "Carrosserie"
            },
            "nature": {
                "key": "1",
                "value": "Réglementaire"
            },
            "technicalInspection": {
                "result": {
                    "key": "1",
                    "value": "Visite OK"
                },
                "issued": "2012-01-30T18:00:00",
                "success": true,
                "entity_Id": "216"
            },
            "entity_Id": "216",
            "operation": {
                "entity_Id": "673",
                "name": "Certification ATP"
            },
            "price": 0,
            "duration": 0
        }
    ],
    "supplierDispute": false,
    "isExposedInWS": true,
    "supplier": {
        "officialReference": "",
        "references": [],
        "info": {},
        "entity_Id": "6001277",
        "designation": "BEZIERS PL--"
    },
    "client": {
        "officialReference": "",
        "references": [],
        "info": {},
        "entity_Id": "5000502",
        "designation": "Tps DEMO 69"
    },
    "totalVAT20": {
        "amount": 1.2,
        "precision": 2,
        "currency": 0
    },
    "totalVAT13": {
        "amount": 3.4,
        "precision": 2,
        "currency": 0
    },
    "totalVAT10": {
        "amount": 5.6,
        "precision": 2,
        "currency": 0
    },
    "totalVAT8": {
        "amount": 7.8,
        "precision": 2,
        "currency": 0
    },
    "ctTax": {
        "amount": 9,
        "precision": 2,
        "currency": 0
    },
    "id": 43,
    "entity_Id": "987456AASS101",
    "equipment": {
        "licence": "9999SA69",
        "entity_Id": "326",
        "name": "Groupe de Froid"
    },
    "measures": [],
    "supplierOrderNumber": "",
    "clientOrderNumber": "",
    "started": "2012-01-30T08:00:00",
    "ended": "2012-01-30T18:00:00",
    "invoiceNumber": "12345679",
    "isDone": true,
    "isInvoiced": false,
    "isPlanned": false,
    "inProgress": false,
    "created": "2018-10-11T12:12:49",
    "modified": "2018-10-11T12:12:49",
    "source_Name": "fleetone.visits"
}

Ajout d'une visite

PUT /resources/fleetone/visits/

[{
    "cause": {
        "key": "1",
        "value": "Usure anormale"
    },
    "qualification": {
        "key": "1",
        "value": "Règlementaire"
    },
    "interventions": [
        {
        	"organ": {
                "key": "58",
                "value": "Carrosserie"
            },
            "nature": {
                "key": "1",
                "value": "Réglementaire"
            },
            "technicalInspection": {
                "result": {
                    "key": "1",
                    "value": "Visite OK"
                },
                "issued": "2012-01-30T18:00:00",
                "success": true,
                "entity_Id": "516748"
            },
            "entity_Id": "516748",
            "operation": {
                "entity_Id": "673",
                "name": "Certification ATP"
            },
            "price": 0,
            "duration": 0
        }
    ],
    "supplierDispute": false,
    "isExposedInWS": true,
    "supplier": {
        "officialReference": "QSDSDGSDGHSDDAZERBHF",
        "references": [],
        "info": {},
        "entity_Id": "6001277",
        "designation": "BEZIERS PL--"
    },
    "client": {
        "officialReference": "",
        "references": [],
        "info": {},
        "entity_Id": "5000502",
        "designation": "Tps DEMO 69"
    },
    
    "vehicle": {
        "entity_Id": "250"
    },
    "equipment": {
        "entity_Id": "326"
    },
    "entity_Id" : "AAZZEDDDLM11",
    "measures": [],
    "supplierOrderNumber": "",
    "clientOrderNumber": "",
    "started": "2012-01-30T08:00:00",
    "ended": "2012-01-30T18:00:00",
    "isDone": true,
    "isInvoiced": false,
    "isPlanned": false,
    "inProgress": false,
    "created": "1901-01-01T00:00:00",
    "modified": "1901-01-01T00:00:00",
    "source_Name": "fleetone.visits"
}]

Ajouter deux visites

PUT /resources/fleetone/visits/

[{
    "cause": {
        "key": "1",
        "value": "Usure anormale"
    },
    "qualification": {
        "key": "1",
        "value": "Règlementaire"
    },
    "interventions": [
        {
        	"organ": {
                "key": "58",
                "value": "Carrosserie"
            },
            "nature": {
                "key": "1",
                "value": "Réglementaire"
            },
            "technicalInspection": {
                "result": {
                    "key": "1",
                    "value": "Visite OK"
                },
                "issued": "2012-01-30T18:00:00",
                "success": true,
                "entity_Id": "516748"
            },
            "entity_Id": "516748",
            "operation": {
                "entity_Id": "673",
                "name": "Certification ATP"
            },
            "price": 0,
            "duration": 0
        }
    ],
    "supplierDispute": false,
    "isExposedInWS": true,
    "supplier": {
        "officialReference": "QSDSDGSDGHSDDAZERBHF",
        "references": [],
        "info": {},
        "entity_Id": "6001277",
        "designation": "BEZIERS PL--"
    },
    "client": {
        "officialReference": "",
        "references": [],
        "info": {},
        "entity_Id": "5000502",
        "designation": "Tps DEMO 69"
    },
    
    "vehicle": {
        "entity_Id": "250"
    },
    "equipment": {
        "entity_Id": "326"
    },
    "entity_Id" : "AAZZEDDDLM11",
    "measures": [],
    "supplierOrderNumber": "",
    "clientOrderNumber": "",
    "started": "2012-01-30T08:00:00",
    "ended": "2012-01-30T18:00:00",
    "isDone": true,
    "isInvoiced": false,
    "isPlanned": false,
    "inProgress": false,
    "created": "1901-01-01T00:00:00",
    "modified": "1901-01-01T00:00:00",
    "source_Name": "fleetone.visits"
},{
    "cause": {
        "key": "1",
        "value": "Usure anormale"
    },
    "qualification": {
        "key": "1",
        "value": "Règlementaire"
    },
    "interventions": [
        {
        	"organ": {
                "key": "58",
                "value": "Carrosserie"
            },
            "nature": {
                "key": "1",
                "value": "Réglementaire"
            },
            "technicalInspection": {
                "result": {
                    "key": "1",
                    "value": "Visite OK"
                },
                "issued": "2012-01-30T18:00:00",
                "success": true,
                "entity_Id": "516748"
            },
            "entity_Id": "516748",
            "operation": {
                "entity_Id": "673",
                "name": "Certification ATP"
            },
            "price": 0,
            "duration": 0
        }
    ],
    "supplierDispute": false,
    "isExposedInWS": true,
    "supplier": {
        "officialReference": "QSDSDGSDGHSDDAZERBHF",
        "references": [],
        "info": {},
        "entity_Id": "6001277",
        "designation": "BEZIERS PL--"
    },
    "client": {
        "officialReference": "",
        "references": [],
        "info": {},
        "entity_Id": "5000502",
        "designation": "Tps DEMO 69"
    },
    
    "vehicle": {
        "entity_Id": "250"
    },
    "equipment": {
        "entity_Id": "326"
    },
    "entity_Id" : "12346579",
    "measures": [],
    "supplierOrderNumber": "",
    "clientOrderNumber": "",
    "started": "2012-01-30T08:00:00",
    "ended": "2012-01-30T18:00:00",
    "isDone": true,
    "isInvoiced": false,
    "isPlanned": false,
    "inProgress": false,
    "created": "1901-01-01T00:00:00",
    "modified": "1901-01-01T00:00:00",
    "source_Name": "fleetone.visits",
    "totalVAT20" : {
    	"amount" : "1.2"
    },
    "totalVAT13" : {
    	"amount" : "3.4"
    },
    "totalVAT10" : {
    	"amount" : "5.6"
    },
    "totalVAT8" : {
    	"amount" : "7.8"
    },
    "ctTax" : {
    	"amount" : "9.0"
    },
    "invoiceNumber" : "12345679"
}]

Retour de l'API :

{
    "objects": [
        {
            "object": {
                "entity_Id": "AAZZEDDDLM11"
            },
            "messages": [
                {
                    "text": "Modified",
                    "status": 0,
                    "error": false
                }
            ]
        },
        {
            "object": {
                "entity_Id": "12346579"
            },
            "messages": [
                {
                    "text": "Added",
                    "status": 0,
                    "error": false
                }
            ]
        }
    ],
    "summary": {
        "hasErrors": false,
        "errorCount": 0,
        "objectCount": 2,
        "errorObjectCount": 0
    }
}