Which of the following URL paths best follows RESTful API design principles for accessing a list of all devices?
Think about using nouns and plural forms for resource collections.
RESTful APIs use nouns to represent resources. The plural form '/devices' is the standard way to represent a collection of device resources.
What is the expected HTTP status code when successfully updating a device configuration using a PUT request?
PUT /devices/123/config HTTP/1.1 Host: api.example.com Content-Type: application/json {"mode": "active", "threshold": 75}
Consider what status code means successful update with response body.
200 OK indicates the update was successful and the server returns the updated resource or confirmation.
Arrange the following API calls in the correct order to register a new device and then activate it.
Think about creating first, then checking, then updating status.
First, create the device with POST. Then confirm creation with GET. Next, activate by PATCH updating status. DELETE comes last in the full sequence.
A client sends a DELETE request to /devices/456 but receives a 405 Method Not Allowed error. What is the most likely cause?
405 means the method is not allowed on the resource.
405 Method Not Allowed means the HTTP method (DELETE) is not supported on that endpoint, regardless of resource existence.
Which of the following is the best RESTful API versioning strategy for devices to ensure backward compatibility?
Consider clarity and cacheability in URLs.
Including the version in the URL path is the most common and clear approach, making it easy to route and cache requests properly.