Home > EnPower Web API > Get the Access Token

Export to PDF

Get the Access Token

Once you have the application (client) ID, you can retrieve the access token via the application (client) ID and client secret to authenticate with the EnPower Web API.

To get the access token with a client secret added during app registration, follow the steps below:

  1. Set the access token URL (API endpoint) based on your organization’s AvePoint environment:

  2. Set the header to Content-Type: application/x-www-form-urlencoded.

  3. Set the following parameters in the request body:

    • client_id – The Application (Client) ID of the app you registered in AvePoint Online Services.

    • client_secret – Copy the Client secret you added during the app registration.

    • scope – Set this value to enpower.data.read.all.

    • grant_type – Set this value to client_credentials.

Example Request

POST https://identity.avepointonlineservices.com/connect/token

Content-Type: application/x-www-form-urlencoded

client_id={your_app_client_id}&client_secret={your_app_client_secret}&scope=enpower.data.read.all&grant_type=client_credentials

Example Response

A successful request returns a JSON response containing the access token

{"access_token":"eyJhbGciOiJSUzI1NiIsIm……","expires_in":3600,"token_type":"Bearer","scope":"enpower.data.read.all"}

Note the following:

- The **access_token** node is the token value and it is a Bearer token that should be included in the Authorization header of subsequent API requests. - The **expires_in** node denotes the number of seconds until the received token expires. After the expiration, a new token can be retrieved using the same process.