简体   繁体   English

信封名称带引号时无法下载Docusign文档

[英]Can't download Docusign document when envelope name has quotes

I'm using the Docusign API (via the ruby docusign_rest gem) and repro'd this using Postman. 我正在使用Docusign API(通过ruby docusign_rest gem),并使用邮递员对此进行了复制。

I have an envelope whose name has quotes in it. 我有一个信封,信封上有引号。 When I tried to download the signed PDF, I get an error message: 尝试下载签名的PDF时,出现错误消息:

https://www.docusign.net/restapi/v2/accounts/{account_id}/envelopes/{envelope_id}/documents/1 https://www.docusign.net/restapi/v2/accounts/{account_id}/envelopes/{envelope_id}/documents/1

{
  "errorCode": "UNSPECIFIED_ERROR",
  "message": "The format of value 'file; filename=\"My filename (\"MF\") has quotes.pdf\"; documentid=\"1\"' is invalid."
}

When I list the documents, it shows the name of the envelope having quotes. 当我列出文档时,它显示带引号的信封的名称。

https://www.docusign.net/restapi/v2/accounts/{account_id}/envelopes/{envelope_id}/documents https://www.docusign.net/restapi/v2/accounts/{account_id}/envelopes/{envelope_id}/documents

{
  "envelopeId": "{envelope_id}",
  "envelopeDocuments": [
    {
      "documentId": "1",
      "name": "My filename (\"MF\") has quotes.pdf",
      "type": "content",
      "uri": "/envelopes/{envelop_id}/documents/1",
etc...
    }
}

I can change my code to prevent quotes for new documents, but I have existing signed documents that I can't download. 我可以更改代码以防止在新文档中使用引号,但是我现有的签名文档无法下载。 How can I download them? 如何下载? Or fix them? 还是解决它们?

You will need to properly escape the quotes in your json. 您将需要正确地转义json中的引号。

The only way to know what is really happening is to see the api logs. 知道实际情况的唯一方法是查看api日志。

Added 添加

To see the api logs, you have two choices: 要查看api日志,您有两种选择:

  1. See the instructions 请参阅说明
  2. Use the API Logging Feature of the new (still beta) Recipe tool . 使用新的(仍为beta)“食谱”工具API日志记录功能 has a more convenient interface to the API Logger. 与API Logger的接口更加便捷。

Using the current docusign_rest release (v0.3.1) I was able to create an envelope with a quote in the document's filename and then download that document: 使用当前的docusign_rest版本(v0.3.1),我可以创建一个在文件名中带有引号的信封,然后下载该文件:

client = DocusignRest::Client.new
res = client.create_envelope_from_document(email: {subject: "test email subject",body: "this is the email body and it's large!"}, signers: [{embedded: true, name: 'Joe Dimaggio', email: 'joe.dimaggio@example.org', role_name: 'Issuer',sign_here_tabs: [{anchor_string: 'sign here',anchor_x_offset: '-30',anchor_y_offset: '35'}]},], files: [{path: '/Users/tomcopeland/github.com/docusign_rest/test".pdf', name: 'test".pdf'},],status: 'sent')
client.get_document_from_envelope(envelope_id: res['envelopeId'], document_id: "1", local_save_path: "/tmp/foobar.pdf")
client.get_documents_from_envelope(envelope_id: res['envelopeId'])["envelopeDocuments"].map {|d| d["name"] }
=> ["test\".pdf", "Summary"]

Also, this latest release supports call logging so, if needed, you can extract logs client-side. 此外,此最新版本还支持呼叫记录,因此,如果需要,您可以在客户端提取日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM