Chilkat Online Tools

Objective-C / DocuSign eSignature REST API / Modifies tab settings for specified account

Back to Collection Items

#import <CkoHttp.h>
#import <CkoJsonObject.h>
#import <CkoStringBuilder.h>
#import <CkoHttpResponse.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;

// Use this online tool to generate code from sample JSON: Generate Code to Create JSON

// The following JSON is sent in the request body.

// {
//   "textTabsEnabled": "sample string 1",
//   "textTabsMetadata": {
//     "rights": "sample string 1",
//     "uiHint": "sample string 2",
//     "uiType": "sample string 3",
//     "uiOrder": "sample string 4",
//     "is21CFRPart11": "sample string 5",
//     "options": [
//       "sample string 1"
//     ]
//   },
//   "radioTabsEnabled": "sample string 2",
//   "radioTabsMetadata": {},
//   "checkboxTabsEnabled": "sample string 3",
//   "checkboxTabsMetadata": {},
//   "listTabsEnabled": "sample string 4",
//   "listTabsMetadata": {},
//   "approveDeclineTabsEnabled": "sample string 5",
//   "approveDeclineTabsMetadata": {},
//   "noteTabsEnabled": "sample string 6",
//   "noteTabsMetadata": {},
//   "dataFieldRegexEnabled": "sample string 7",
//   "dataFieldRegexMetadata": {},
//   "dataFieldSizeEnabled": "sample string 8",
//   "dataFieldSizeMetadata": {},
//   "tabLocationEnabled": "sample string 9",
//   "tabLocationMetadata": {},
//   "tabScaleEnabled": "sample string 10",
//   "tabScaleMetadata": {},
//   "tabLockingEnabled": "sample string 11",
//   "tabLockingMetadata": {},
//   "savingCustomTabsEnabled": "sample string 12",
//   "savingCustomTabsMetadata": {},
//   "tabTextFormattingEnabled": "sample string 13",
//   "tabTextFormattingMetadata": {},
//   "sharedCustomTabsEnabled": "sample string 14",
//   "sharedCustomTabsMetadata": {},
//   "senderToChangeTabAssignmentsEnabled": "sample string 15",
//   "senderToChangeTabAssignmentsMetadata": {},
//   "tabDataLabelEnabled": "sample string 16",
//   "tabDataLabelMetadata": {},
//   "firstLastEmailTabsEnabled": "sample string 17",
//   "firstLastEmailTabsMetadata": {},
//   "calculatedFieldsEnabled": "sample string 18",
//   "calculatedFieldsMetadata": {},
//   "allowTabOrder": "sample string 19",
//   "allowTabOrderMetadata": {}
// }

CkoJsonObject *json = [[CkoJsonObject alloc] init];
[json UpdateString: @"textTabsEnabled" value: @"sample string 1"];
[json UpdateString: @"textTabsMetadata.rights" value: @"sample string 1"];
[json UpdateString: @"textTabsMetadata.uiHint" value: @"sample string 2"];
[json UpdateString: @"textTabsMetadata.uiType" value: @"sample string 3"];
[json UpdateString: @"textTabsMetadata.uiOrder" value: @"sample string 4"];
[json UpdateString: @"textTabsMetadata.is21CFRPart11" value: @"sample string 5"];
[json UpdateString: @"textTabsMetadata.options[0]" value: @"sample string 1"];
[json UpdateString: @"radioTabsEnabled" value: @"sample string 2"];
[json UpdateNewObject: @"radioTabsMetadata"];
[json UpdateString: @"checkboxTabsEnabled" value: @"sample string 3"];
[json UpdateNewObject: @"checkboxTabsMetadata"];
[json UpdateString: @"listTabsEnabled" value: @"sample string 4"];
[json UpdateNewObject: @"listTabsMetadata"];
[json UpdateString: @"approveDeclineTabsEnabled" value: @"sample string 5"];
[json UpdateNewObject: @"approveDeclineTabsMetadata"];
[json UpdateString: @"noteTabsEnabled" value: @"sample string 6"];
[json UpdateNewObject: @"noteTabsMetadata"];
[json UpdateString: @"dataFieldRegexEnabled" value: @"sample string 7"];
[json UpdateNewObject: @"dataFieldRegexMetadata"];
[json UpdateString: @"dataFieldSizeEnabled" value: @"sample string 8"];
[json UpdateNewObject: @"dataFieldSizeMetadata"];
[json UpdateString: @"tabLocationEnabled" value: @"sample string 9"];
[json UpdateNewObject: @"tabLocationMetadata"];
[json UpdateString: @"tabScaleEnabled" value: @"sample string 10"];
[json UpdateNewObject: @"tabScaleMetadata"];
[json UpdateString: @"tabLockingEnabled" value: @"sample string 11"];
[json UpdateNewObject: @"tabLockingMetadata"];
[json UpdateString: @"savingCustomTabsEnabled" value: @"sample string 12"];
[json UpdateNewObject: @"savingCustomTabsMetadata"];
[json UpdateString: @"tabTextFormattingEnabled" value: @"sample string 13"];
[json UpdateNewObject: @"tabTextFormattingMetadata"];
[json UpdateString: @"sharedCustomTabsEnabled" value: @"sample string 14"];
[json UpdateNewObject: @"sharedCustomTabsMetadata"];
[json UpdateString: @"senderToChangeTabAssignmentsEnabled" value: @"sample string 15"];
[json UpdateNewObject: @"senderToChangeTabAssignmentsMetadata"];
[json UpdateString: @"tabDataLabelEnabled" value: @"sample string 16"];
[json UpdateNewObject: @"tabDataLabelMetadata"];
[json UpdateString: @"firstLastEmailTabsEnabled" value: @"sample string 17"];
[json UpdateNewObject: @"firstLastEmailTabsMetadata"];
[json UpdateString: @"calculatedFieldsEnabled" value: @"sample string 18"];
[json UpdateNewObject: @"calculatedFieldsMetadata"];
[json UpdateString: @"allowTabOrder" value: @"sample string 19"];
[json UpdateNewObject: @"allowTabOrderMetadata"];

// Adds the "Authorization: Bearer {{accessToken}}" header.
http.AuthToken = @"{{accessToken}}";
[http SetRequestHeader: @"Accept" value: @"application/json"];

CkoStringBuilder *sbRequestBody = [[CkoStringBuilder alloc] init];
[json EmitSb: sbRequestBody];

CkoHttpResponse *resp = [http PTextSb: @"PUT" url: @"https://domain.com/v2.1/accounts/{{accountId}}/settings/tabs" textData: sbRequestBody charset: @"utf-8" contentType: @"application/json" md5: NO gzip: NO];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

NSLog(@"%d",[resp.StatusCode intValue]);
NSLog(@"%@",resp.BodyStr);

Curl Command

curl -X PUT
	-H "Accept: application/json"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{
  "textTabsEnabled": "sample string 1",
  "textTabsMetadata": {
    "rights": "sample string 1",
    "uiHint": "sample string 2",
    "uiType": "sample string 3",
    "uiOrder": "sample string 4",
    "is21CFRPart11": "sample string 5",
    "options": [
      "sample string 1"
    ]
  },
  "radioTabsEnabled": "sample string 2",
  "radioTabsMetadata": {},
  "checkboxTabsEnabled": "sample string 3",
  "checkboxTabsMetadata": {},
  "listTabsEnabled": "sample string 4",
  "listTabsMetadata": {},
  "approveDeclineTabsEnabled": "sample string 5",
  "approveDeclineTabsMetadata": {},
  "noteTabsEnabled": "sample string 6",
  "noteTabsMetadata": {},
  "dataFieldRegexEnabled": "sample string 7",
  "dataFieldRegexMetadata": {},
  "dataFieldSizeEnabled": "sample string 8",
  "dataFieldSizeMetadata": {},
  "tabLocationEnabled": "sample string 9",
  "tabLocationMetadata": {},
  "tabScaleEnabled": "sample string 10",
  "tabScaleMetadata": {},
  "tabLockingEnabled": "sample string 11",
  "tabLockingMetadata": {},
  "savingCustomTabsEnabled": "sample string 12",
  "savingCustomTabsMetadata": {},
  "tabTextFormattingEnabled": "sample string 13",
  "tabTextFormattingMetadata": {},
  "sharedCustomTabsEnabled": "sample string 14",
  "sharedCustomTabsMetadata": {},
  "senderToChangeTabAssignmentsEnabled": "sample string 15",
  "senderToChangeTabAssignmentsMetadata": {},
  "tabDataLabelEnabled": "sample string 16",
  "tabDataLabelMetadata": {},
  "firstLastEmailTabsEnabled": "sample string 17",
  "firstLastEmailTabsMetadata": {},
  "calculatedFieldsEnabled": "sample string 18",
  "calculatedFieldsMetadata": {},
  "allowTabOrder": "sample string 19",
  "allowTabOrderMetadata": {}
}'
https://domain.com/v2.1/accounts/{{accountId}}/settings/tabs

Postman Collection Item JSON

{
  "name": "Modifies tab settings for specified account",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"textTabsEnabled\": \"sample string 1\",\n  \"textTabsMetadata\": {\n    \"rights\": \"sample string 1\",\n    \"uiHint\": \"sample string 2\",\n    \"uiType\": \"sample string 3\",\n    \"uiOrder\": \"sample string 4\",\n    \"is21CFRPart11\": \"sample string 5\",\n    \"options\": [\n      \"sample string 1\"\n    ]\n  },\n  \"radioTabsEnabled\": \"sample string 2\",\n  \"radioTabsMetadata\": {},\n  \"checkboxTabsEnabled\": \"sample string 3\",\n  \"checkboxTabsMetadata\": {},\n  \"listTabsEnabled\": \"sample string 4\",\n  \"listTabsMetadata\": {},\n  \"approveDeclineTabsEnabled\": \"sample string 5\",\n  \"approveDeclineTabsMetadata\": {},\n  \"noteTabsEnabled\": \"sample string 6\",\n  \"noteTabsMetadata\": {},\n  \"dataFieldRegexEnabled\": \"sample string 7\",\n  \"dataFieldRegexMetadata\": {},\n  \"dataFieldSizeEnabled\": \"sample string 8\",\n  \"dataFieldSizeMetadata\": {},\n  \"tabLocationEnabled\": \"sample string 9\",\n  \"tabLocationMetadata\": {},\n  \"tabScaleEnabled\": \"sample string 10\",\n  \"tabScaleMetadata\": {},\n  \"tabLockingEnabled\": \"sample string 11\",\n  \"tabLockingMetadata\": {},\n  \"savingCustomTabsEnabled\": \"sample string 12\",\n  \"savingCustomTabsMetadata\": {},\n  \"tabTextFormattingEnabled\": \"sample string 13\",\n  \"tabTextFormattingMetadata\": {},\n  \"sharedCustomTabsEnabled\": \"sample string 14\",\n  \"sharedCustomTabsMetadata\": {},\n  \"senderToChangeTabAssignmentsEnabled\": \"sample string 15\",\n  \"senderToChangeTabAssignmentsMetadata\": {},\n  \"tabDataLabelEnabled\": \"sample string 16\",\n  \"tabDataLabelMetadata\": {},\n  \"firstLastEmailTabsEnabled\": \"sample string 17\",\n  \"firstLastEmailTabsMetadata\": {},\n  \"calculatedFieldsEnabled\": \"sample string 18\",\n  \"calculatedFieldsMetadata\": {},\n  \"allowTabOrder\": \"sample string 19\",\n  \"allowTabOrderMetadata\": {}\n}"
    },
    "url": {
      "raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/settings/tabs",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "settings",
        "tabs"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}",
          "type": "string"
        }
      ]
    }
  },
  "response": [
  ]
}