Skip to main content

API COMMENT COURSIER.FR V3 (EN)

12/11/2020 image-1662457811981.png Version 3.1


Objective

Be able to add information on a mission. It concerns all guidelines given by the customer after the order has been posted. You can use this API to push your call center events as well. It's a way to share information with COURSIER.FR when the customer call our supervisor team.

It doesn't concern address of schedule updates. In those case (which have a pricing impact) you must cancel the mission and order it again.


Protocol

Requests are made via HTTPS with the url api.coursier.fr/v3/comment.php, the response is a JSON with a status and a message in case of error. 

 

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. 


Comment


Y

Varchar(1000)

Comment to be added on the mission

Lang

N

varchar(2)

Language code for the retrieval of messages (default ; FR)


JSON Response

The response is a JSON with a status (OK/NOK) and a message in case of error.

NAME

TYPE

DESCRIPTION

Status

varchar(3)


OK/NOK


Message

varchar(1000)

Error description



API call example
<?php
$Url = "https://api.coursier.fr/v3/comment.php";
$Data = array('User' => 'test@apicfr.fr',
			  'Apikey' => 'e1ab1411d66765e73cf4b068d39cda8a',
			  'ClientId' => '7055339',
			  'MissionNumber' => '9005657',
			  'Comment' => 'Le client sera peut-être absent, dans ce cas laiser le colis au voisin au n°122 de la rue' 
              '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

[{"Status":"OK","Message":""}]