Envoyer un trajet
Body Required
-
Identifiant unique du trajet envoyé par l'opérateur.
Minimum length is
1
, maximum length is256
. Format should match the following pattern:^[a-z0-9]{1,256}$
. -
Identifiant généré par l'opérateur pour regrouper des trajets (plusieurs passagers avec un même conducteur)
-
operator_class Required
Classe de preuve correspondant aux spécifications définies dans Classes de preuve de covoiturage
Values are
A
,B
, orC
. -
Tableau reprenant la liste complète des incitations appliquées (ordre d'application, montant, identifiant de l'incitateur). Si aucune incitation, envoyer un tableau vide.
Ordre par défaut
Par défaut, l'ordre d'application des politiques incitatives est le suivant :
- Territoire (AOM, Région, ...)
- Sponsors (incitations employeur, CE, etc.)
- Opérateur (opération promotionnelle, offres, etc.)
-
licence_plate string
Plaque d'immatriculation du véhicule
-
Position géographique et date de départ du passager
Additional properties are NOT allowed.
-
Position géographique et date de départ du passager
Additional properties are NOT allowed.
-
Distance en mètres
Minimum value is
0
, maximum value is1000000
. -
Informations d'identité du conducteur
Additional properties are NOT allowed.
-
Informations d'identité du passager
Additional properties are NOT allowed.
Responses
-
201 application/json
OK. Le trajet a bien été enregistré.
-
400 application/json
Requête invalide
-
401 application/json
Non authentifié. Le token applicatif est manquant ou invalide.
-
403 application/json
Non autorisé
-
Le trajet est déjà enregistré.
-
422 application/json
Le payload envoyé ne respecte pas le contrat d'interface / les Conditions Générales d'Utilisation. Le trajet n'a pas été enregistré par le Registre de Preuve de Covoiturage.
curl \
-X POST https://api.covoiturage.beta.gouv.fr/v3.1/journeys \
-H "Content-Type: application/json" \
-d '{"operator_journey_id":"string","operator_trip_id":"string","operator_class":"A","incentives":[{"index":0,"amount":100,"siret":"11000101300017"}],"licence_plate":"string","start":{"datetime":"2021-01-01T11:00:00Z","lat":47.682821,"lon":-0.557483},"end":{"datetime":"2021-01-01T11:00:00Z","lat":47.682821,"lon":-0.557483},"distance":42.0,"driver":{"identity":{"identity_key":"string","travel_pass":{"name":"navigo","user_id":"00-MFR-6782929"},"phone":"+33601020304, +590690101010","phone_trunc":"+336010203","application_timestamp":"string","driving_license":"051227308989","operator_user_id":"d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e","over_18":true},"revenue":42.0},"passenger":{"identity":{"identity_key":"string","travel_pass":{"name":"navigo","user_id":"00-MFR-6782929"},"phone":"+33601020304, +590690101010","phone_trunc":"+336010203","application_timestamp":"string","driving_license":"051227308989","operator_user_id":"d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e","over_18":true},"payments":[{"index":0,"amount":100,"siret":"11000101300017","type":"string"}],"contribution":42.0,"seats":1}}'
{
"operator_journey_id": "string",
"operator_trip_id": "string",
"operator_class": "A",
"incentives": [
{
"index": 0,
"amount": 100,
"siret": "11000101300017"
}
],
"licence_plate": "string",
"start": {
"datetime": "2021-01-01T11:00:00Z",
"lat": 47.682821,
"lon": -0.557483
},
"end": {
"datetime": "2021-01-01T11:00:00Z",
"lat": 47.682821,
"lon": -0.557483
},
"distance": 42.0,
"driver": {
"identity": {
"identity_key": "string",
"travel_pass": {
"name": "navigo",
"user_id": "00-MFR-6782929"
},
"phone": "+33601020304, +590690101010",
"phone_trunc": "+336010203",
"application_timestamp": "string",
"driving_license": "051227308989",
"operator_user_id": "d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e",
"over_18": true
},
"revenue": 42.0
},
"passenger": {
"identity": {
"identity_key": "string",
"travel_pass": {
"name": "navigo",
"user_id": "00-MFR-6782929"
},
"phone": "+33601020304, +590690101010",
"phone_trunc": "+336010203",
"application_timestamp": "string",
"driving_license": "051227308989",
"operator_user_id": "d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e",
"over_18": true
},
"payments": [
{
"index": 0,
"amount": 100,
"siret": "11000101300017",
"type": "string"
}
],
"contribution": 42.0,
"seats": 1
}
}
{
"id": 1,
"result": {
"data": {
"created_at": "2021-01-01T00:00:00+0100",
"operator_journey_id": "cb82956e-3833-4925-9891-47d9b2ba0186"
},
"meta": null
},
"jsonrpc": "2.0"
}
{
"id": 1,
"error": {
"code": -32602,
"data": "data/driver/identity/phone_trunc must match format \"phonetrunc\", data/driver/identity/phone_trunc must pass \"macro\" keyword validation",
"message": "Invalid params"
},
"jsonrpc": "2.0"
}
{
"id": 1,
"error": {
"code": -32501,
"data": "Unauthorized application",
"message": "Unauthorized Error"
},
"jsonrpc": "2.0"
}
{
"id": 1,
"error": {
"code": -32503,
"data": "Invalid permissions",
"message": "Forbidden Error"
},
"jsonrpc": "2.0"
}
{
"id": 1,
"jsonrpc": "2.0",
"error": {
"data": {
"terms_violation_labels": [
"expired"
]
},
"code": -32422,
"message": "Unprocessable Request"
}
}