Aquib
Aquib

Reputation: 23

INVALID_USERID when calling Docusign API from live environment

I am getting below error when calling Docusign API from a C# web api. Able to get the access token but when creating the envelope this error is being received.

Is there any issue with clientUserId because it worked without any hiccups in sandbox. What value do I need to pass in it ? From all the sources, I gather it just indicates that this request is an embedded one. If we have to pass a specific userId in this field how to get it when passing it for envelope creation.

Response:

{
    "errorCode": "INVALID_USERID",
    "message": "Invalid UserId."
}

Below is the request which we are passing

{
    "documents": [
        {
            "documentId": "1",
            "fileExtension": "pdf",
            "name": "Trial - OL.pdf"
        }
    ],
    "emailSubject": "Docusign Digital Signature",
    "recipients": {
        "signers": [
            {
                "clientUserId": "1001",
                "email": "XXXX",
                "name": "XXXX",
                "recipientId": "1",
                "routingOrder": "1",
                "tabs": {
                    "signHereTabs": [
                        {
                            "anchorIgnoreIfNotPresent": "false",
                            "anchorString": "XXXX",
                            "anchorUnits": "inches",
                            "anchorXOffset": "0",
                            "anchorYOffset": "-0.25"
                        }
                    ]
                }
            }
        ]
    },
    "status": "sent"
}

There is no error while retreiving access token

Upvotes: 1

Views: 438

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14050

The error is not about clientUser but about the userId of the user. After you finished Go-Live, the account is different, the user is different, and the URLs for the environments are all different when you migrate from the developer sandbox to the production environment. If you got a token using JWT, remember that one of the things you used was the userId of the impersonated users. You cannot use the token generator tokens in production. Production environment doesn't have a single URL like demo.docusign.net. It can be many different URLs and you have to first figure out what it is before making API calls.

Upvotes: 1

Related Questions