Chilkat Online Tools

PowerBuilder / DocuSign REST API / Modifies tab settings for specified account

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_SbRequestBody
oleobject loo_Resp

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

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

loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")

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

// Adds the "Authorization: Bearer {{accessToken}}" header.
loo_Http.AuthToken = "{{accessToken}}"
loo_Http.SetRequestHeader("Accept","application/json")

loo_SbRequestBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbRequestBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Json.EmitSb(loo_SbRequestBody)

loo_Resp = loo_Http.PTextSb("PUT","https://domain.com/v2.1/accounts/{{accountId}}/settings/tabs",loo_SbRequestBody,"utf-8","application/json",0,0)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Json
    destroy loo_SbRequestBody
    return
end if

Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp


destroy loo_Http
destroy loo_Json
destroy loo_SbRequestBody

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}}"
        }
      ]
    }
  },
  "response": [
  ]
}