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}}