我們正試圖使用docusign restapi v2從pdf文檔創建信封。我們可以使用XML創建一個信封,但是當我們嘗試使用JSON時,我們會從docusign收到以下錯誤。Docusign:無法從restapi v2中的文檔創建信封
"errorCode": "ENVELOPE_IS_INCOMPLETE",
"message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line. Envelope definition missing."
我們發送的整個POST在小提琴手的下方(文件內容已被刪除)。
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
{
"emailBlurb": "Blurb",
"emailSubject": "Subhject",
"documents": [
{
"name": "NDA.pdf",
"documentId": "1"
}
],
"recipients": {
"signers": [
{
"tabs": {
"signHereTabs": [
{
"pageNumber": "1",
"yPosition": "1",
"xPosition": "1",
"documentId": "1",
"tabId": "1",
"name": "TabName"
}
]
},
"routingOrder": "1",
"recipientId": "1",
"name": "Ben",
"email": "[email protected]"
}
]
},
"status": "created"
}
--AAA
Content-Type: application/pdf
Content-Disposition: file; filename="NDA.pdf"; documentId="1"
<pdf file image content goes here>
--AAA--
據我可以告訴JSON看起來是正確的。我們在這裏失蹤有什麼不對嗎?
這是問題。在JSON之前的內容處置之後,我誤解了CRLF。我們在第一個邊界之前還有一個額外的CRLF。非常感謝你,我瘋了試圖弄清楚。 – user3084095
沒問題,很高興幫助。乾杯! – Ergin