← Servers, deploying and APIs

Lesson 15 of 20 · Learn · 8 min

3.1 What an API is

An API lets one program ask another to do something. Your app asks Lynk's API to send an SMS, an email or a WhatsApp message, use Lynk AI, or take a payment.

A request has

  • An address, like https://www.lynkinfra.com/api/v1/sms
  • A method: POST to do something, GET to read something
  • A key, in the Authorization header: Bearer lynk_…
  • JSON, the details: {"to": "0241234567", "message": "Your order is ready"}

The answer has a status

StatusMeans
200It worked
400Something in the request is missing or wrong
401The key is missing or wrong
403The key isn't allowed to do this

Keys are passwords for apps. Keep them on the server. Never put a key in a website's code or a phone app, never send it on WhatsApp, and never put it in a screenshot.

Next lesson

Sign in to save your progress and earn the certificate.

2.7 Graded quiz