Access token OAuth 2.0


Access data can be obtained by making a POST request to the URL of the token with the authorization code:

https://worksection.com/oauth2/token
The POST request must contain the required parameters: 

PARAMETERDESCRIPTION
client_id
client_id, received when creating the application.
client_secret
client_secret, received when creating the application.
grant_type
Always specify the authorization_code.
code
The authorization code you received in the previous step.
redirect_uri
URI where the response will be redirected. The URI must meet the requirements of the OAuth2 standard and use the HTTPS protocol.

CURL example:

curl -X POST -d "client_id=<client_id>&client_secret=<client_secret>&grant_type=authorization_code&code=<authorization_code>&redirect_uri=<redirect_uri>"
https://worksection.com/oauth2/token 
Example response:

{
    "token_type": "bearer",
    "expires_in": 86400,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJh...",
    "refresh_token": "def502005534a202e9e8effa05cdbad564015604f34...", "account_url": "https://authorizeduseraccount.worksection.com"
}
The received access_token and refresh_token will be used in subsequent requests to access the API and update the access_token. The access_token is valid for 24 hours, the refresh_token is valid for 1 month.