v1 · preview

Try webhook signature, alert.created, location_withheld or 429.

↑ ↓ moveEnter openEsc close

Reference

Authentication

OAuth2 client_credentials: an opaque token valid for one hour.

Request a token (client_credentials)

POST/v1/oauth/token

No token: it authenticates with the client_secret.

OAuth2 client_credentials. The token is opaque, lasts one hour and is revoked immediately when the client is deactivated.

Body application/x-www-form-urlencoded TokenRequest

  • grant_typestringrequired

    Possible values: client_credentials

  • client_idstringrequired
  • client_secretstringrequired
  • scopestring

    Space-separated; a subset of the client’s. Without it, all of the client’s.

Responses

  • 200

    Token issued.

    application/json TokenResponse

  • 400

    Malformed request or scope not allowed.

    application/json OAuthError

  • 401

    Incorrect client or secret.

    application/json OAuthError

Request · sandbox

curl -X POST https://sandbox.api.safeonuba.com/v1/oauth/token \
  -d grant_type=client_credentials \
  -d client_id="$SAFEONUBA_CLIENT_ID" \
  -d client_secret="$SAFEONUBA_CLIENT_SECRET" \
  -d scope="alerts:read musters:read"

Response 200

JSON
{
  "access_token": "at_9c1e…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "alerts:read alerts:write musters:read"
}