liveBook · Manning

Action

As explained in The Design of Web APIs, Second Edition

An action is the intended effect that an operation applies to a resource, expressed by the main verb in the operation description.

An action is the main verb describing the intended effect an operation applies to a resource. Identify it in plain-language operation descriptions before choosing an HTTP method. section 3.4 section 3.4.1

Identify an action by following this sequence:

  • Read the operation description and find its main verb. section 3.4.1
  • Treat that verb as the action applied to the operation’s resource. section 3.4.1
  • List the action’s inputs and outputs, merging information from the steps that use it. section 3.4 section 3.5
  • Only afterward map the action to an HTTP method and locate its data in the request or response. section 4.1.2

From operation wording to HTTP

For “Search for products in the catalog,” identify “Search” as the action and “Catalog” as the resource. Represent it as GET /products, place filters in the query, and return product information in the response body. For “Add a product to the catalog,” identify “Add” as the action; POST /products is the usual creation pattern, while PUT /products/{Product reference} requires a client-supplied reference. section 3.4.1 section 4.1.2 section 4.3.5

Keep the raw verb during analysis. Do not replace it prematurely with a CRUD label or an HTTP method; those are later design choices. Context-agnostic input and output descriptions help avoid duplication, and the resource itself usually does not belong in the input list unless multiple instances exist. section 3.4.1 section 3.5

Figure 3.14 We use the operation description’s main verb to identify the action.
figure

Use the figure to connect each operation’s main verb with the resource it acts on. section 3.4.1

How The Design of Web APIs, Second Edition covers it

How deep it goes
Defines actions, provides identification rules, lists inputs and outputs, and stops short of detailed data modeling.
Examples
Uses catalog operations such as Add, Search, Get, Modify, and Remove, plus course-platform operations for setup, lookup, verification, and modification.
What it assumes
Assumes operation descriptions and resources; teaches action identification before requiring HTTP and data-modeling decisions.
What you can do after
Apply it to identify raw operation verbs and translate them into HTTP methods, inputs, outputs, and data locations.
How it connects
Connects actions with resources, HTTP methods, operation inputs, operation outputs, and CRUD operations.

Also explained in

Compare how 13 books explain action →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.