Chilkat Online Tools

VBScript / DocuSign eSignature REST API / 13. Delete Existing Lock on an Envelope

Back to Collection Items

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set http = CreateObject("Chilkat_9_5_0.Http")

' Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = "<access_token>"
http.SetRequestHeader "X-DocuSign-Edit","<DocuSignEdit><LockToken>{{lockToken}}</LockToken></DocuSignEdit>"

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.QuickRequest("DELETE","https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock")
If (http.LastMethodSuccess = 0) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine(resp.StatusCode)
outFile.WriteLine(resp.BodyStr)


outFile.Close

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
	-H "X-DocuSign-Edit: <DocuSignEdit><LockToken>{{lockToken}}</LockToken></DocuSignEdit>"
https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock

Postman Collection Item JSON

{
  "name": "13. Delete Existing Lock on an Envelope",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{accessToken}}",
          "type": "string"
        }
      ]
    },
    "method": "DELETE",
    "header": [
      {
        "key": "X-DocuSign-Edit",
        "value": "<DocuSignEdit><LockToken>{{lockToken}}</LockToken></DocuSignEdit>",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "{{apiVersion}}",
        "accounts",
        "{{accountId}}",
        "envelopes",
        "{{envelopeId}}",
        "lock"
      ]
    },
    "description": "This example will delete the lock we created on the envelope."
  },
  "response": [
  ]
}