Docusign API:更新enveloppeDocuments时,PageSize被锁定

时间:2020-04-09 07:29:29

标签: docusignapi

在DocuSign Web应用程序上,我使用以下命令创建了一个模板:

  • 2个文件:
    • 1个要签名的文件
    • 1个补充文件
  • 2个角色:
    • 签名人
    • cc

我正在使用DocuSign API从该模板创建一个具有以下定义的信封:

{
  "status" : "created",
  "templateId" : "660fc6af-21f4-4738-b414-a5da17bc7755",
  "templateRoles" : [ {
    "email" : "my_user11@example.com",
    "name" : "ABC",
    "roleName" : "signer",
    "routingOrder" : "1"
  }, {
    "email" : "my_user2@example.com",
    "name" : "EFG",
    "roleName" : "cc",
    "routingOrder" : "2"
  } ]
}

然后我从API获得响应:

{
  "envelopeId" : "3cb2c471-a288-47c7-82f3-2ba2f418607a",
  "status" : "created",
  "statusDateTime" : "2020-04-09T06:43:44.9430000Z",
  "uri" : "/envelopes/3cb2c471-a288-47c7-82f3-2ba2f418607a"
}

现在,我尝试更新第一个文档(要签名的文档):

{
  "documents" : [ {
    "documentBase64" : "xxxx",
    "documentId" : "1",
    "fileExtension" : "pdf",
    "name" : "Replaced document to sign"
  } ]
}

然后我得到了错误:

{
  "envelopeDocuments" : [ {
    "authoritativeCopy" : "false",
    "documentId" : "1",
    "documentIdGuid" : "9aaba15f-f71e-492a-93cd-5be98687c92d",
    "errorDetails" : {
      "errorCode" : "DOCUMENT_UPDATE_NOT_ALLOWED",
      "message" : "The following properties are locked and cannot be updated: pageSizes"
    },
    "name" : "reportTest.pdf",
    "order" : "2",
    "templateRequired" : "false"
  } ],
  "envelopeId" : "3cb2c471-a288-47c7-82f3-2ba2f418607a"
}

用于定义模板的文档与我试图在信封中替换的文档相同。但是我无法替换信封中的文件。为什么?

1 个答案:

答案 0 :(得分:0)

您似乎需要更新请求正文。尝试这个。

PUT: /v2.1/accounts/{accountID}/envelopes/{envelopeID}/documents/1

Request Body:
{
"name": "yourFile.pdf",
"order": 1,
"display": "inline",
"documentId": "1",
"fileExtension": "pdf",
"documentBase64": "base64EncodedString"
}