我正在尝试使用DocuSign REST api / v2制作'createAndSendEnvelope'请求。我的JSON是有效的。
我遇到了同样的问题,我尝试了那里给出的解决方案,即我确保所有新行使用'\ r \ n'。
我在这里缺少什么?这是我的请求,我收到错误代码,“消息”:“信封不完整。完整的信封需要文档,收件人,标签和主题行。信封定义丢失。”
POST https://demo.docusign.net/restapi/v2/accounts/xxxxx/envelopes HTTP/1.1
X-DocuSign-Authentication: {"Username":"xxxxxx","Password":"xxxxx","IntegratorKey":"xxxxxx"}
Content-Type: multipart/form-data; boundary=AAA
Accept: application/json
Host: demo.docusign.net
Content-Length: 90500
Expect: 100-continue
--AAA
Content-Type: application/json
Content-Disposition: form-data
{
"status": "sent",
"recipients": {
"signers": [{
"tabs": {
"signHeretabs": [{
"yPosition": "15",
"xPosition": "249",
"width": "100",
"tablabel": null,
"required": "TRUE",
"recipientId": "1",
"pagenumber": "1",
"fontSize": "Size12",
"font": "Calibri",
"documentid": "1",
"anchorYoffset": null,
"anchorXOffset": null,
"anchorUnits": "pixels",
"anchorString": "Sign Here",
"anchorIgnoreIfNotPresent": "true"
}],
"initialsTabs": [{
"yPosition": "45",
"xPosition": "249",
"width": "100",
"tablabel": null,
"required": "TRUE",
"receipientId": "1",
"pagenumber": "1",
"fontSize": "Size12",
"font": "Calibri",
"documentId": "1",
"anchorYoffset": null,
"anchorXOffset": null,
"anchorUnits": "pixels",
"anchorString": "Initials Here",
"anchorIgnoreIfNotPresent": "true"
}],
"dateSignedTabs": [{
"yPosition": "65",
"xPosition": "249",
"width": "100",
"tablabel": null,
"required": "TRUE",
"receipientid": "1",
"pagenumber": "1",
"fontSize": "Size12",
"font": "Calibri",
"documentid": "1",
"anchorYoffset": "-5",
"anchorXOffset": null,
"anchorUnits": "pixels",
"anchorString": "Date Signed",
"anchorIgnoreIfNotPresent": "true"
}]
},
"routingorder": "1",
"rolename": "roleNameHere",
"recipientid": "1",
"name": "XXXXXXXXXX",
"email": "xxxxx@gcpa.com"
}]
},
"emailsubject": "TestDocuSign Call",
"emailBlurb": "Test Email Blurb",
"documents": [{
"name": "Name1",
"fileExtension": ".pdf",
"documentId": "1",
"documentBase64": null
}]
}
--AAA
Content-Type: application/octet-stream
Content-Disposition: file; filename="Name1.pdf"; documentid="1"
Content-Transfer-Encoding: base64
VGhpcyBpcyBh
答案 0 :(得分:1)
您可以在 documentBase64 属性中指定base64编码的文档字节
POST https://demo.docusign.net/restapi/v2/accounts/xxxxx/envelopes HTTP / 1.1 X-DocuSign-Authentication:{"用户名":" xxxxxx","密码":" xxxxx"," IntegratorKey&#34 ;:" XXXXXX"}
Content-Type:application / json
{
"status": "sent",
"recipients": {
"signers": [{
"tabs": {
<Removed tabs for brevity>
},
"routingorder": "1",
"rolename": "roleNameHere",
"recipientid": "1",
"name": "XXXXXXXXXX",
"email": "xxxxx@gcpa.com"
}]
},
"emailsubject": "TestDocuSign Call",
"emailBlurb": "Test Email Blurb",
"documents": [{
"name": "Name1",
"fileExtension": ".pdf",
"documentId": "1",
"documentBase64": "VGhpcyBpcyBh"
}]
}