我正在尝试通过Docusign REST API端点将多部分表单文档添加到现有草稿信封:/envelopes/[envelopeId]/documents/[documentId]
我得到的错误信息是:
The request contained at least one invalid parameter. A filename was not
found in the Content-Disposition header ('filename="filename.ext"
如您所见,Content-Disposition值中有一个filename参数。我尝试过对Content-Disposition标头进行多种不同的编辑和调整,但每次都失败了。这似乎是抛出错误的正确格式。
Headers:
Authorization "Bearer [token]"
Accept "application/json"
Content-Type "multipart/form-data; boundary=AAAAAA"
--AAAAAA
Content-Disposition: form-data
Content-Type: application/json
{"fileExtension":"pdf","name":"test file name.pdf","documentId":1,"order":1}
--AAAAAA
Content-Disposition: file; filename="test file name.pdf"; documentId=1
Content-Type: application/pdf
[binary output]
--AAAAAA--
任何来自Docusign或一般都能看到错误或帮我的人?感谢。
答案 0 :(得分:2)
multipart / form-data不适用于updateEnvelopeDocument api
而是在标题中指定Content-Type
和content-disposition
。请求正文应该只包含文件流。
put / envelopes / [envelopeId] / documents / [documentId]
[接头]
Content-Type: application/pdf
content-disposition: file; filename="test file name.pdf"; fileExtension=pdf; documentId=1
[机构]
[二进制输出]
答案 1 :(得分:1)
另一种选择是使用支持fruchterman_reingold_layout
的{{3}} api。您还可以选择使用此API在单个api调用中更新多个文档。
multipart/form-data