concept goal in category api

appears as: goal, goal, The goal, goals, goals, A goal
Irresistible APIs: Designing web APIs that developers will love

This is an excerpt from Manning's book Irresistible APIs: Designing web APIs that developers will love.

In addition, you’ll develop a good basic understanding of the technologies involved in creating a RESTful API. REST stands for Representational State Transfer and refers to APIs that are resource based—where the clients interact with the servers by requesting things rather than actions. The creation of web APIs is technologically simple: a skilled developer can use Flask, Django, Ruby on Rails, or Node.js to put together a basic REST API in a few minutes. Without a clear plan, design, and goal, that API is unlikely to be excellent, usable, or successful. How you use those technologies makes all the difference between a successful, irresistible API and one that lies fallow in the ecosystem with no users. The book is made for you, whether you’re a product manager, technical lead, engineering manager, API developer, or even a developer who wants to assess APIs you’ve created or ones you’re looking to use.

The next few chapters cover the server-client interaction in detail, but this chapter helps you understand the concepts with a simple example of an API and sample application. Most basic API examples use a to-do list, but that’s kind of overused. I decided to go a different way: I’ve selected a list application with pizza toppings. Note that this particular application is simple by design; the goal is to show you how to interact with the API, and how an application interacts with an API. If this were a production application it would have a full pizza, or pizzas, and the database wouldn’t be shared, but for the goals here I’ve taken out as much complexity as possible to make the basic principles clear.

Figure 6.10. Social platforms have a specific set of goals; increasing the amount of activity in the system and the frequency of interactions by users both indicate a healthy ecosystem. When determining strong metrics for your social application, think carefully about what kind of metrics will indicate that users are more closely tied to your system (frequency of interaction) or providing new interesting content (frequency of writes).
The Design of Web APIs

This is an excerpt from Manning's book The Design of Web APIs.

The goal of designing software (or anything else) that fulfills users' needs is not something new. It has been a goal as long as software has existed. Numerous methods have been and are still being invented in order to collect users' needs, to get a deep and accurate understanding of them, and finally to create some software that fulfills their goals more or less efficiently and accurately. These methods can all be used to identify an API’s goals. Feel free to use the one you are familiar with or adapt the method presented in this book as you see fit, as long as you know who your users are, what they can do, and how they can do it. The following sections describe these principles.

Figure 2.13 Investigating the whos, whats, hows, inputs, and outputs to identify goals

02-13.png
Listing 8.2 Linking a goal to scopes
paths:
  /beneficiaries:
    get:
      tags:
        - Transfer
      description: Gets beneficiaries list
      security:    #1  
        - BankingAPIScopes:    #2  
          - "beneficiary:read"
          - "beneficiary:manage"
      responses:
        "200":
          description: The beneficiaries list

#1   Lists the security schemes used
#2   References a security scheme from components.securityScheme and lists scopes needed to use this goal

Context impacting design is not reserved to consumer contexts, either. The provider’s context can also influence design, even if API designers do everything they can to hide the provider’s perspective (see section 2.4). Representing a goal involving human controls (such as some cases of international money transfers) with a synchronous request/response mechanism might not be the best option. That is why when we design APIs, we must choose the best way to communicate, taking into account both consumers’ and providers’ potential limitations and even considering other styles of APIs beyond REST. If we do not do that, the APIs we design might not be fully usable or implementable.