Find below some information on the steps to create your orders using the API with a preconfigured service.
The objective here is to keep it simple. Your address is verified in advance, your file is a simple PDF.

Authentication & logout

  • POST /authentication/authenticate
  • withProfileDetail:true
- WithProfile:true is needed to create a job, not to track a job. You will need to parse and store informations about the services.
- authenticate with the user who will perform the order.
- The service returned array must be parsed to get the serviceId (use it in next steps, and identify the MAIN boxes.
- In the next requests, use the header X-Auth-Token with the token return by the authentication.
  • /authentication/logout
  • X-Auth-Token header with the token you get from the authenticate
- After you process your requests, do not forget to clean and logout.

Create a job

Job creation
  • POST /jobs
  • X-Auth-Token header with the token you get from the authenticate
  • file__file_{ID_PART}_0
  • parameters : {"autocreateDeliveryCommand":true, "jobName": "my job name", "serviceId":"serviceId"}
- file__file_{ID_PART}_0 : the ID_PART comes from the box name found in the service (you have to do some parsing of the authenticate result). The 0 at the end is a counter if you send several files in the box (_0,_1,_2...)
- autocreateDeliveryCommand allows not to have to validate a job, if everything is OK, the job is sent and the delivery created
- The parameters object is presented in the swagger documentation, go to the bottom of the page in the Models section and search for JobCreationParameter. For example you will find here information on how to create a job for a dedicated user when you use an administrator account for authentication (targetOwnerId).

Track a job

Job status
  • /jobs/{jobId}
  • X-Auth-Token header with the token you get from the authenticate
- If the statuts received is PACK_GROUP_CREATED, store the jobId returned. You have to check the DELIVERIES are created, and the PACKGROUP statuses.
--- For a job with 1 PACKGROUP to send, look and the packGroupCountPerStates. NOT_ELIGIBLE:1 means you have an issue.
--- For a job with N DOCUMENT to send call the GET /jobs/{jobId}/packGroups and check the status.
- If the statuts received is PROCESSING_ERROR, the files are not correct (impossible to split, to extract content...).
Deliveries status
  • GET /deliveries?jobId<myJobId>
  • X-Auth-Token header with the token you get from the authenticate
- At this moment you see all the deliveries (shipments) linked. For each delivery sent you will have the shipments (the final shipment) For a multichannel job (email and mail) you will have two deliveries for one job. And you will have to track both deliveries. This may not be your use case but it is possible.

Track shipments (and get proofs)

A good approach is to track the delivery
Get delivery information
  • GET /deliveries?jobId<myJobId>
  • X-Auth-Token header with the token you get from the authenticate
- Check that the status is OUTPUTTED. If not, just wait for the output triggers.
- Otherwise you will get a list of shipments and you can parse each of them looking for some information (metadata)

Shipment metadata
- metadataKind=TRACKING & metadataType=SHORT_VALUE & name=TRACKING to get the registered tracking number
- metadataKind=TRACKING & metadataType=FILE & name=TRACKING_DETAIL to get a json complete tracking from (LaPoste_Fr or LaPoste_Be national posts)
- metadataKind=TRACKING & metadataType=FILE & name=ACKN to get the acknowledgement PDF proof
- metadataKind=TRACKING & metadataType=FILE & name=CERTIF to get he deposit PDF proof
You can get a proof using GET /shipments/<shipmentId>/trackingFile/trackingName

Job errors

If you face errors, then you are in the advanced mode. We strongly advise you to go to the advanced mode presentation.

Get Job packgroups
  • /GET jobs/{jobId}/packGroups
- Send the parameter jobId
- A packgroup is a non-composed element that will go either to email, or to mail, or... This is not yet the shipment. - You will find the problem in the eligibility
Update packGroup
  • POST /packGroups/{packGroupId}/edit
- Remember to edit the RAW value of the pack