Resources, not actions
An HTTP API is easiest to use when its URLs name resources (things) and the HTTP method says what to do with them. A collection holds many items: /orders. An item is one of them, addressed by its id: /orders/42. The same URL is used to read, change and delete that order; only the method changes.
The classic mistake is putting the action in the path: /getOrder?id=42, /createOrder, /orders/42/delete. Each action becomes a new URL to learn, and generic tools (caches, proxies, client libraries) can't tell which calls are safe to repeat. Use plural nouns, keep ids in the path, and leave verbs to the method.
GitHub's API: GET /repos/{owner}/{repo}/issues lists issues, POST to the same URL creates one, GET /repos/{owner}/{repo}/issues/7 reads issue 7.
In code: HTTP
GET /orders list orders
POST /orders create an order
GET /orders/42 read order 42
PATCH /orders/42 change some fields of order 42
DELETE /orders/42 delete order 42
Not this:
GET /getOrder?id=42
POST /createOrder
POST /orders/42/delete- The collection and the item are two URLs; five operations share them.
- Query strings are for filtering a collection (?status=paid), not for naming the item.
Which of these URLs follow resource-oriented design? (Choose two.)
Select 2, then check.