Explore the API quickly using curl
For many developers, curl is the quickest way to explore a new API. This demo shows how to make a first call to Leafy Energy.
Example: fetch your own customer profile
curl -X GET \
https://api.leafy.energy/v1/customers/me \
-H "Authorization: Bearer DEMO_API_KEY_123" \
-H "Accept: application/json"
Expected JSON structure
{
"id": "cust_demo_001",
"email": "demo@example.com",
"default_site_id": "site_home_001",
"created_at": "2024-01-01T10:00:00Z"
}
In training sessions you can ask participants to run these curl commands in a sandbox and walk them through the response line by line.
Comments
0 comments
Please sign in to leave a comment.