An API call is a consumer’s request to perform an operation or retrieve data. In a web API, the consumer sends an HTTP request describing the action and any needed input. The server returns an HTTP response indicating the result and, when appropriate, the resulting data. section 1.1.2
Search a product catalog
A mobile application can send GET /products?type=BD to find Blu-ray products. GET expresses the search action, /products identifies the catalog, and type=BD supplies a filter. A 200 OK response indicates success; its body contains the matching products. section 4.1.1
To design a call, map the operation’s parts to HTTP:
- Choose a path for the resource and an HTTP method for the action. section 4.1.2
- Place input data in an appropriate request location, such as query parameters for search filters. section 4.1.2
- Choose response status codes for outcomes and a location, such as the body, for output data. Model the detailed input and output fields separately. section 4.1.2
A call also has a cost within an operation flow: avoid repeating a read or search call when the same operation with the same parameters would retrieve data already available. For example, a money-transfer flow can list eligible accounts once and reuse that result for both source and destination selection. This changes the flow, not the operation’s design. section 10.3.3


