💻 Terminal, HTTP & Your First API Call — app1.3
Developer CourseModule 1: Terminal, HTTP & Your First API Callapp1.3
Reading12 min

What Is HTTP and Why Everything Uses It

💻 Module 1: Terminal, HTTP & Your First API Call

What Is HTTP and Why Everything Uses It

HTTP stands for Hypertext Transfer Protocol. It is the language that every computer on the internet uses to talk to every other computer.

When you load a webpage, your browser sends an HTTP request. When an app checks the weather, it sends an HTTP request. When EnergyAtIt reads a battery, it sends an HTTP request.

The 4 HTTP Methods You Need

MethodWhat It DoesExample
GETRead dataGet meter readings
POSTCreate somethingCreate a carbon record
PATCHUpdate somethingUpdate an asset config
DELETERemove somethingRevoke an API key

Status Codes — What the Server Tells You

CodeMeaningWhat to Do
200SuccessYou're good
201CreatedYour POST worked
400Bad RequestCheck your JSON body
401UnauthorizedYour API key is wrong or missing
403ForbiddenYou don't have permission for this
404Not FoundWrong URL
429Rate LimitedSlow down, wait, retry
500Server ErrorNot your fault. Retry later.

The Anatomy of an API Request

Every API request has 4 parts:

  1. URL: Where to send it — https://app.energyatit.com/api/v1/sites
  2. Method: What to do — GET, POST, PATCH, DELETE
  3. Headers: Metadata — especially Authorization for your API key
  4. Body: The data (for POST/PATCH) — always JSON

JSON — The Universal Format

JSON (JavaScript Object Notation) is how APIs send and receive data:

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Dubai Solar Farm",
    "capacity_mw": 10
  }
}

Every EnergyAtIt API response follows this format: { success, data?, error?, details? }

Log in to track your progress and earn certifications.