Skip to main content
Question

DocuSign Admin API Unauthorize error

  • February 15, 2025
  • 0 replies
  • 13 views

Forum|alt.badge.img
I am trying to call DocuSign Export API's and getting error "Unauthorized"
 
below see below details for more :
 
Code : (Azure Function C#) 
string url = $"https://api.docusign.net/Management/v2/organizations/ORGID/exports/user_list";
   _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

   var requestBody = new StringContent("{\"type\": \"organization_user_list_export\"}", Encoding.UTF8, "application/json");
   var response = await _httpClient.PostAsync(url, requestBody);

   if (response.IsSuccessStatusCode)
 

I'm trying to export all users list using DocuSign admin API, however I have provide the required consent but still getting "Unauthorized error"

Below is the code (Azure Function C#) that i am using:

string url = $"https://api.docusign.net/Management/v2/organizations/ORGID/exports/user_list";
   _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

   var requestBody = new StringContent("{\"type\": \"organization_user_list_export\"}", Encoding.UTF8, "application/json");
   var response = await _httpClient.PostAsync(url, requestBody);

   if (response.IsSuccessStatusCode)

Error: {StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:{ Cache-Control: no-cache Pragma: no-cache X-DocuSign-TraceToken: XXXXXXXXXXXXXXXX602 X-DocuSign-Node: SE101FE98 Date: Sat, 15 Feb 2025 20:15:28 GMT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/json; charset=utf-8 Expires: -1 Content-Length: 87}}

CONSENT URL USED https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation%20organization_read%20group_read%20permission_read%20user_read%20user_write%20domain_read%20identity_provider_read&client_id=xxxxxxxx&redirect_uri=http://localhost:7060/api/ExportDocuSignUsers

0 replies

Be the first to reply!