The Cloud API serves as a quick-and-easy demonstration of Hop's solving capabilities for optimizing routes for a fleet of vehicles.
All requests to the API should include a basic Authorization header that references a API Token. For example, Aladdin's requests to the Nextmv API should all include the following header: Authorization: Bearer YWxhZGRpbjpvcGVuc2VzYW1l.
curl --request POST \
--url https://api.cloud.nextmv.io/v0/run \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"options":{"solver":{"diagram":{"width":0,"expansion":{"limit":0}},"limits":{"duration":"string","solutions":0,"nodes":0}}},"defaults":{"vehicles":{"start":{"lon":-180,"lat":-90},"end":{"lon":-180,"lat":-90},"speed":0,"capacity":0,"shift_start":"2019-08-24T14:15:22Z","shift_end":"2019-08-24T14:15:22Z","compatibility_attributes":["string"]},"stops":{"unassigned_penalty":0,"quantity":0,"hard_window":["2019-08-24T14:15:22Z"],"stop_duration":0,"target_time":"2019-08-24T14:15:22Z","earliness_penalty":0,"lateness_penalty":0,"compatibility_attributes":["string"]}},"vehicles":[{"start":{"lon":-180,"lat":-90},"end":{"lon":-180,"lat":-90},"speed":0,"capacity":0,"shift_start":"2019-08-24T14:15:22Z","shift_end":"2019-08-24T14:15:22Z","compatibility_attributes":["string"],"id":"string"}],"stops":[{"id":"string","position":{"lon":-180,"lat":-90},"unassigned_penalty":0,"quantity":0,"precedes":"string","hard_window":["2019-08-24T14:15:22Z"],"stop_duration":0,"target_time":"2019-08-24T14:15:22Z","earliness_penalty":0,"lateness_penalty":0,"compatibility_attributes":["string"]}]}'curl --request GET \
--url https://api.cloud.nextmv.io/v0/run/%7Brun_id%7D/status \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json'curl --request GET \
--url https://api.cloud.nextmv.io/v0/run/%7Brun_id%7D/result \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json'