Chilkat Online Tools

PowerBuilder / DocuSign REST API / Updates custom tab information.

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.

// {
//   "font": "sample string 1",
//   "bold": "sample string 2",
//   "italic": "sample string 3",
//   "underline": "sample string 4",
//   "fontColor": "sample string 5",
//   "fontSize": "sample string 6",
//   "anchor": "sample string 7",
//   "anchorXOffset": "sample string 8",
//   "anchorYOffset": "sample string 9",
//   "anchorUnits": "sample string 10",
//   "anchorIgnoreIfNotPresent": "sample string 11",
//   "anchorMatchWholeWord": "sample string 12",
//   "anchorCaseSensitive": "sample string 13",
//   "anchorHorizontalAlignment": "sample string 14",
//   "paymentItemCode": "sample string 15",
//   "paymentItemDescription": "sample string 16",
//   "paymentItemName": "sample string 17",
//   "height": "sample string 18",
//   "width": "sample string 19",
//   "customTabId": "sample string 20",
//   "initialValue": "sample string 21",
//   "includedInEmail": "sample string 22",
//   "disableAutoSize": "sample string 23",
//   "concealValueOnDocument": "sample string 24",
//   "locked": "sample string 25",
//   "required": "sample string 26",
//   "shared": "sample string 27",
//   "collaborative": "sample string 28",
//   "requireInitialOnSharedChange": "sample string 29",
//   "requireAll": "sample string 30",
//   "items": [
//     "sample string 1"
//   ],
//   "tabLabel": "sample string 31",
//   "maximumLength": "sample string 32",
//   "scaleValue": "sample string 33",
//   "name": "sample string 34",
//   "type": "sample string 35",
//   "validationMessage": "sample string 36",
//   "validationPattern": "sample string 37",
//   "lastModifiedByUserId": "sample string 38",
//   "lastModifiedByDisplayName": "sample string 39",
//   "lastModified": "sample string 40",
//   "createdByUserId": "sample string 41",
//   "createdByDisplayName": "sample string 42",
//   "editable": "sample string 43",
//   "mergeField": {
//     "configurationType": "sample string 1",
//     "path": "sample string 2",
//     "writeBack": "sample string 3",
//     "allowSenderToEdit": "sample string 4",
//     "row": "sample string 5"
//   },
//   "stampType": "sample string 44",
//   "selected": "sample string 45"
// }

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("font","sample string 1")
loo_Json.UpdateString("bold","sample string 2")
loo_Json.UpdateString("italic","sample string 3")
loo_Json.UpdateString("underline","sample string 4")
loo_Json.UpdateString("fontColor","sample string 5")
loo_Json.UpdateString("fontSize","sample string 6")
loo_Json.UpdateString("anchor","sample string 7")
loo_Json.UpdateString("anchorXOffset","sample string 8")
loo_Json.UpdateString("anchorYOffset","sample string 9")
loo_Json.UpdateString("anchorUnits","sample string 10")
loo_Json.UpdateString("anchorIgnoreIfNotPresent","sample string 11")
loo_Json.UpdateString("anchorMatchWholeWord","sample string 12")
loo_Json.UpdateString("anchorCaseSensitive","sample string 13")
loo_Json.UpdateString("anchorHorizontalAlignment","sample string 14")
loo_Json.UpdateString("paymentItemCode","sample string 15")
loo_Json.UpdateString("paymentItemDescription","sample string 16")
loo_Json.UpdateString("paymentItemName","sample string 17")
loo_Json.UpdateString("height","sample string 18")
loo_Json.UpdateString("width","sample string 19")
loo_Json.UpdateString("customTabId","sample string 20")
loo_Json.UpdateString("initialValue","sample string 21")
loo_Json.UpdateString("includedInEmail","sample string 22")
loo_Json.UpdateString("disableAutoSize","sample string 23")
loo_Json.UpdateString("concealValueOnDocument","sample string 24")
loo_Json.UpdateString("locked","sample string 25")
loo_Json.UpdateString("required","sample string 26")
loo_Json.UpdateString("shared","sample string 27")
loo_Json.UpdateString("collaborative","sample string 28")
loo_Json.UpdateString("requireInitialOnSharedChange","sample string 29")
loo_Json.UpdateString("requireAll","sample string 30")
loo_Json.UpdateString("items[0]","sample string 1")
loo_Json.UpdateString("tabLabel","sample string 31")
loo_Json.UpdateString("maximumLength","sample string 32")
loo_Json.UpdateString("scaleValue","sample string 33")
loo_Json.UpdateString("name","sample string 34")
loo_Json.UpdateString("type","sample string 35")
loo_Json.UpdateString("validationMessage","sample string 36")
loo_Json.UpdateString("validationPattern","sample string 37")
loo_Json.UpdateString("lastModifiedByUserId","sample string 38")
loo_Json.UpdateString("lastModifiedByDisplayName","sample string 39")
loo_Json.UpdateString("lastModified","sample string 40")
loo_Json.UpdateString("createdByUserId","sample string 41")
loo_Json.UpdateString("createdByDisplayName","sample string 42")
loo_Json.UpdateString("editable","sample string 43")
loo_Json.UpdateString("mergeField.configurationType","sample string 1")
loo_Json.UpdateString("mergeField.path","sample string 2")
loo_Json.UpdateString("mergeField.writeBack","sample string 3")
loo_Json.UpdateString("mergeField.allowSenderToEdit","sample string 4")
loo_Json.UpdateString("mergeField.row","sample string 5")
loo_Json.UpdateString("stampType","sample string 44")
loo_Json.UpdateString("selected","sample string 45")

// 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}}/tab_definitions/{{customTabId}}",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 '{
  "font": "sample string 1",
  "bold": "sample string 2",
  "italic": "sample string 3",
  "underline": "sample string 4",
  "fontColor": "sample string 5",
  "fontSize": "sample string 6",
  "anchor": "sample string 7",
  "anchorXOffset": "sample string 8",
  "anchorYOffset": "sample string 9",
  "anchorUnits": "sample string 10",
  "anchorIgnoreIfNotPresent": "sample string 11",
  "anchorMatchWholeWord": "sample string 12",
  "anchorCaseSensitive": "sample string 13",
  "anchorHorizontalAlignment": "sample string 14",
  "paymentItemCode": "sample string 15",
  "paymentItemDescription": "sample string 16",
  "paymentItemName": "sample string 17",
  "height": "sample string 18",
  "width": "sample string 19",
  "customTabId": "sample string 20",
  "initialValue": "sample string 21",
  "includedInEmail": "sample string 22",
  "disableAutoSize": "sample string 23",
  "concealValueOnDocument": "sample string 24",
  "locked": "sample string 25",
  "required": "sample string 26",
  "shared": "sample string 27",
  "collaborative": "sample string 28",
  "requireInitialOnSharedChange": "sample string 29",
  "requireAll": "sample string 30",
  "items": [
    "sample string 1"
  ],
  "tabLabel": "sample string 31",
  "maximumLength": "sample string 32",
  "scaleValue": "sample string 33",
  "name": "sample string 34",
  "type": "sample string 35",
  "validationMessage": "sample string 36",
  "validationPattern": "sample string 37",
  "lastModifiedByUserId": "sample string 38",
  "lastModifiedByDisplayName": "sample string 39",
  "lastModified": "sample string 40",
  "createdByUserId": "sample string 41",
  "createdByDisplayName": "sample string 42",
  "editable": "sample string 43",
  "mergeField": {
    "configurationType": "sample string 1",
    "path": "sample string 2",
    "writeBack": "sample string 3",
    "allowSenderToEdit": "sample string 4",
    "row": "sample string 5"
  },
  "stampType": "sample string 44",
  "selected": "sample string 45"
}'
https://domain.com/v2.1/accounts/{{accountId}}/tab_definitions/{{customTabId}}

Postman Collection Item JSON

{
  "name": "Updates custom tab information.\n\n",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"font\": \"sample string 1\",\n  \"bold\": \"sample string 2\",\n  \"italic\": \"sample string 3\",\n  \"underline\": \"sample string 4\",\n  \"fontColor\": \"sample string 5\",\n  \"fontSize\": \"sample string 6\",\n  \"anchor\": \"sample string 7\",\n  \"anchorXOffset\": \"sample string 8\",\n  \"anchorYOffset\": \"sample string 9\",\n  \"anchorUnits\": \"sample string 10\",\n  \"anchorIgnoreIfNotPresent\": \"sample string 11\",\n  \"anchorMatchWholeWord\": \"sample string 12\",\n  \"anchorCaseSensitive\": \"sample string 13\",\n  \"anchorHorizontalAlignment\": \"sample string 14\",\n  \"paymentItemCode\": \"sample string 15\",\n  \"paymentItemDescription\": \"sample string 16\",\n  \"paymentItemName\": \"sample string 17\",\n  \"height\": \"sample string 18\",\n  \"width\": \"sample string 19\",\n  \"customTabId\": \"sample string 20\",\n  \"initialValue\": \"sample string 21\",\n  \"includedInEmail\": \"sample string 22\",\n  \"disableAutoSize\": \"sample string 23\",\n  \"concealValueOnDocument\": \"sample string 24\",\n  \"locked\": \"sample string 25\",\n  \"required\": \"sample string 26\",\n  \"shared\": \"sample string 27\",\n  \"collaborative\": \"sample string 28\",\n  \"requireInitialOnSharedChange\": \"sample string 29\",\n  \"requireAll\": \"sample string 30\",\n  \"items\": [\n    \"sample string 1\"\n  ],\n  \"tabLabel\": \"sample string 31\",\n  \"maximumLength\": \"sample string 32\",\n  \"scaleValue\": \"sample string 33\",\n  \"name\": \"sample string 34\",\n  \"type\": \"sample string 35\",\n  \"validationMessage\": \"sample string 36\",\n  \"validationPattern\": \"sample string 37\",\n  \"lastModifiedByUserId\": \"sample string 38\",\n  \"lastModifiedByDisplayName\": \"sample string 39\",\n  \"lastModified\": \"sample string 40\",\n  \"createdByUserId\": \"sample string 41\",\n  \"createdByDisplayName\": \"sample string 42\",\n  \"editable\": \"sample string 43\",\n  \"mergeField\": {\n    \"configurationType\": \"sample string 1\",\n    \"path\": \"sample string 2\",\n    \"writeBack\": \"sample string 3\",\n    \"allowSenderToEdit\": \"sample string 4\",\n    \"row\": \"sample string 5\"\n  },\n  \"stampType\": \"sample string 44\",\n  \"selected\": \"sample string 45\"\n}"
    },
    "url": {
      "raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/tab_definitions/{{customTabId}}",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "tab_definitions",
        "{{customTabId}}"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}"
        },
        {
          "key": "customTabId",
          "value": "{{customTabId}}"
        }
      ]
    },
    "description": "Updates the information in a custom tab for the specified account."
  },
  "response": [
  ]
}