Skip to main content

I have successfully created a request for a signature as remote signing using a document created on the fly with htmldefinition. What we’d really like to do is convert this to an embedded signature, so taking that same code which successfully returns an envelope id, I move on to the next endpoint: /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient - substituting the accountId as I did for the initial request to create the envelope, and the envelopeId returned upon successful creation. I include body args:

{

    "returnUrl": "https://myreturnurl",

    "authenticationMethod": "none",

    "email": "emailIncludedInOriginalRequestAsRecipient",

    "userName": "RecipientNameIncludedInOriginalRequest",

    "clientUserId": 1000,

}

In response I receive: 

{

"errorCode": "INVALID_REQUEST_PARAMETER",

"message": "The request contained at least one invalid parameter. A value was not found for parameter 'userName'."

}

Does this system not work with documents created on the fly with an htmldefinition? 

Also, in your self-paced University under Embedded Signature Standard View, the link to https://myuni.sampleapps.docusign.com/requestExtracurricularActivity leads to a 502 bad gateway error. 

Hi,

This should work correctly, in your example, clientUserId is an integer, but it should be a string.

For example:

Create Envelope Request (Omitted Data for readability)

{
"status": "sent",
"emailSubject": "Test Email",
"recipients": {
"signers": [
{
"email": "troyw@gmail.com",
"name": "Troy W",
"recipientId": "1",
"clientUserId": "123"
}
]
},
"documents": [
{
"documentId": "1",
"name": "contract.pdf",
"documentBase64": "XXXX",
"transformPdfFields": true,
"assignTabsToRecipientId": "1"
}
]
}


CreateRecipientView Request

{
"email": "troyw@gmail.com",
"clientUserId": "123",
"userName": "Troy W",
"authenticationMethod": "none",
"returnUrl": "https://www.google.com.au/test"
}

CreateRecipientView Response

{
"url": "https://demo.docusign.net/Signing/MTRedeem/v1/2a052a6d-39db-458c-bef5-5f082b7098a5?slt=xxxx"
}

 


Okay, there is another error in the documentation showing clientUserId as an integer. These are the instructions I had been following:

 


Okay, there is another error in the documentation showing clientUserId as an integer. These are the instructions I had been following:

 

 

Thank you for passing that information on, I will ensure that is updated.

The API reference pages are a great source of truth: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/createrecipient/

 

If you scroll down to the schema, you will be able to see in more detail the properties, types and description:
 

clientUserId

string

A sender-created value. If provided, the recipient is treated as an embedded (captive) recipient or signer.

Use your application's client ID (user ID) for the recipient. Doing so enables the details of your application's authentication of the recipient to be connected to the recipient's signature if the signature is disputed or repudiated.

Maximum length: 100 characters.

 


I got that to work but am struggling with the imbedding because of the framesAncestor. I made sure that domain is in the redirect uri and original url. Do you know how I might be able to fix that? 

Thanks. I really appreciate the help. 


Are you implementing Focused View or classic signing?

This shows the difference between the two workflows: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/embedding/embedded-signing/

 

If you are implementing Focused View for embedded signing, the documentation and guide is available here: https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-focused-view/

  • Set the return URL to which the user will be forwarded after signing is complete.
  • Add the recipient information to the view, including the signer's emailname, and clientUserID that were set for the recipient who will sign the envelope.
  • Set the messageOrigins field to https://apps-d.docusign.com for developer environments or https://apps.docusign.com for production environments.
  • Add the frameAncestors field. Include the domain where the envelope will be embedded and the same URL as messageOrigins.

Here is a great article walking through the steps https://www.docusign.com/blog/developers/15-minutes-to-better-ux-enhancing-embedded-signing-focused-view

Example

{
"returnUrl": "http://my.return.url.here.com",
"authenticationMethod": "none",
"email": "troyw@gmail.com",
"userName": "Troy W",
"clientUserId": "123",
"frameAncestors": f"https://my.site.com", "https://apps-d.docusign.com"],
"messageOrigins": m"https://apps-d.docusign.com"]
}

 


Okay, thanks. I’m using focused view, but hadn’t previously seen that I needed to set the messageOrigins and frameAncestors to include https://apps-d-docusign.com


That WORKS! So happy! Thank you!


Reply