Skip to main content

We are trying to reach the docusign admin Apis, using authorization code grant for authentication. We are getting the below responses for both Get and post user .

Please help me understand where is this going wrong.

Below are the steps I am following 

  1. Get Authorization Code using https://account-d.docusign.com/oauth/token
  2. https://account-d.docusign.com/v2/organizations/OrganizationID/users?Authorization=Bearertoken

 

Response code 200,

<!DOCTYPE html>

 

<html lang="en" class="account-server">

<head>

    <meta charset="utf-8">

    <meta name="viewport" content="initial-scale=1.0">

    <title>Docusign</title>

        <link rel="icon" href="https://docucdn-a.akamaihd.net/olive/images/2.64.0/global-assets/ds-icons-favicon-default-64x64.svg" type="image/svg+xml">

    <link rel="canonical" href="https://account-d.docusign.com/" />

    <base href="/">

 

    <script type="text/javascript" nonce="WZtc7MttxuYURuw2RQY0y6bwija69tP4ZmORK1dq3Lg=">

             window.__KAZMON_CONFIG__ = {

                 buildVersion: "25.3.100.28476",

                 environment: "DEMO",

                 instrumentationKey: "88d193ed-7206-4e34-975a-193a4fd08e36"

             };


 

        window.__NEW_ROOT_API__ = "True";

        var FixtureHelper = {};

    </script>

 

    <!-- 25.3.100.28476 SE102DFE19 fe03e917-6e11-4c2c-8184-b9cdaaea77eb -->

</head>

<body class="site-content">

    <noscript>You need to enable JavaScript to run this app.</noscript>

 

    <div id="root"></div>

 

    <form name="fixtureForm">

            <input id="fixtureInput" type="hidden" value="{&quot;settings&amp;quot;:{&amp;quot;traceToken&amp;quot;:&amp;quot;fe03e917-6e11-4c2c-8184-b9cdaaea77eb&amp;quot;,&amp;quot;siteRoot&amp;quot;:&amp;quot;https://account-d.docusign.com/&amp;quot;,&amp;quot;forgotPasswordUri&amp;quot;:&amp;quot;https://account-d.docusign.com/forgotpassword&amp;quot;,&amp;quot;flowSubmissionUris&amp;quot;:{&amp;quot;oAuth&amp;quot;:&amp;quot;/oauth/auth&amp;quot;,&amp;quot;sso&amp;quot;:&amp;quot;/saml2/login/sp&amp;quot;,&amp;quot;username&amp;quot;:&amp;quot;/username&amp;quot;,&amp;quot;password&amp;quot;:&amp;quot;/password&amp;quot;,&amp;quot;web&amp;quot;:&amp;quot;/web/login&amp;quot;,&amp;quot;signUp&amp;quot;:&amp;quot;/signup&amp;quot;,&amp;quot;securityKeyLogin&amp;quot;:&amp;quot;/securitykeylogin&amp;quot;,&amp;quot;resourceCredentialSecurityKeyCreation&amp;quot;:&amp;quot;/resources/v1/manage/security-key/create&amp;quot;,&amp;quot;resourceCredentialSecurityKeyLogin&amp;quot;:&amp;quot;/resources/v1/manage/security-key/login&amp;quot;},&amp;quot;allowGetBrowserFingerprint&amp;quot;:true,&amp;quot;renderInkLoginApp&amp;quot;:true,&amp;quot;assetPreloaderUrl&amp;quot;:null,&amp;quot;pseudoLocalizationEnabled&amp;quot;:false,&amp;quot;rebrandingEnabled&amp;quot;:true},&amp;quot;stateData&amp;quot;:{&amp;quot;state&amp;quot;:&amp;quot;username&amp;quot;,&amp;quot;oAuthLoginHintQS&amp;quot;:null,&amp;quot;oAuthLoginHintCookie&amp;quot;:null,&amp;quot;usernamePostAction&amp;quot;:null,&amp;quot;logoBytes&amp;quot;:null,&amp;quot;data&amp;quot;:null},&amp;quot;error&amp;quot;:null}" />

        <input name="__RequestVerificationToken" type="hidden" value="AWjBmLBpUqpxyVEVTCuwWgIAAAAA0" />

    </form>

</body>

<script src="/ReactApp/src/vendor/html-domparser.js"></script>

<script src="/ReactApp/dist/bundle.js?version=25.3.100.28476"></script>

 

</html>

 

 

Hello BettyJ,
You're getting a 200 OK response with an HTML document, which indicates a successful HTTP request, but not the expected API response. The HTML content suggests you're being redirected to the DocuSign login page, not the API endpoint. This is a common issue when the API request is malformed, specifically with how the authorization token is passed.

The root of the problem is in your request header, not in the URL. Here's what's going wrong and how to fix it:
Incorrect Authorization Header Format: You're including the authorization token as a URL query parameter (?Authorization=Bearer token). This is incorrect for most REST APIs, including DocuSign's. The authorization token should be passed as an HTTP header.

Fix: Instead of adding ?Authorization=Bearer token to the end of your URL, you need to set a request header with the key Authorization and the value Bearer ryour_access_token].

Ensure the OrganizationID in your URL is correct. You can find this in your DocuSign Admin account.

Incorrect Base URL: Make sure you're using the correct base URL for the DocuSign Admin API. The correct URL for the demo environment is https://demo.docusign.net/restapi/v2/organizations/:organizationId/users

The URL you provided https://account-d.docusign.com/v2/organizations/ is for the DocuSign account management portal, which handles things like logins, not API calls. This is the primary reason you're being served an HTML login page.

reference:https://developers.docusign.com/docs/admin-api/reference/usermanagement/users/getusers/

 

Thank you so much and if you need any help you can raise a support case anytime at https://support.docusign.com 

 


Reply