Chilkat Online Tools

Objective-C / DocuSign eSignature REST API / 12. Lists the Existing Locks on an Envelope

Back to Collection Items

#import <CkoHttp.h>
#import <CkoStringBuilder.h>

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

CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;

// Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = @"<access_token>";

CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [http QuickGetSb: @"https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock" sbContent: sbResponseBody];
if (success == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

NSLog(@"%@%d",@"Response status code = ",[http.LastStatus intValue]);
NSLog(@"%@",[sbResponseBody GetAsString]);

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://domain.com/{{apiVersion}}/accounts/{{accountId}}/envelopes/{{envelopeId}}/lock

Postman Collection Item JSON

{
  "name": "12. Lists the Existing Locks on an Envelope",
  "protocolProfileBehavior": {
    "disableBodyPruning": true
  },
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{accessToken}}",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
    ],
    "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 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}\nNote: Users must have envelope locking capability enabled to use this function (userSetting canLockEnvelopes must be set to true for the user)."
  },
  "response": [
  ]
}