Token URL
This element contains the grant token and generates the access token to access your resource.
Possible Locations
Overview
- Description
- Operation required
Attributes
Name | Type | Description |
---|---|---|
path required |
String | URL path |
Samples
OAuth2
Assume that we have used <oauth2> authentication for the trips resource. Following is a sample of refresh URL, which will be used to generate access token.
copy<token-url path="https://accounts.travel_bureau.com/oauth/v2/token"> <operation method="post" name="Generate Access Token and Refresh Token" category="action"> <description>OAuth2.0 requests are usually authenticated with an access token, which is passed as bearer token. To use this access token, you need to construct a normal HTTP request and include it in an Authorization header along with the value of Bearer.</description> <argument name="grant_type" location="param"> <description>Enter the value as "authorization_code".</description> <content> <encode type="text/plain" /> <structure> <property type="string" values="authorization_code"/> </structure> </content> </argument> <argument name="client_id" location="param"> <description>Specify client-id obtained from the connected app.</description> <content> <encode type="text/plain" /> <structure> <property type="string"/> </structure> </content> </argument> <argument name="client_secret" location="param"> <description>Specify client-secret obtained from the connected app.</description> <content> <encode type="text/plain" /> <structure> <property type="string"/> </structure> </content> </argument> <argument name="code" location="param"> <description>Enter access_type as online or offline.</description> <content> <encode type="text/plain" /> <structure> <property type="string" values="offline,online"> <description>Enter the grant token generated from previous step.</description> </property> </structure> </content> </argument> <argument name="redirect_uri" location="param"> <description>Specify the Callback URL that you registered during the app registration.</description> <content> <encode type="text/plain" /> <structure> <property type="string"/> </structure> </content> </argument> <response status="200"> <content> <encode type="application/json" /> <structure> <property name="access_token" type="string"> <description>Access token to access ZohoCRM APIs</description> </property> <property name="refresh_token" type="string"> <description>Refresh token to obtain new access tokens</description> </property> <property name="expires_in" type="integer" values="3600"> <description>Time in seconds after which the access token expires</description> </property> <property name="api_domain" type="string"> <description>Domain name of the API. Use this domain in your requests to make API calls to Zoho CRM.</description> </property> <property name="token_type" type="string" values="Bearer"> <description>Type of token obtained. "Bearer" indicates this is an access token.</description> </property> </structure> </content> </response> </operation> </token-url>
Token
In the travelers resource, we have used the <token> for authentication. So, add the following token URL to the authentication schema.
copy<token-url path="https://authorization-server.com/token"> <operation method="post" name="GenerateToken" category="action"> <request-body> <content> <encode type="application/json" /> <structure> <property name="client_id" type="string"/> <property name="client_secret" type="string"/> <property name="code" type="string"/> </structure> </content> </request-body> <response status="200"> <content> <encode type="application/json" /> <structure name="TokenResponse"> <property name="token" type="string"/> <property name="api_domain" type="string"/> <property name="expires_in" type="datetime"/> </structure> </content> </response> </operation> </token-url>
Last Updated 2025-05-30 16:54:59 +0530 +0530
Yes
No
Send your feedback to us
Skip
Submit