JouloDocs

Testing

Tips for testing your Joulo API integration

The Joulo API serves live data from your connected chargers. Here are some practical approaches for developing and testing your integration.

Verify your token

Start by confirming your API token works. A simple GET /chargers call should return your charger list:

curl -s https://api.joulo.nl/functions/v1/api/chargers \
  -H "Authorization: Bearer YOUR_API_TOKEN" | python3 -m json.tool

If you receive {"error": "Missing or invalid API token"}, double-check that:

  • The token is copied correctly (no leading/trailing whitespace)
  • The token is still active (check Settings → API in the dashboard)
  • The Authorization header uses the Bearer prefix (with space)

Test each endpoint

Chargers

curl -s https://api.joulo.nl/functions/v1/api/chargers \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Verify that:

  • All your connected chargers appear in the response
  • is_charging reflects whether a session is active
  • connection_type matches how each charger is connected

Sessions

curl -s "https://api.joulo.nl/functions/v1/api/sessions?limit=5" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Verify that:

  • Sessions are returned in reverse chronological order
  • kwh values are present for completed sessions
  • The charger_id matches one of your chargers

Sessions with filters

curl -s "https://api.joulo.nl/functions/v1/api/sessions?charger_id=YOUR_CHARGER_ID&from=2026-01-01T00:00:00Z&limit=10" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Verify that only sessions for the specified charger and date range are returned.

Energy

curl -s https://api.joulo.nl/functions/v1/api/energy \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Verify that:

  • total_kwh and total_sessions reflect your overall usage
  • The months array contains entries for months with charging activity

Query parameter authentication

If you're testing with a browser or a tool that doesn't support custom headers, use the query parameter method:

https://api.joulo.nl/functions/v1/api/chargers?token=YOUR_API_TOKEN

You can open this URL directly in your browser to inspect the JSON response.

Pagination

Test pagination on the sessions endpoint by adjusting limit and offset:

# First page
curl -s "https://api.joulo.nl/functions/v1/api/sessions?limit=2&offset=0" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Second page
curl -s "https://api.joulo.nl/functions/v1/api/sessions?limit=2&offset=2" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Error handling

Test that your integration handles error responses correctly:

# Invalid token -> 401
curl -s https://api.joulo.nl/functions/v1/api/chargers \
  -H "Authorization: Bearer invalid_token"

# Wrong method -> 405
curl -s -X POST https://api.joulo.nl/functions/v1/api/chargers \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Unknown path -> 404
curl -s https://api.joulo.nl/functions/v1/api/unknown \
  -H "Authorization: Bearer YOUR_API_TOKEN"

During development, start a charging session on your charger to test the is_charging and current_session fields on the chargers endpoint. This gives you a richer response to validate against.