What does "consume an API" mean?

43,498

Solution 1

To consume an API means to basically use any part of it from your application.

Solution 2

Consuming an API here means creating a client which can send requests to the API that you build.

It appears that you need to create and API which can handle Create, retrieve, update and delete (CRUD) of a resource. For instance if your REST api is to create a blog, your API should handle CRUD functions for the object/resource blogpost. POST - Create a blog post GET - Retrieve a blog post PUT - Update a blog post DELETE - Delete a blog post.

Solution 3

It is about the direction of the app's interaction with API - it either provides an API, or consumes it, so there are providers and consumers of API, and this is just a less general and ambiguous term than 'using'.

Solution 4

Simply consuming an API means using it in your application.

For, e.g., GET request to https://someapi/Users will give you all the users.

You need to request this URL https://someapi/Users to get all the users and then you can use it into your application.

Share:
43,498
Gabriel S.
Author by

Gabriel S.

Nothing to do here

Updated on July 19, 2022

Comments

  • Gabriel S.
    Gabriel S. almost 2 years

    Here is an excerpt from an assignment I am currently doing:

    Build a dummy app that:

    • Contains a REST API that operates over a single resource.
    • Contains a Backbone client that consumes that API and can list, show, create, update, and remove that resource.

    My understanding was that the term "consume" implies total coverage of the API's exposed ressources. However, the assignment says "consumes that API and can [CRUD] that resource".

    Is that sentence redundant or is my understanding of the term wrong?

    (Bonus question: why searching Google for this question returns countless language-specific tutorials for "consuming an API" but none explain what the term actually means?).