Saul
Saul

Reputation: 93

I'm using Docusign RestApi 2.1 oAuth and getting 401 without any information on requests

I've been following the instructions here to set up oAuth 2.0 using code grant. I have the user's token, base_uri, and account_id from the call to /userinfo

When I try to make any calls to the API, though, I'm getting a return status of 401 with no information in the body, so I have no clues as to what's wrong.

The token is still valid, I have triple-checked that. What else can be done?

I first saw it trying to void an envelope. Then I tried to get brands as in the link and as in this example. They both exhibit the same 401 behavior.

curl --location --request GET 'https://demo.docusign.net/restapi/v2.1/accounts/<account>/brands' \
--header 'Authorization: Bearer <token>'

RESOLVED: I discovered what the issue was. The initial token was not retrieved with the correct scopes (signature%20impersonation). Once those were granted, the functionality worked.

Upvotes: 0

Views: 327

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14015

As this article mentions you need to ensure you request the correct scopes.

Note: for Auth Code Grant, you do not need impersonation, this is only required for JWT. You do need signature scope though in both cases.

Upvotes: 1

Related Questions