5.5 Fetch-Plan Endpoint

The fetch-plan endpoint is used to retrieve the result of a completed planning optimisation task.

5.5.1 Fetch-Plan Requests

A fetch-plan request takes the form of an HTTP GET request to a URL of the following form:

https://server-name/mwo/v2/fetch-plan/task-identifier

where server-name will be provided by Opturion and task-identifier is the task identifier returned by submit-plan.

5.5.2 Fetch-Plan Request Example

Here is an example fetch-plan request:

    https://demo.opturion.com/mwo/v2/fetch-plan/9046b6e9-7d7d-4453-a935-d331edb268bb

5.5.3 Fetch-Plan Responses

The following table lists of all of the HTTP status codes that fetch-plan specifically returns and their meaning. Any other HTTP status code returned by fetch-plan that is not covered by this table has its usual meaning.

Status Code

Description

Response Body

200 (OK)

Optimisation result has been returned.

A JSON plan fetch response object.

401 (Unauthorized)

Authentication (if enabled) failed; the user is not authorized to access the optimiser.

Empty.

404 (Not Found)

A task matching the given task identifier and owned by the authenticated user could not be found.

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 JSON object further describing the error.

After the result has been retrieved using fetch-plan, it will be deleted from the server and subsequent fetch-plan requests for the same task identifier will return HTTP status 404.

Depending on the service configuration, optimisation results that have not been retrieved will be deleted after a given time elapses. (Opturion will provide details of this configuration.)