Ehsan
Ehsan

Reputation: 1

Docusign API "INVALID_REQUEST_PARAMETER"

I have a problem with the DocuSign API premium plan. The first signer can sign the contract which we are generating via API without any problem, but when it comes to the second signer, in the same envelope ID we receive this error:

docusign_esign.client.api_exception.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Cache-Control': 'no-cache', 'Content-Length': '155', 'Content-Type': 'application/json; charset=utf-8', 'X-DocuSign-TraceToken': '6fd068b4-9f2d-41a7-bd01-351e2676f438', 'Date': 'Tue, 15 Jun 2021 08:50:45 GMT', 'Set-Cookie': 'BIGipServerpool_SE2_NA4_API=!JACGQDicHt+h1TK0bOlB09wl7Vsgf/x6uU4IHjwxIL8hJpHlxDwjr2QgIA/ku3g50UYGhRu67eFbSA==; path=/; Httponly; Secure'})
HTTP response body: b'{"errorCode":"INVALID_REQUEST_PARAMETER","message":"The request contained at least one invalid parameter. A value was not found for parameter \'userName\'."}'

Any help?

P.S we are using:

python 3.x - docusign-esign 3.10.0 SDK

Upvotes: 0

Views: 1980

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14050

Your app/integration is making a call to get a recipient view, something like this:

POST /restapi/v2.1/accounts/4e268385-xxxx-xxxx-xxxx-2ada7dc696fd/envelopes/ca166b41-xxxx-xxxx-xxxx-c3bcfa2d0639/views/recipient

This is used for embedded signing, to get back a URL to sign by your app. You must provide a userName to this call in the body of the call/JSON, but you're using the Python SDK so the code looks like this:

# 3. Create the Recipient View request object
recipient_view_request = RecipientViewRequest(
    authentication_method=authentication_method,
    client_user_id=envelope_args["signer_client_id"],
    recipient_id="1",
    return_url=envelope_args["ds_return_url"],
    user_name=envelope_args["signer_name"],
    email=envelope_args["signer_email"]
)

Upvotes: 0

Related Questions