added

API - OAuth2 Client Credentials support

πŸš€ Feature Release

The authentication capabilities of the API have been extended to support an OAuth2 Client Credentials grant for machine-to-machine usage.

Select Client Credentials as flow type when creating/updating your API Client in the Dashboard. Then you should be able to use the client_id and secret of the client to obtain an access token.

curl -X POST \
  https://accounts-api.airthings.com/v1/token \
  -H 'Content-Type: application/json' \
  -d '{
	"grant_type":"client_credentials",
	"client_id":"b8a19a7d-64cd-4281-xxxx-xxxxxxxxxxxx",
	"client_secret":"82bfed8b-793a-4423-xxxx-xxxxxxxxxxxx"
}'
{
    "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjMTQ4ODQ1ZC0zNDc4LTRkYjAtOGI2My0yM2QxNGU5Y2EwYWMiLCJhdWQiOiJiOGExOWE3ZC02NGNkLTQyODEtYjUxNS0zZmZhY2M3MjZmZTMiLCJuYmYiOjE1NzMxMjkzNDEsImF6cCI6ImI4YTE5YTdkLTY0Y2QtNDI4MS1iNTE1LTNmZmFjYzcyNmZlMyIsInNjb3BlIjoicmVhZDpkZXZpY2UiLCJpc3MiOiJodHRwczpcL1wvYWNjb3VudHMuYWlydGhpbmdzLmNvbSIsImhicyI6InRydWUiLCJ0eXAiOiJCRUFSRVIiLCJleHAiOjE1NzMxNDAxNDEsImlhdCI6MTU3MzEyOTM0MSwianRpIjoiOTY5NGI4YzctNDEwZi00NjljLTg5YjUtOWY1YjA1NjdiM2ViIn0.s0KvfAs8VtutsusODZMeZHCEkCu5Oecfid1h1LUPhJqB5oe5WCs-TPRQ4oo7cIRDxBK4iTErapwu_QO4AHraQtfkhnRNcWgxhIW7c_3GQik2st6duaud--VIixze1blUKyqdZFRWUFSrgXP4bmxgGO6_x5HtnoCvjPfFwX5H5Xdn8g7FkV1GyGf0caQFUerk-eXjSU8z3CxjD_DD5fG_5FBr5rNpn7PHmc-y7PgBKJmB7CgdOr8ZqpW1PfseRociOGQCgfDNNiHsmd3Q0aGeLx1jnG4yDFT4EZwksH9zQfOb-j_vxo8uCegXG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