DocuSign信封创建失败,包含PDF字段转换

时间:2018-09-24 20:30:59

标签: docusignapi docusigncompositetmplts

到目前为止,这是我的JSON代码:

{
  "status": "sent",
  "emailSubject": "This is an api Demo Doc, sent for signature",
  "recipients": {
    "carbonCopies": [
      {
        "email": "nila@gmail.com",
        "name": "Nilashree",
        "recipientId": "2"
      }
    ],
    "signers": [
      {
        "email": "{{signer1Email}}",
        "name": "Nilashree Nandkumar shirodkar",
        "recipientId": "1"
      }
    ]
  },
  "compositeTemplates": [
    {
      "inlineTemplates": [
        {
          "sequence": "1",
          "recipients": {
            "signers": [
              {
                "email": "nshiro2@students.towson.edu",
                "name": "Nila Joseph",
                "recipientId": "1",
                "defaultRecipient": "true"
              }
            ]
          }
        }
      ],
      "documents": {
        "documentId": "1",
        "name": "application_form.pdf",
        "transformPdfFields": "true",
        "documentBase64": "{{}}"
      }
    }
  ]
}

但是我遇到以下错误:

  

“ errorCode”:“ ENVELOPE_IS_INCOMPLETE”,
  “ message”:“信封不完整。完整的信封需要文档,收件人,标签和主题行。”

任何人都可以让我知道我在做什么错吗?

1 个答案:

答案 0 :(得分:0)

为什么要使用复合模板?也许您正计划建立一个更高版本,更复杂的信封定义。

您的错误是每个复合模板可以选择仅包含一个文档。字段名称是document,而不是documents

代替

  "documents": {
    "documentId": "1",
    "name": "application_form.pdf",
    "transformPdfFields": "true",
    "documentBase64": "{{}}"
  }

使用

  "document": {
    "documentId": "1",
    "name": "application_form.pdf",
    "transformPdfFields": "true",
    "documentBase64": "{{}}"
  }

此外,我不认为在复合模板结构之外不需要接收者。不过,我对此问题不是100%肯定。