Search code examples
c#docusignapidocusign-sdk

DocuSign Recipient View gives URL to a signing session without host (In Person SIgning)


I am trying to create an In Person Signing session.

Following this example from the documentation, I am getting a URL from CreateRecipientView, that navigates me to a signing session, but without the prompt of a host or anything. It's the same behavior I get when I request a signature through e-mail, but there I don't need In Person Signing, so it's not an issue.

One difference between the example and my case is that I have to use a template instead, so I was trying to make TemplateRoles work instead in the EnvelopeDefinition.

Here is how my envelope definition and RecipientView is defined:

return new EnvelopeDefinition()
{
    TemplateId = templateId,
    EmailSubject = subject,
    Status = "Sent",

    TemplateRoles = new List<TemplateRole>
    {
        new TemplateRole()
        {
            Name = inPersonSignerHostName,
            Email = inPersonSignerHostEmail,
            InPersonSignerName = recipientName,
            ClientUserId = _authSettings.UserId,
            RoleName = "Customer",
            Tabs = SetTabValues(
                textTabs: recipientTextTabs
            )
        }
    }
};
RecipientViewRequest recipientViewRequest = new RecipientViewRequest()
{
    ReturnUrl = _authSettings.InPersonSignerReturnURL,
    AuthenticationMethod = "none",
    UserName = inPersonSignerHostName,
    Email = inPersonSignerHostEmail,
    ClientUserId = _authSettings.UserId
};

From what I have found, the Email and Name properties of the TemplateRole refer to the host's email and name in case of In Person Signing, and they have to match the recipient view's UserName and Email properties for it to work.

It is still not working, so I must be missing something. How do I get an actual In Person Signing session instead of a remote one? Currently the result looks exactly like a remote session I send by email.

Update:

As per Inbar Gazit's suggestion, I tested it without a template with the following Envelope definition, and I got the hosting request screen just fine.

return new EnvelopeDefinition()
            {
                //TemplateId = templateId,
                EmailSubject = subject,
                Status = "Sent",

                Documents = new List<Document>
                {
                    new Document
                    {
                        DocumentBase64 = "Base64 encoded document here",
                        Name = "Lorem Ipsum",
                        FileExtension = "pdf",
                        DocumentId = "1"
                    }
                },

                Recipients = new Recipients
                {
                    InPersonSigners = new List<InPersonSigner>
                    {
                        new InPersonSigner
                        {
                            HostName = inPersonSignerHostName,
                            Email = inPersonSignerHostEmail,
                            SignerName = recipientName,
                            RecipientId = "1",
                            RoutingOrder = "1",
                            Tabs = new Tabs {
                                SignHereTabs = new List<SignHere>
                                {
                                    new SignHere
                                    {
                                        AnchorString = "/sn1/",
                                        AnchorUnits = "pixels",
                                        AnchorXOffset = "20",
                                        AnchorYOffset = "10"
                                    }
                                }
                            },
                            ClientUserId = _authSettings.UserId,
                            RoleName = "Customer"
                        }
                    }
                }

                /*
                TemplateRoles = new List<TemplateRole>
                {
                    new TemplateRole()
                    {
                        Name = inPersonSignerHostName,
                        Email = inPersonSignerHostEmail,
                        InPersonSignerName = recipientName,
                        ClientUserId = _authSettings.UserId,
                        RoleName = "Customer",
                        Tabs = SetTabValues(
                            textTabs: recipientTextTabs
                        )
                    }
                }
                */
            };

For the document I used the PDF sample mentioned in the documentation, encoded to Base64. For tabs I used the ones from the documentation as well. The question then becomes, how do I make it work with templates?


Solution

  • I just tried it and it worked just fine.

    Two things to confirm - the roleName must be identical to what is set in the template for the in-person signer.

    Try to remove the Tabs element, try to remove the clientUserId element. These are just for testing to isolate any issues.