APIs

So what the fuck is an API? Aside from being an acronym for Application Programming Interface, it’s the thing that lets you integrate one app/service with another when built-in integrations are unavailable.

APIs are doorways between applications.

  • API requests are sent in the form of a simple HTTP message

  • HTTP methods include:

    • POST

    • GET

    • PUT

    • PATCH

    • DELETE

These methods correspond to CRUUD operations:

  • POST method creates something

  • GET requests read info

  • PUT updates info

  • PATCH also updates info (PUT replaces info, PATCH will modify info)

  • DELETE deletes info

Once an API request has been sent, the application will send back a response. The responses wil be sent back often in JSON format.

In MAKE, APIs are used when:

  • The app you want to automate isn’t already built into MAKE

  • You want more control or access than the default modules give

  • You're working with HTTP modules (like "Make a request")

How API calls work (in MAKE):

  1. URL: where to send the request (called the “endpoint”)

  2. Method: what kind of action you want:

    • GET – get data

    • POST – send new data

    • PUT/PATCH – update existing data

    • DELETE – remove something

  3. Headers: extra info like API keys (like showing your ID to enter)

  4. Body: optional: data you're sending, usually in JSON

Response = JSON
APIs usually reply with JSON. MAKE can parse it and let you use the data in other modules.

Core API Concepts to Understand:

  • Endpoint = URL of the specific resource (like /users/123)

  • Authentication = proving who you are (API key, token)

  • JSON = format of the data you're sending/receiving

  • Headers = required settings (like Authorization: Bearer YOUR_API_KEY)

  • Status Code = API’s response (200 = success, 400+ = error)

How to use an API
When connecting to an API the 1st thing is to look for Authentication > then look for a way to copy/paste an example > then build minimum viable API call. For eg:

  1. HTTP - Make Request

  2. Google the. API you’re seeking

  3. Search for the authentication header

  4. Put together minimum viable API call

An endpoint is a specific URL that you send a request to when you want to talk to an API and do something specific, Eg:

  • getting a list of users

  • sending a message

  • updating a record

Think of APIs like a restaurant menu:

  • You (MAKE) choose something from the menu (send a request)

  • The kitchen (API) prepares it and brings it back (response)