Our REST API is working great with a collection of endpoints that a client can send requests to.

In this chapter, we'll do something outside-of-the-box, ehem send requests to "outside our box" 🥁😅 Let me explain...

Our server will be the "client" which sends requests to external services, like Public APIs.

🙋‍♀️ Isn't mLab a public API? → mLab is external, but we used mongo library to abstract the requests and responses made to the database

How our server communicates with a public API is exactly the same as how our client communicates with our server: through HTTP requests that we know, like GET and POST 🤓

For example:

  1. Search a song from Spotify API
  2. Get a GIF/meme from Giphy API
  3. Authenticate user through Google, Facebook (part of Appendix topic Auth 2)

Client <——> Server


Client <—> Server < — > external API


They have APIs for everything nowadays!

Public APIs require varying levels of authentication: