使用http://iodocs.docusign.com/处的DocuSign REST Api页面,我使用“From Composite Templatesv2 / accounts /:accountId / envelopes”选项在“请求签名”选项卡下创建了一个复合信封。我的请求网址是:“uri”:“//demo.docusign.net/restapi/v2/accounts/660598/envelopes”,正文是
{
"emailBlurb": "Sign Me",
"emailSubject": "Sign this",
"status": "Created",
"templateId": "d34e9aa1-bc1d-41bc-ab3d-de42057dc990",
"templateRoles": [
{
"tabs": {
"textTabs": [
{
"tabLabel": "AccountFirstName",
"value": "FirstName"
},
{
"tabLabel": "AccountLastName",
"value": "LastName"
}
]
},
"roleName": "Account Holder",
"name": "William Heine",
"email": "myEmail@email.com"
}
],
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "d34e9aa1-bc1d-41bc-ab3d-de42057dc990"
}
],
"inlineTemplates": [
{
"sequence": "1"
}
]
},
{
"serverTemplates": [
{
"sequence": "2",
"templateId": "2661f101-6bea-4ec1-826d-d3f69863c393"
}
],
"inlineTemplates": [
{
"sequence": "2"
}
]
},
{
"serverTemplates": [
{
"sequence": "3",
"templateId": "1e2aa3b8-8e17-4b57-b7b1-5539a896f1c0"
}
],
"inlineTemplates": [
{
"sequence": "3"
}
]
},
{
"serverTemplates": [
{
"sequence": "4",
"templateId": "5a59fdd0-ae1d-4907-aead-608fc544422f"
}
],
"inlineTemplates": [
{
"sequence": "4"
}
]
}
]
}
对此的回应是:
{
"envelopeId": "3a9388dc-5c8e-49f5-88c5-7e666363534a",
"uri": "/envelopes/3a9388dc-5c8e-49f5-88c5-7e666363534a",
"statusDateTime": "2014-07-25T22:50:45.9000000Z",
"status": "created"
}
接下来,我进入“视图”标签,并使用以下网址拨打“Recipientv2 / accounts /:accountId / envelopes /:envelopeId / views / recipient”:“uri”:“// dev.docusign.net / restapi / v2 / accounts / 660598 / envelopes / 3a9388dc-5c8e-49f5-88c5-7e666363534a / views / recipient“and this body:
{
"authenticationMethod": "email",
"email": "myEmail@email.com",
"returnUrl": "http://testing.ad.mtrust.com/",
"userName": "William Heine"
}
我收到此错误:
{
"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."
}
用户名和电子邮件是相同的。没有地方可以在复合信封上输入clientUserId。那为什么这不起作用?
答案 0 :(得分:1)
当您发送状态为created
的信封时,它将成为DocuSign的草稿。您必须使用状态sent
发送,以便发送并将其提供给收件人。
views/recipients
请求要求信封处于created
以外的任何状态。
答案 1 :(得分:1)
要使用嵌入式签名(和收件人视图),收件人必须具有clientUserId。尽管碘离子可能不会暴露它,但除非您的签名者也是经过身份验证的API用户,否则这是必需的。您可以添加" clientUserId" inlineTemplates中的签名者对象:
{
"emailSubject": "Embedded composite",
"emailBlurb": ".",
"status": "sent",
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"email": "sample@me.u.them",
"name": "Signer Sam",
"recipientId": "1",
"roleName": "Signer",
"DefaultRecipient": "true",
"clientUserId": "12345"
}]
}
}],
"document": {
"documentId": "1",
"name": "test doc.pdf",
"TransformPdfFields": "true"
},
}]
}