获取收件人视图不适用于复合信封

时间:2014-08-14 19:52:05

标签: docusignapi

我想创建一个复合信封,然后进行嵌入式签名。问题是信封已创建,但获取网址的调用失败。

首先我创建复合包络:

https://demo.docusign.net/restapi/v2/accounts/ACCOUNT/envelopes
{
"emailSubject": "DocuSign API - Composite Templates",
"emailBlurb": "Composite Templates Sample 1",
"status": "sent",
"compositeTemplates": [
    {
        "serverTemplates": [
            {
                "sequence": "1",
                "templateId": "1AA7BA0B-9079-4F8C-915B-739576297D62"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "1",
                "recipients": {
                    "signers": [
                        {
                            "email": "email@email.com",
                            "name": "Signer Name",
                            "recipientId": "1",
                            "roleName": "Account Holder"
                        }
                    ]
                }
            }
        ]
    },
    {
        "serverTemplates": [
            {
                "sequence": "2",
                "templateId": "77343ECC-391F-46A1-BFC3-92A3CD8C93E3"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "recipients": {
                    "signers": [
                        {
                            "email": "email@email.com",
                            "name": "Signer Name",
                            "recipientId": "1",
                            "roleName": "Account Holder",
                            "tabs": {
                                "textTabs": [
                                    {
                                        "tabLabel": "AccountFirstName",
                                        "value": "Client"
                                    },
                                    {
                                        "tabLabel": "AccountLastName",
                                        "value": "Name"
                                    },
                                    {
                                        "tabLabel": "Email1",
                                        "value": "someEmail@email.com"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    },
    {
        "serverTemplates": [
            {
                "sequence": "3",
                "templateId": "ADADDD87-E831-4EF3-A160-BBE73F449C8E"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "3",
                "recipients": {
                    "signers": [
                        {
                            "email": "email@email.com",
                            "name": "Signer Name",
                            "recipientId": "1",
                            "roleName": "Account Holder"
                        }
                    ]
                }
            }
        ]
    }
]

}

回复是:

{
"envelopeId": "99f4c73d-6420-4e3b-88eb-2447139a2616",
"uri": "/envelopes/99f4c73d-6420-4e3b-88eb-2447139a2616",
"statusDateTime": "2014-08-14T21:09:09.0430000Z",
"status": "sent"   }

接下来,我尝试获取收件人视图

https://demo.docusign.net/restapi/v2/accounts/ACCOUNT/envelopes/99f4c73d-6420-4e3b-88eb-2447139a2616/views/recipient
{
  "authenticationMethod": "email",
  "email": "email@email.com",
  "returnUrl": "www.someUrl.com",
  "userName": "Signer Name"
}

我收到了这个错误:

{
"errorCode": "UNKNOWN_ENVELOPE_RECIPIENT",
"message": "The recipient you have identified is not a valid recipient of the specified      envelope. Envelope recipient could not be determined. 'clientUserId', 'email', or 'userName' in request and envelope may not match."
}

电子邮件和名称匹配,所以我不明白为什么我无法获取网址。我应该指出,如果我使用DocuSign帐户上的相同名称和电子邮件,这一切都有效,但这需要适用于外部收件人。

1 个答案:

答案 0 :(得分:1)

在创建信封时将收件人指定为嵌入式/专属收件人,以便您随后能够提交“获取收件人视图”#34;请求检索可用于启动收件人签名会话的URL,您的"创建信封"请求必须为收件人指定 clientUserId 属性。此属性应显示为其他收件人属性的对等项(即:电子邮件,名称等) - 如下所示:

"signers": [
    {
        "email": "email@email.com",
        "name": "Signer Name",
        "recipientId": "1",
        "roleName": "Account Holder",
        "clientUserId": "12345"
    }
]

然后,当您提交"获取收件人视图"请求,您需要为 clientUserId 指定相同的值:

POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/ENVELOPE_ID/views/recipient

{
  "authenticationMethod": "Email",
  "email": "email@email.com",
  "returnUrl": "www.someUrl.com",
  "userName": "Signer Name",
  "clientUserId": "12345"
}

clientUserId 的值可以是您想要的任何值,但最大长度为100个字符。有关嵌入式签名的详细信息,请参阅DocuSign REST API Guide