Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "consume an API" mean?

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?).

like image 626
Gabriel S. Avatar asked Jul 09 '14 18:07

Gabriel S.


2 Answers

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

like image 167
TGH Avatar answered Oct 14 '22 07:10

TGH


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.

like image 36
infernal_lad Avatar answered Oct 14 '22 09:10

infernal_lad