Helios Developers

Examples

Obtain an access token
Helios APIs: Authentication

The following code snippet demonstrates how you can authenticate API requests using an OAuth access token in cURL.

To view code snippets in other programming languages, see our GitHub repo.


# Exchange API keys for an OAuth access token (Authorization header)
auth=`echo -n "$api_key_id:$api_key_secret" | base64 --wrap=0`
curl -X POST -H "Authorization: Basic $auth" -d "grant_type=client_credentials" https://api.helios.earth/v1/oauth/token

# Exchange API keys for an OAuth access token (request body)
curl -X POST -d "grant_type=client_credentials&client_id=$api_key_id&client_secret=$api_key_secret" https://api.helios.earth/v1/oauth/token

# Retrieve the access token from the curl response (using sed, awk, jq, etc.)
jwt='access_token'

# Request some data by including the access token in the Authorization header
curl -H "Authorization: Bearer $jwt" https://api.helios.earth/v1/cameras

# Request some data by including the access token in a POST body
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "access_token=$jwt" https://api.helios.earth/v1/cameras/_search