Generate Access Token
Table of Contents
Create Self Client
- Go to https://api-console.zoho.com. Click GET STARTED.
- Client Types will be displayed. Click CREATE NOW against Self Client.
- Click CREATE.
- Click OK on the confirmation pop-up.
- The Client ID and Client Secret are readily generated as soon as the Self Client is created.
- The Client ID and Client Secret can be copied using the icons against the respective entities.
Generate code
- Click Generate Code. Type the Scope as "zohobookings.data.CREATE", choose a duration, provide a description and click CREATE.
- The Code is generated for the corresponding Scope.
- The Code can be copied by clicking COPY.
- The parameters required for generating the Access Token can be generated as a JSON file also.
Click DOWNLOAD on the pop-up that appears. The params are downloaded by default as "self_client.json" which can be used to initiate the request later on.
Request URL
https://accounts.zoho.com/oauth/v2/token
Request Method
POST
Parameters
Parameters to be passed in the request body as form-data along with the request URL are,
Parameter Name | Description |
---|---|
client_id * | The Client ID that is generated on creating the self-client. |
client_secret * | The Client Secret that is generated on creating the self-client. |
grant_type * | authorization_code |
redirect_uri * | https://deluge.zoho.com/delugeauth/callback |
code * | The code that is generated for the client for a given OAuth scope (say zohobookings.data.CREATE) |
Note: fields marked * are mandatory.
Response Type
JSON
API Limits
Zoho Bookings Plan/Edition | Number of API calls/day |
Free | 250/per user |
Basic | 1000/per user |
Premium | 3000/per user |
Zoho One | 3000/per user |
Note: The API limits are excluding the authorization requests. API counts are calculated between 00:00 and 23:59 hours in the respective time zones.
Sample Request
Copiedcurl --location --request 'https://accounts.zoho.com/oauth/v2/token' \
--form 'client_id=1000.3FOH1GTXXXXXXXXXXXXXKZ4YY7XJ3GH' \
--form 'grant_type=authorization_code' \
--form 'client_secret=d8ac6ceb5bXXXXXXXXXXXXXXXXXX68c84dcc3e5a3e' \
--form 'redirect_uri=https://deluge.zoho.com/delugeauth/callback' \
--form 'code=1000.981b7845045XXXXXXXXXXXXXXXXXX48e.d92796c8454fa00a8296178c944515f3'
Sample Response
Copied{
"access_token":"1000.7b3610d1XXXXXXXXXXXXXXXX087cc3.6282226f615637c467bee7209ce1c0a1",
"refresh_token":"1000.a24d5e6dXXXXXXXXXXXXXXXX3eeb1.0df8a58d58dae3efcd6f0c15c4e88999",
"api_domain":"https://www.zohoapis.com",
"token_type":"Bearer",
"expires_in":3600
}