我想在DocuSign中使用DocuSign REST API創建多個文檔中的信封,我正在使用多部分/表單數據請求使用JSON來定義信封的屬性,我檢查我的JSON,我認爲它是確定的。在此之下,我定義了一個多部分/混合部分,其中我設置了文檔的標題和PDF字節。我收到一個錯誤代碼爲「NO_DOCUMENT_RECEIVED」的錯誤代碼,並且顯示消息「文檔元素不包含編碼文檔,或者編碼有問題」。我發佈請求結果從下面小提琴手:通過DocuSign Rest API創建DocuSign信封時出錯(包含多個文檔和多個收件人)
//請求
POST https://demo.docusign.net/restapi/v2/accounts/295724/envelopes HTTP/1.1
X-DocuSign-Authentication: {"Username":"email","Password":"password","IntegratorKey":"key"}
Content-Type: multipart/form-data; boundary=9a56da749dc04804819460f6499ab80b
Accept: application/json
Host: demo.docusign.net
Content-Length: 31476
Expect: 100-continue
--9a56da749dc04804819460f6499ab80b
Content-Type: application/json
Content-Disposition: form-data
{"emailBlurb":"EMAIL BODY HERE OK OK","emailSubject":"EMAIL SUBJECT HERE IS MANDATORY","status":"sent","documents":[{"documentId":1,"name":"ABC.pdf"},{"documentId":2,"name":"AB.pdf"}],"recipients":{"signers":[{"email":"[email protected]","name":"Dubhe","recipientId":"1","routingOrder":"1"},{"email":"[email protected]","name":"DubheF","recipientId":"2","routingOrder":"1"}]}}
--9a56da749dc04804819460f6499ab80b
Content-Disposition: form-data
Content-Type: multipart/mixed; boundary=e8bc9555e9634110bba63547b2552460
--e8bc9555e9634110bba63547b2552460
Content-Type: application/pdf
Content-Disposition: file; filename=ABC.pdf; documentId=1
<PDF Bytes Document 1>
--e8bc9555e9634110bba63547b2552460
Content-Type: application/pdf
Content-Disposition: file; filename=AB.pdf; documentId=2
<PDF BytesDocument Two>
--e8bc9555e9634110bba63547b2552460--
--9a56da749dc04804819460f6499ab80b--
嗯表面上我沒有看到任何明顯的錯誤,你確定內容長度值設置正確嗎?你也是積極的兩個文件都是有效的PDF文件? – Ergin