4

Let's use the Twitter API as an example. My understanding is that we refer to /statuses/update as an endpoint and we refer to POST as a HTTP method.

So what would term do you use to refer to the pair of these two things combined, i.e. POST /statuses/update?

  1. "Endpoint". It seems most conventional to also refer to the combination as "endpoint". See for example: Stripe's documentation of some of its "endpoints" here or this overview page for Twitter. The only problem is when I'm in a verbal conversation with someone saying "endpoint", it is sometimes ambiguous whether I mean just the end path /statuses/update or the combination POST /statuses/update.

  2. "Request method" or "API method". For example, Slack's REST API documentation refers to the end paths as "method URLs" and the collection of these as "API methods". Some API docs will list these pairs in the following manner:

    Available methods

    POST /statuses/update

    GET /statuses/lookup

2 Answers 2

2

So what would term do you use to refer to the pair of these two things combined, i.e. POST /statuses/update?

IMO that depends on the level of detail you want to describe:

  • You could use REST API method for the general case. This makes it clear you'll need to have a REST endpoint in combination with an arbitrary HTTP command (in the end you can define your own, as long the server understands how to dispatch them, see HTTP Methods)
  • You could classify the method further like
    • REST API read method (e.g. for GET)
    • REST API write method (e.g. for POST, DELETE, etc.)
2

"Operation"

Swagger (and now OpenAPI Specification) uses the term "operation" to refer to a combination of HTTP method + endpoint.

In OpenAPI terms, paths are endpoints (resources), such as /users or /reports/summary/, that your API exposes, and operations are the HTTP methods used to manipulate these paths, such as GET, POST or DELETE.

Each unique combination of method + path can be allocated an operationId in the specification document for your API.

Also, from this Baeldung article on Swagger's Java annotations library:

The @Operation annotation is used to describe a single operation. An operation is a unique combination of a path and an HTTP method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.