0
votes

On the DocuSign web application, i have created a template with :

  • 2 documents :
    • 1 document to sign
    • 1 supplemental document
  • 2 roles :
    • signer
    • cc

I'm creating an envelope with DocuSign API, from this template, with this definition :

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

Then i get the response from the API :

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

Now i try to update first document (the one to sign) :

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

Then i get the error :

{
  "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"
}

The document used to define the template is the same than the document i tried to replace in the envelope. But i am unable to replace the document in the envelope. Why ?

1

1 Answers

0
votes

It looks like you need to update your request body. Try this.

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

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