Loading...

Step 3: Generate Access Token and Refresh Token

Request Execution

After you obtain the Grant Token, send a POST request to the following URL with the params given below to generate the access_token:

https://accounts.zoho.com/oauth/v2/token?

Note: You must access the respective domains for the other data centers:

  • EU: https://accounts.zoho.eu/
  • AU: https://accounts.zoho.au/
  • IN: https://accounts.zoho.in/
  • CA: https://accounts.zohocloud.ca/
  • JP: https://accounts.zohocloud.jp/
  • SA: https://accounts.zohocloud.sa/

Parameter Description
code* The Grant Token or the value of code obtained in the previous step.
client_id* The Client ID that was generated during the client registration
client_secret* The Client Secret that was generated during the client registration
grant_type* authorization_code (Provide this literal string as the value)
redirect_uri One of the Authorized Redirect URIs you provided while registering the client in the previous step. You must not provide an unregistered redirect URI.
scope The scope the access_token is to be generated for. You can provide multiple scopes by separating them using commas.
You can check the list of scopes available in Catalyst from [this section](/en/api/oauth2/scopes/).
state An opaque string that is round-tripped in the protocol. In other words, whatever value you provide here will be passed back to you.

Note:

  • Fields marked with * are mandatory.
  • You can pass the parameters in the body of your request as form-data, for increased security.
  • The access_token will expire after the time period (in seconds) mentioned in the expires_in parameter.
  • However, the refresh_token is permanent and can be used to regenerate a new access_token if the current one expires.
  • You can use the domain specified in api_domain in your requests to make API calls to Catalyst.
  • The “Bearer” value in the token_type indicates this is an access_token.

This completes the authentication process. Once you obtain the access_token for your application, you can use it in the authorization header of your HTTP requests to access Catalyst APIs. You can refer to the Request Format section for an example.

Note: Each time a re-consent page is accepted, a new refresh_token is generated. You can generate a maximum of 20 refresh tokens per user, and 5 refresh tokens in a minute. If this limit is crossed, the first refresh_token is automatically deleted to accommodate the latest one. This is done irrespective of whether the first one is in use or not.

Sample Response
copy
{
    "access_token": "{access_token}",
    "refresh_token": "{refresh_token}",
    "api_domain": "https://www.zohoapis.com",
    "token_type": "Bearer",
    "expires_in": 3600
}