Run a Process API calculation
Note: The time to run a calculation using the OLI Process API cannot be predicted accurately and also some calculations may take longer to compute than others. Hence, a polling mechanism is required to retrieve the result of each calculation. The steps for this mechanism are described below.
Send a POST request to the run URL below
If the request was successful(status:200), the JSON response back will contain a link to the results and status of the computation. The status inside the "data" array will be IN QUEUE/IN PROGRESS
Keep polling the returned results link with a GET request until the status member of the response changes from IN PROGRESS to PROCESSED/FAILED/ERROR or COMPLETED
When the status is COMPLETED, then response will also contain the result of the computation
Run the selected process
POST
https://api.olisystems.com/process/run/{process_id}
The input to run the calculation is provided in the body of the message as JSON, the input is the data.flowsheet.properties object retrieved using the Get input specs for Process API package call.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer {access_token} |
Content-Type | string | application/json |
Request Body
Name | Type | Description |
---|---|---|
* | JSON | { "properties" : { "input" " { ...}}} |
Response description
field | description |
data.jobId | the current request job identifier |
data.processId | the processId used for the job being run |
data.resultsLink | the https endpoint to poll to get the final result |
data.status | current status of the job IN QUEUE/IN PROGRESS |
message | message describing the request |
status | status of the current request, can be SUCCESS or FAILED |
Last updated