DocuSign: Generate Token
Reference link:
Generate Refresh Token
-
Go to https://admindemo.docusign.com/apps-and-keys, and sign-in to your DocuSign account.
-
Click ADD APP AND INTEGRATION KEY. The Add Integration Key dialog appears.
-
In the Add Integration Key dialog enter the App Name, and click CREATE APP.
-
Save the Integration Key copy with you.
-
Click ADD SECRET KEY to get secret key.
-
Copy and save the Secret Key with you.
-
Click ADD URI to add Redirect URI.
-
Add your URI, for example, https://www.example.com/callback, and click SAVE. All details are saved.
-
Open browser and search the URL after replacing it with your app’s Integration key and Redirect URI. https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature&client_id=YOUR_APP_INTEGRATION_KEY&redirect_uri=YOUR_APP_REDIRECT_URI
Note:After entering the URL on the browser you may need to verify yourself by giving your DocuSign Credentials.
-
After you verify the details, a callback code is generated in the URL itself. Copy the Callback URL Code, and save it with you.
Note:The Callback URL Code expires in two minutes. You can regenerate it by calling the same URL in the browser.
-
Go to Postman to generate a refresh token.
-
In the POST page replace the VALUE for the following KEYs:
{{codeFromUrl}} with Callback URL Code.
{{encodedKeys}} with integration key and secret key, concatenated by a colon character as (Integartion Key:Secret Key), converted into base64.Make the following request to generate the Refresh Token:
**POST:**
https://account-d.docusign.com/oauth/token
**Headers:**
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {{encodedKeys}}
**Body: x-www-form-urlencoded** (key value pair)
code= {{codeFromUrl}}
grant_type= authorization_codeYou will get Refresh Token under tag ‘refresh_token’ in JSON response.
Notes:-
Callback URL Code expires two minutes. Therefore, if you get an ‘expired_client_token’ error after running Postman call, then regenerate ‘Callback URI Code’, and run the same Postman call again using the new Callback URI.
-
The lifetime of a refresh token (typically around 30 days) can vary depending on business needs and is subject to change at any time.
-