7.2 solve-json Endpoint
The solve-json endpoint is used to submit scenarios to the optimiser in OLM-JSON format for load plan creation.
7.2.1 solve-json Requests
A solve-json request is an HTTP POST request to a URL of the following form:
https://server-name/olm/v1/solve-json?parameters
where server-name will be provided by Opturion and parameters is described below.
The body of the POST request is a JSON document containing a OLM-JSON optimise request object.
7.2.2 solve-json Parameters
The solve-json endpoint accepts one optional parameter. It is:
- format – this parameter controls whether a successful output is in OLM-JSON or OLM-Excel format. Its value should be one of “json” or “excel”. If this parameter is not present, then it defaults to “json”.
7.2.3 solve-json Request Example
Here is an example solve-json request URL:
https://demo.opturion.com/olm/v1/solve-json?format=excel
Note that in this case we are using the format parameter to make the OLM return the solution in OLM-Excel format.
7.2.4 solve-json Responses
The following table lists all of the HTTP status codes that solve-json specifically returns and their meaning. Any other HTTP status code returned by solve-json that is not covered by this table has its usual meaning.
| HTTP Status Code | Description | HTTP Response Body |
| 200 (OK) | A load plan has been returned. | A OLM-JSON response object or OLM-Excel output workbook. |
| 400 (Bad Request) | There are errors in the input or web service invocation. | The body of the HTTP response may contain an OLM-JSON response object describing any errors. |
| 401 (Unauthorized) | Authentication (if required) failed; the client is not authorized to access the optimiser. | Empty. |
| 429 (Too Many Requests) | May be returned if rate limiting has been applied by the server. | Empty. |
| 500 (Internal Server Error) | Indicates that an error occurred on the server. | The body may contain a OLM-JSON response object further describing the error. |

