Token Creation & Token Management
Last updated
Was this helpful?
Last updated
Was this helpful?
In this step as per OAuth protocol, the code received by the client in the step will be exchanged to get the access_token which is used for accessing the Xoxoday storefront granted based on the scopes allowed by the user.
The client server (As this request involves sensitive information i.e, client_secret) must make the following POST request to get the access_token.
Parameters
Upon Expiry the access token can be regenrated using the response token using the following request:
Parameters
Body Parameters
Parameters
Description
grant_type*
Although Oauth supports different grant_type values. The values supported by Xoxoday is authorization_code, refresh_token.
client_id*
client_secret*
refresh_token*
The value with which client can regenerate expired access_token. This refresh token for the user session lasts for 30 days and refresh token for company session lasts for 60 days.
For verifying at any point in the app if the token is valid/not, call below endpoint.
The token_type can be two values. They are company or user. If the request in the
step was for the company session creation then token_type value is the company or if the request in the step was for user session creation then token_type value is the user.
Authorization codes expires in 5 mins after creation. This is the temporary code value which client has obtained after
.
This is the client_id value that one receives upon registration in
step.
The URL must match what you have shared during the time of
.
This is the client_secret value that one receives upon registration in
step.
This is the client_id value that one receives upon registration in
step.
This is the client_secret value that one receives upon registration in
step.
While the expiry is 30 days for the access_token and 60 days for the refresh_token, Xoxoday recommends polling the API on every 4xx error to ensure no downtime in case of a token invalidation before the 30-day expiry.