Chilkat Online Tools

C# / DocuSign Click API / 11. Lock the Envelope

Back to Collection Items

System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
   at System.Runtime.InteropServices.Marshal.StringToHGlobalUni(String s)
   at Chilkat.CkMarshal.StringToX(String s, XString* x)
   at Chilkat.Xml.LoadXml(String xmlData)
   at ChilkatApi.XClass.LoadClass(String className, Log log)
   at ChilkatApi.ApiCache.getApiClass(String className, Log log)
   at ChilkatApi.ApiCache.getApiProperty(String className, String propName, Log log)
   at ChilkatCode.CodeGen.getXProp(String className, String propName)
   at ChilkatCode.CodeGen.getPropType(String varName, String propName)
   at ChilkatCode.CodeGen.emitAssignment(String varName, String propName, String op, Xml xml)
   at ChilkatCode.Parser.assignment()
   at ChilkatCode.Parser.statement()
   at ChilkatCode.Parser.Chilkat()
   at ChilkatCode.Parser.Parse()
   at ChilkatCode.Compile.CompileForToolsIO(String srcCode, String langHashKey, StringBuilder sbHtmlOut)

Curl Command

curl -X POST
	-H "Authorization: Bearer {{accessToken}}"
	-d '{
  "lockDurationInSeconds": "500",
  "lockType": "edit"
}'
https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock

Postman Collection Item JSON

{
  "name": "11. Lock the Envelope",
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "var jsonData = JSON.parse(responseBody);",
          "postman.setEnvironmentVariable(\"lockToken\", jsonData.lockToken);"
        ]
      }
    }
  ],
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"lockDurationInSeconds\": \"500\",\n  \"lockType\": \"edit\"\n}"
    },
    "url": {
      "raw": "{{baseUrl}}/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "{{apiVersion}}",
        "accounts",
        "{{accountId}}",
        "envelopes",
        "{{envelopeId}}",
        "lock"
      ]
    },
    "description": "This method locks the specified envelope and sets the time until the lock expires to prevent other users or recipients from changing the envelope.\n\nThe response to this request returns a `lockToken` parameter. You must use the lockToken to update or delete an existing lock. You must also include the `lockToken` in the header for every PUT call that you make on the envelope while it is locked. If you do not include the `lockToken`, the system returns the following error:\n\n```{\n   \"errorCode\": \"EDIT_LOCK_NOT_LOCK_OWNER\",\n   \"message\": \"The user is not the owner of the lock. The template is locked by another user or in another application\"\n}```\n\n`Note`: Users must have envelope locking capability enabled to use this function (userSetting canLockEnvelopes must be set to true for the user)."
  },
  "response": [
  ]
}