Getting userid based on email using DocuSign REST API

docusignapi

Solution

To retrieve a User Id based on an email address, you can use this DocuSign REST API operation:

GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/users?email=johnDoe@example.com

If a match is found, the response will look like this:

{
    "users": [
        {
            "userName": "John Doe",
            "userId": "ah266e12-83a6-487c-a42b-ebad10e4cc6a",
            "userType": "CompanyUser",
            "userStatus": "active",
            "uri": "/users/ah266e12-83a6-487c-a42b-ebad10e4cc6a"
        }
    ]
}

Note: This isn't very well-documented -- the only place I see it mentioned in the REST API guide is in the Appendix that lists the REST API methods that correspond to various SOAP API operations. i.e., it says that if you were using the SOAP API operation CheckAccountMember, the REST API equivalent is https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/users?email=<email>.

Problem

I was looking into the api documentation but could not find an easy way to get a userID based on an email address, is this possible? Here is what I am trying to do. - Get user id based on email address - Get list of groups that the user belongs to using /accounts/{accountId}/users/{userId} - Get the list of brands that those groups have using /accounts/{accountId}/groups/{groupId}/brands Doing the above because I need to do a send of behalf of user and need to give the branding options for that user.

Original source