Authenticate with the Salto Space API

The Space API uses the OAuth 2.0 client credentials flow. Your application requests an access token from the Salto IDM identity server, then sends the token with every API call.

You need the client ID and secret of your API client. Salto issues them when it connects your Salto Space installation to the Space API. See Connect Salto Space to the Space API on the Salto support site.

To authenticate:

  1. Request an access token from the Salto IDM identity server with the OAuth 2.0 client credentials flow. Send the client ID and secret as a Basic authentication header:

    bash
    curl --request POST "https://identity.saltoidm.app/connect/token" \
      --user "CLIENT_ID:CLIENT_SECRET" \
      --header "Content-Type: application/x-www-form-urlencoded" \
      --data "grant_type=client_credentials"

    The response contains the access_token, its token_type of Bearer, and expires_in, the number of seconds the token stays valid. Request a new token when it expires.

  2. Call the Space API at the base URL https://space.api.saltoidm.app with the token in the Authorization header. The following request gets the first user:

    bash
    curl "https://space.api.saltoidm.app/api/v1/users/Filtered?maxCount=1" \
      --header "Authorization: Bearer ACCESS_TOKEN"

    Every response contains Data, Success, and Message.

Salto Systems, S. L. uses third-party data storage and retrieval devices in order to allow secure browsing and gain a better understanding of how users interact with the website in order to improve our services. You can accept all cookies by clicking the "Accept cookies" button or reject their use by clicking the "Reject cookies" button. For more information, visit our Cookies Policy