API TRACKING COURSIER.FR V5 (EN)
| 08/06/2020 | ![]() |
Version 5.1 |
Objective
Follow every events related to the given mission : removal, shipping, approaches, courier information, reprogramming, proof of delivery. It's possible to retrieve all ongoing missions for a massive update as well.
Protocol
Requests are made via HTTPS with the url api.coursier.fr/v5/tracking.php, the response is a JSON containing all the delivery information. toutes les informations de la course. In case of load failure, several records will be sent, each with their own information.
Authentication
The authentication happens with an apikey paired to your coursier.fr user, these informations can be found in your customer area. You must have a monthly billing account, if it is not the case, you may contact a salesman at commercial@coursier.fr. You must give as parameters the apikey, the user and the customer account used (a user can be associated with several customer accounts).
In order to test our APIs, as of now you may use the following testing account to begin your developping tasks while you wait for your definitive credentials :
User : test@apicfr.fr
Pass : T3stCFR*
ClientId : 7055339
Apikey : e1ab1411d66765e73cf4b068d39cda8a
Parameters
Parameters must be send in a JSON array using the POST method.
|
NAME |
REQUIRED |
TYPE |
DESCRIPTION |
|
User |
Y |
Varchar(32) |
User to access the coursier.fr interfaces |
|
Apikey |
Y |
Varchar(32) |
Apikey linked to your user |
|
ClientId |
Y |
int |
Customer account number |
|
MissionNumber |
Y |
int |
ID of the delivery, obtained when placing the order. If null or if no set, the api returns all the ongoing mission (missions planned from today 00:00:00) |
|
Lang |
N |
varchar(2) |
Language code for the retrieval of messages (default ; FR) |
JSON Response
The response is a JSON array with all the related information to the delivery or the delivery fragment given. In case of error, the API returns a JSON with a Message field specifying the nature of the error.
|
NAME |
TYPE |
DESCRIPTION |
|
MissionId |
int |
ID of the delivery, in case of load failure the ID is different for every fragment. |
|
MissionNumber |
int |
Number of the delivery, this number is the key to interact with our courier or the customer service. |
|
From |
varchar(80) |
Name of the pick-up address |
|
To |
varchar(80) |
Name of the shipping address |
|
PickupStartDate |
Datetime |
Beginning of the pick-up slot |
|
PickupEndDate |
Datetime |
End of the pick-up slot |
|
PickupStartEstimate |
Datetime |
start of the refined window of the date of removal |
|
PickupEndEstimate |
Datetime |
end of the refined window of the date of removal |
|
PickupDate |
Datetime |
Effective date of removal |
|
DeliveryStartDate |
Datetime |
Beginning of the shipping slot |
|
DeliveryEndDate |
Datetime |
end of the shipping slot |
|
DeliveryStartEstimate |
Datetime |
start of the refined window of the date of shipping |
|
DeliveryEndEstimate |
Datetime |
end of the refined window of the date of removal |
|
DeliveryDate |
Datetime |
Effective date of shipping |
|
State |
varchar(50) |
Status of the mission : - Picked up - Delivered - Canceled - To be invoiced - Billed - Incident - not yet dispatched |
|
WorkerShortCode |
varchar(5) |
Autentication code of the driver |
|
WorkerSurname |
varchar(100) |
Surname of driver |
|
Picture |
varchar(100) |
Url of the driver photo |
|
ProofOfDelivery |
varchar(100) |
Url of the signature photo |
|
DeliverySignee |
varchar(30) |
Name of the signer |
|
History |
JSON |
All events of the mission, can be used as it is for a tracking page for the customers |
API call example
<?php
$Url = "https://api.coursier.fr/v3/tracking.php";
$Data = array('User' => 'test@apicfr.fr',
'Apikey' => 'e1ab1411d66765e73cf4b068d39cda8a',
'ClientId' => '7055339',
'MissionNumber' => '9005657',
'Lang' => 'FR',
);
$datajson = json_encode($data);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $datajson);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($curl);
curl_close($curl);
var_dump($res);
?>
Response example
[
{
"MissionId":"10009998",
"MissionNumber":"9012345",
"From":"Boutique Georges 5",
"To":"Hub Coursier.fr",
"PickupStartDate":"2022-06-21 11:00:00",
"PickupEndDate":"2022-06-21 12:00:00",
"PickupStartEstimate":"",
"PickupEndEstimate":"",
"PickupDate":"2022-06-21 11:24:52",
"DeliveryStartDate":"2022-06-21 12:00:00",
"DeliveryEndDate":"2022-06-21 13:00:00",
"DeliveryStartEstimate":"2022-06-21 12:05:00",
"DeliveryEndEstimate":"2022-06-21 12:15:00",
"DeliveryDate":"",
"State":"En approche livraison",
"WorkerShortCode":"710",
"WorkerSurname":"Laurent",
"Picture":"https://iris.coursier.fr/worker/view/710",
"ProofOfDelivery":"",
"DeliverySignee":"",
"History":[
{
"date":"2022-06-21 01:30:00",
"action":"SORT",
"desc":"Scanné au Sorting Center"
},
{
"date":"2022-06-21 10:00:00",
"action":"LOCAL",
"desc":"Arrivée au Hub local"
},
{
"date":"2022-06-21 11:24:52",
"action":"PICKED",
"desc":"Enlèvement par 2470"
},
{
"date":"2022-06-21 12:30:00",
"action":"ATTEMPT1",
"desc":"Echec première présentation 2470 : Destinataire absent"
},
{
"date":"2022-06-21 13:30:00",
"action":"RELIV",
"desc":"Relivraison programmée le lendemain"
}
]
},
{
"MissionId":"10009999",
"MissionNumber":"9012345",
"From":"Hub Coursier.fr",
"To":"Yann THEBAULT",
"PickupStartDate":"2022-06-21 19:00:00",
"PickupEndDate":"2022-06-21 20:00:00",
"PickupStartEstimate":"",
"PickupEndEstimate":"",
"PickupDate":"",
"DeliveryStartDate":"2022-06-21 20:00:00",
"DeliveryEndDate":"2022-06-21 22:00:00",
"DeliveryStartEstimate":"",
"DeliveryEndEstimate":"",
"DeliveryDate":"",
"State":"",
"WorkerShortCode":"",
"WorkerSurname":"",
"Picture":"",
"ProofOfDelivery":"",
"DeliverySignee":"",
"History":""
}
]

No Comments