Chilkat Online Tools

VB6 / DocuSign REST API / Creates a custom tab.

Back to Collection Items

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

Dim http As New ChilkatHttp
Dim success As Long

' 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"
' }

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

' Adds the "Authorization: Bearer {{accessToken}}" header.
http.AuthToken = "{{accessToken}}"
http.SetRequestHeader "Accept","application/json"

Dim resp As ChilkatHttpResponse
Set resp = http.PostJson3("https://domain.com/v2.1/accounts/{{accountId}}/tab_definitions","application/json",json)
If (http.LastMethodSuccess = 0) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

Debug.Print resp.StatusCode
Debug.Print resp.BodyStr

Curl Command

curl -X POST
	-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

Postman Collection Item JSON

{
  "name": "Creates a custom tab.",
  "request": {
    "method": "POST",
    "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",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "tab_definitions"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}"
        }
      ]
    },
    "description": "Creates a tab with pre-defined properties, such as a text tab with a certain font type and validation pattern. Users can access the custom tabs when sending documents through the DocuSign web application.\n\nCustom tabs can be created for approve, checkbox, company, date, date signed, decline, email, email address, envelope ID, first name, formula, full name, initial here, last name, list, note, number, radio, sign here, signer attachment, SSN, text, title, and zip tabs."
  },
  "response": [
  ]
}