I am following the tutorial from this page: How to get an access token with Implicit Grant | Docusign
I have an href to the following URL: https://account-d.docusign.com/oauth/auth?response_type=code&scope=impersonation%20signature%20organization_read%20user_read%20account_read%20dtr.profile.read&client_id=#redacted#&redirect_uri=https://localhost:7054/dsauth
When I follow this href I am directed to log in and grant permission. I am successfully redirected back to https://localhost:7054/dsauth. I capture the token from the “code” query parameter.
When I try to use that token in the header to list users, I receive 401 unauthorized. I can’t find any documentation to help resolve the problem, and as far as I can tell I’m following the example perfectly.
I am using C# and RestSharp to make the calls. Following is the relevant code:
async void GetUsers()
{
var client = new RestClient("https://account-d.docusign.com/oauth/userinfo");
var request = new RestRequest();
request.Method = Method.Get;
request.AddHeader("Authorization", $"Bearer {AccessToken}");
var response = await client.ExecuteAsync(request);
if (response.IsSuccessful)
{
// Handle successful response
result = response.Content;
}
else
{
// Handle error response
result = response.ErrorMessage;
}
}
I’m frustrated and out of ideas. Any help is appreciated. Even just a link to relevant documentation. I’ve tried adding any scope even remotely relevant, and it’s not changing anything. I can’t see any options in my App Registration screen that seems relevant.