Find below some information on the steps to create your orders using the API

Authentication & logout

Authentication
  • /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 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.
Logout
  • /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
  • /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
You need to check for the status CREATED.
If you job status a long time (2 minutes for a single document job) in PACK_GROUP_CREATED you may have an eligibility issue with one pack.
Otherwise you have to manage an error
Deliveries status
  • /deliveries
  • X-Auth-Token header with the token you get from the authenticate
- Send the parameter jobId
- 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.

Job errors

If you face errors, then your service or recipient address should be updated.
You need to avoid to manage job creation errors from the AP due to the complexity.
Get Job packgroups
  • /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
  • /packGroups/{packGroupId}/edit
- Remember to edit the RAW value of the pack