Skip to main content

Asynchronous entry points

These are the functions used to send asynchronously calculations to the SDK, they are published by the library

  • MPTCalculation : run a route optimisation calculation
  • MCICalculation : run an itinerary calculation
Note

Before using these functions, the SDK must have been initialized. See Initialization message

MPTCalculation

The function parameter is a MPT problem. See POST /mpt/problems in MPT OpenAPI Documentation for more information.

MCICalculation

The function parameter is a MCI problem. See POST /mci/problems in MCDI OpenAPI Documentation.

Job progression and result

When successfule, some Asynchronous job progress messages wille be sent by the SDK

Return value

these functions are immediately returning a JSON string containing :

  • jobId : the calculation job id; if it is not present, the SDK was not able to send the problem to the APIs
  • statusCode : the status code delivered by the API (201 if succesful)
  • errorMessage : a displayable message when the SDK was not able to send the problem to the APIs
Example of a successful job
{
"id": "job id content",
"statusCode": 201
}
Example of an unsuccessful job
{
"statusCode": 500,
"errorMessage": "SDK not loaded"
}