Docusign嵌入式签名 [英] Docusign Embedded Signing

查看:271
本文介绍了Docusign嵌入式签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 docusign 来使人们签署在我们网站上注册的同意书,而我被指向嵌入式签名API。

We are using docusign for people to sign consent forms that register on our web site and I was pointed to the Embedded Signing API.

据我了解,我必须创建一个已经完成的信封。

From what I understood, I had to create an envelope which I have done.

我正在使用.Net示例。

I am using the .Net examples for this.

通过API正常登录,但我得到了尝试从API取回URL时发生以下错误:

Login through the API fine, but I get the following error trying to get the URL back from the API:

ENVELOPE_IS_INCOMPLETE The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line.

这是我的信封定义xml:

Here is my envelopeDefinition xml:

 string requestBody = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
            "<accountId>" + accountId + "</accountId>" +
            "<status>sent</status>" +
            "<emailSubject>API Call for Embedded Sending</emailSubject>" +
            "<emailBlurb>This comes from C#</emailBlurb>" +
            "<templateId>[TEMPLATE ID FROM DOCUSIGN]</templateId>" +
            "<templateRoles>" +
            "<email>testregister@notrealurl.com</email>" +  // NOTE: Use different email address if username provided in non-email format!
            "<name>testregister@notrealurl.com</name>" + // username can be in email format or an actual ID string
            "<roleName>Signer</roleName>" +
            "</templateRoles>" +
            "</envelopeDefinition>";

我在这里看到了另一则有关需要clientUserId的帖子:

I saw another posting about needing a clientUserId here:

http://community.docusign.com/t5/DocuSign-API-Integration-NET/REST-API-net-Error-message-when-en-envelope -from-a / mp / 18121#M1791

但是我不确定如何在envelopeDefinition中实现。

But I am not sure how to implement in the envelopeDefinition.

请帮助!

推荐答案

要使用嵌入功能,您确实需要设置 clientUserId 属性,用于将使用URL令牌访问信封的每个收件人。诀窍是,在创建信封时,需要为收件人设置clientUserId属性,然后在请求URL令牌时,需要将其连同其电子邮件,名称和收件人ID一起包括在请求中。

To use Embedding functionality you do indeed need to set the clientUserId property for each recipient who will access the envelope using a URL token. The trick is that when you create the envelope you need to set the clientUserId property for the recipient, then when you are requesting the URL token you need to include it in the request, along with their email, name, and recipientId.

DocuSign的开发人员中心有一个专门用于嵌入的整页,它讨论了clientUserId属性的使用。请在此处查看:

DocuSign's Developer Center has a whole page dedicated to Embedding, and it discusses the use of the clientUserId property. Please see here:

http://www.docusign.com/developer-center/explore/features/embedding-docusign

他们的API演练也是一个很好的资源。他们有6种语言的代码,向您展示如何完成常见的DocuSign任务。查看嵌入功能的底部三个:

Their API Walkthroughs are also a great resource. They have code in 6 languages showing you how to accomplish common DocuSign tasks. Look at the bottom three for Embedding functionality:

http:/ /iodocs.docusign.com/APIWalkthroughs

[更新]
好​​,我能够重现您的问题并更新了要解决的要领。如果您照原样复制并输入凭据,它现在应该可以正常工作,但基本上,请求正文中缺少两部分。这是它的外观,请注意额外的templateRole(单数)标记和clientUserId标记:

[Update] Ok, I was able to reproduce your issue and have updated the gist that you were working off of. It should work now if you copy as is and enter your credentials, but basically there were two parts missing from the request body. Here is what it should look like, note the extra templateRole (singular) tag and the clientUserId tag:

string requestBody = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" + 
                "<accountId>" + accountId + "</accountId>" + 
                    "<status>sent</status>" + 
                    "<emailSubject>API Call for Embedded Sending</emailSubject>" + 
                    "<emailBlurb>This comes from C#</emailBlurb>" + 
                    "<templateId>" + templateId + "</templateId>" + 
                    "<templateRoles>" + 
                    "<templateRole>" + 
                    "<email>" + username + "</email>" + // NOTE: Use different email address if username provided in non-email format!
                    "<name>Name</name>" +               // username can be in email format or an actual ID string
                    "<roleName>" + roleName + "</roleName>" +
                    "<clientUserId>1</clientUserId>" +
                    "</templateRole>" + 
                    "</templateRoles>" + 
                    "</envelopeDefinition>";

这篇关于Docusign嵌入式签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆