💻 Terminal, HTTP & Your First API Call — app1.5
Developer CourseModule 1: Terminal, HTTP & Your First API Callapp1.5
Hands-on15 min

Hands-on: Terminal to Live Data in 5 Minutes

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

Hands-on: Terminal to Live Data in 5 Minutes

This is your first hands-on lab. Open your terminal and follow each step. Do not skip ahead.

Pre-flight Checklist

Run these commands and verify each one works:

# 1. Check curl is available
curl --version
# Expected: curl 7.x or 8.x

# 2. Check your public IP address
curl -s ifconfig.me
# Expected: your IP address (e.g., 203.0.113.42)

# 3. Verify DNS resolution works
nslookup app.energyatit.com
# Expected: a valid IP address

# 4. Test HTTPS connectivity
curl -s -o /dev/null -w "%{http_code}" https://app.energyatit.com/api/v1/health
# Expected: 200

Lab Exercise: 5 API Calls in 5 Minutes

Exercise 1: Health check

curl -s https://app.energyatit.com/api/v1/health | python3 -m json.tool
curl.exe -s "https://app.energyatit.com/api/v1/health" | ConvertFrom-Json | ConvertTo-Json -Depth 10

Exercise 2: List sites (replace with your key)

export EAT_KEY="eat_test_YOUR_KEY_HERE"
curl -s -H "Authorization: $EAT_KEY" https://app.energyatit.com/api/v1/sites | python3 -m json.tool
$env:EAT_KEY = "eat_test_YOUR_KEY_HERE"
curl.exe -s -H "Authorization: $env:EAT_KEY" "https://app.energyatit.com/api/v1/sites" | ConvertFrom-Json | ConvertTo-Json -Depth 10

Exercise 3: List assets for site 1

curl -s -H "Authorization: $EAT_KEY" "https://app.energyatit.com/api/v1/assets?site_id=1" | python3 -m json.tool
curl.exe -s -H "Authorization: $env:EAT_KEY" "https://app.energyatit.com/api/v1/assets?site_id=1" | ConvertFrom-Json | ConvertTo-Json -Depth 10

Exercise 4: Get grid connection readings

curl -s -H "Authorization: $EAT_KEY" https://app.energyatit.com/api/v1/grid-connections/1/readings | python3 -m json.tool
curl.exe -s -H "Authorization: $env:EAT_KEY" "https://app.energyatit.com/api/v1/grid-connections/1/readings" | ConvertFrom-Json | ConvertTo-Json -Depth 10

Exercise 5: Check integration status

curl -s -H "Authorization: $EAT_KEY" https://app.energyatit.com/api/v1/integrations/status | python3 -m json.tool
curl.exe -s -H "Authorization: $env:EAT_KEY" "https://app.energyatit.com/api/v1/integrations/status" | ConvertFrom-Json | ConvertTo-Json -Depth 10

Verification

If all 5 commands returned valid JSON with "success": true, you have completed the lab. You just queried a live energy platform from your terminal.

Open Hands-on Lab

Complete the exercise in the Developer Hub.

Launch

Log in to track your progress and earn certifications.