Route optimization with Nextmv Cloud
Many folks get started by testing out the pre-loaded, use-case specific sample input files in the cloud console itself. Running files in the console is ideal for analyzing the routes on the map and digging into charts that break down the solution value.
If you’re ready to start using your own files or would rather test using the command line (or like to use tools like Postman), this is the tutorial for you.
Get your API key
Once you’re into the console, navigate to the API page on the left hand side.
Reveal your API key. Once you’ve clicked on the button, your API key will automatically be copied to your clipboard.
Feel free to follow the guided experience on the page or run it on your own machine using the directions below.
Post the file
We opted to demonstrate using cURL, but the following components can also be used with API platforms like Postman. Let’s get started!
In this POST request, you’ll notice the following:
- The Nextmv Cloud API endpoint (Use https://api.cloud.nextmv.io/v0/run)
- Your API key (You copied this in the previous step)
- JSON with vehicles, stops, and constraints (Feel free to copy exactly what’s below or create your own file following the input schema)
Paste the following into your terminal:
You should get a result that looks like the following. You’ll need your run-id in just a moment so make sure to copy it.
Get the run status
Ok, now let’s see how the run went.
Paste the following into your terminal. Make sure to use your unique run-id.
You’ll see something like this returned as a status:
If you saw “succeeded” then it’s time to move on to the next step!
Seeing an error code? Not to worry. Hop into the documentation for more information on what’s going on.
Get your result
And now for the exciting part! Let’s see your optimized route.
Paste the following into your terminal, remembering to use your run-id and API key:
You’ll see something like the JSON below returned.
The results outline the optimized routes for each vehicle as well as a few key details about your run and returned solution.
Congrats on a successful run!
Have a question? Please reach out to us! We always enjoy chatting about optimization.