Your provisioning script must edit an existing appliance static route in a branch network and also add the first static route in a brand-new network through the Meraki dashboard API. The API accepts a call only when the method matches the action. Which HTTP method should the script send for each of the two tasks?
Select an answer to reveal the explanation.
Short Explanation
Use PUT at the existing static route’s own URL to update it, and POST at the network’s static route collection URL to create the first route. It’s like editing a form already in your folder versus filing a new one.
Full Explanation
For Meraki appliance static routes, POST on the collection URL creates a route, while PUT on the specific resource URL updates the route identified by its id. The existing appliance static route already has an id, so the edit goes to its own URL with PUT and a body of changed fields; the route that does not exist yet has no id to address, so it must be posted to the network's static route collection. Posting to the collection invokes the create operation, not an update to an existing route. Treating PUT as create-or-replace everywhere fails the new-network case, since nothing exists yet to give you a route URL to send. Relying on PATCH follows generic REST conventions, but this API exposes updates with PUT rather than PATCH, so the edit is not supported with PATCH. Exam caveat: method lists differ from endpoint to endpoint across the dashboard API, so check the documented methods for that resource instead of assuming the pattern. Practical check: log the status code and returned id, then GET the route back to confirm the change.