getting bad request error { "error": "invalid_grant" }It shows something like these one click of the send button shows access and refresh token i want these

- 3,188
- 3
- 20
- 37
-
Hard to answer without more information. Are you doing this from postman? do you have any code written? what are you doing exactly, share your code, explain step by step. Very hard to answer without more information. – Inbar Gazit Mar 04 '23 at 05:34
1 Answers
If you are using Auth Code Grant with Postman, you'll need the following
- Integration Key (ClientId)
- Secret Key (clientSecret)
- redirectURI
These must be configured on the App and Keys page correctly
Then there are two calls you need to make, one is done via a web browser where you need to log in to DocuSign (unless already logged on) and where you will provide consent.
That first call gives you a token, which you exchange for an access token in the second call, which is this one:
POST https://account-d.docusign.com/oauth/token?code={Code}&grant_type=authorization_code
Note the code you got in the browser must be here in the request
One of the headers for this call is called "Authorization" and should have the word "Basic " and then the two values (IK and Secret) encoded together:
For example, if your integration key is 7c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f and the secret key is d7014634-xxxx-xxxx-xxxx-6842b7aa8861 you can get the base64 value in a JavaScript console with the following method call:
btoa('7c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f:d7014634-xxxx-xxxx-xxxx-6842b7aa8861')

- 12,566
- 1
- 16
- 23