Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Handle hoJson
Variant vSbRequestBody
Handle hoSbRequestBody
Variant vResp
Handle hoResp
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
// 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",
// "items": [
// "sample string 1"
// ],
// "tabLabel": "sample string 29",
// "maximumLength": "sample string 30",
// "scaleValue": "sample string 31",
// "name": "sample string 32",
// "type": "sample string 33",
// "validationMessage": "sample string 34",
// "validationPattern": "sample string 35",
// "lastModifiedByUserId": "sample string 36",
// "lastModifiedByDisplayName": "sample string 37",
// "lastModified": "sample string 38",
// "createdByUserId": "sample string 39",
// "createdByDisplayName": "sample string 40",
// "editable": "sample string 41",
// "mergeField": {
// "configurationType": "sample string 1",
// "path": "sample string 2",
// "writeBack": "sample string 3",
// "allowSenderToEdit": "sample string 4",
// "row": "sample string 5"
// },
// "stampType": "sample string 42",
// "selected": "sample string 43"
// }
Get Create (RefClass(cComChilkatJsonObject)) To hoJson
If (Not(IsComObjectCreated(hoJson))) Begin
Send CreateComObject of hoJson
End
Get ComUpdateString Of hoJson "font" "sample string 1" To iSuccess
Get ComUpdateString Of hoJson "bold" "sample string 2" To iSuccess
Get ComUpdateString Of hoJson "italic" "sample string 3" To iSuccess
Get ComUpdateString Of hoJson "underline" "sample string 4" To iSuccess
Get ComUpdateString Of hoJson "fontColor" "sample string 5" To iSuccess
Get ComUpdateString Of hoJson "fontSize" "sample string 6" To iSuccess
Get ComUpdateString Of hoJson "anchor" "sample string 7" To iSuccess
Get ComUpdateString Of hoJson "anchorXOffset" "sample string 8" To iSuccess
Get ComUpdateString Of hoJson "anchorYOffset" "sample string 9" To iSuccess
Get ComUpdateString Of hoJson "anchorUnits" "sample string 10" To iSuccess
Get ComUpdateString Of hoJson "anchorIgnoreIfNotPresent" "sample string 11" To iSuccess
Get ComUpdateString Of hoJson "anchorMatchWholeWord" "sample string 12" To iSuccess
Get ComUpdateString Of hoJson "anchorCaseSensitive" "sample string 13" To iSuccess
Get ComUpdateString Of hoJson "anchorHorizontalAlignment" "sample string 14" To iSuccess
Get ComUpdateString Of hoJson "paymentItemCode" "sample string 15" To iSuccess
Get ComUpdateString Of hoJson "paymentItemDescription" "sample string 16" To iSuccess
Get ComUpdateString Of hoJson "paymentItemName" "sample string 17" To iSuccess
Get ComUpdateString Of hoJson "height" "sample string 18" To iSuccess
Get ComUpdateString Of hoJson "width" "sample string 19" To iSuccess
Get ComUpdateString Of hoJson "customTabId" "sample string 20" To iSuccess
Get ComUpdateString Of hoJson "initialValue" "sample string 21" To iSuccess
Get ComUpdateString Of hoJson "includedInEmail" "sample string 22" To iSuccess
Get ComUpdateString Of hoJson "disableAutoSize" "sample string 23" To iSuccess
Get ComUpdateString Of hoJson "concealValueOnDocument" "sample string 24" To iSuccess
Get ComUpdateString Of hoJson "locked" "sample string 25" To iSuccess
Get ComUpdateString Of hoJson "required" "sample string 26" To iSuccess
Get ComUpdateString Of hoJson "shared" "sample string 27" To iSuccess
Get ComUpdateString Of hoJson "collaborative" "sample string 28" To iSuccess
Get ComUpdateString Of hoJson "items[0]" "sample string 1" To iSuccess
Get ComUpdateString Of hoJson "tabLabel" "sample string 29" To iSuccess
Get ComUpdateString Of hoJson "maximumLength" "sample string 30" To iSuccess
Get ComUpdateString Of hoJson "scaleValue" "sample string 31" To iSuccess
Get ComUpdateString Of hoJson "name" "sample string 32" To iSuccess
Get ComUpdateString Of hoJson "type" "sample string 33" To iSuccess
Get ComUpdateString Of hoJson "validationMessage" "sample string 34" To iSuccess
Get ComUpdateString Of hoJson "validationPattern" "sample string 35" To iSuccess
Get ComUpdateString Of hoJson "lastModifiedByUserId" "sample string 36" To iSuccess
Get ComUpdateString Of hoJson "lastModifiedByDisplayName" "sample string 37" To iSuccess
Get ComUpdateString Of hoJson "lastModified" "sample string 38" To iSuccess
Get ComUpdateString Of hoJson "createdByUserId" "sample string 39" To iSuccess
Get ComUpdateString Of hoJson "createdByDisplayName" "sample string 40" To iSuccess
Get ComUpdateString Of hoJson "editable" "sample string 41" To iSuccess
Get ComUpdateString Of hoJson "mergeField.configurationType" "sample string 1" To iSuccess
Get ComUpdateString Of hoJson "mergeField.path" "sample string 2" To iSuccess
Get ComUpdateString Of hoJson "mergeField.writeBack" "sample string 3" To iSuccess
Get ComUpdateString Of hoJson "mergeField.allowSenderToEdit" "sample string 4" To iSuccess
Get ComUpdateString Of hoJson "mergeField.row" "sample string 5" To iSuccess
Get ComUpdateString Of hoJson "stampType" "sample string 42" To iSuccess
Get ComUpdateString Of hoJson "selected" "sample string 43" To iSuccess
// Adds the "Authorization: Bearer {{accessToken}}" header.
Set ComAuthToken Of hoHttp To "{{accessToken}}"
Send ComSetRequestHeader To hoHttp "Accept" "application/json"
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbRequestBody
If (Not(IsComObjectCreated(hoSbRequestBody))) Begin
Send CreateComObject of hoSbRequestBody
End
Get pvComObject of hoSbRequestBody to vSbRequestBody
Get ComEmitSb Of hoJson vSbRequestBody To iSuccess
Get pvComObject of hoSbRequestBody to vSbRequestBody
Get ComPTextSb Of hoHttp "PUT" "https://domain.com/v2.1/accounts/{{accountId}}/tab_definitions/{{customTabId}}" vSbRequestBody "utf-8" "application/json" False False To vResp
If (IsComObject(vResp)) Begin
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
Set pvComObject Of hoResp To vResp
End
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComStatusCode Of hoResp To iTemp1
Showln iTemp1
Get ComBodyStr Of hoResp To sTemp1
Showln sTemp1
Send Destroy of hoResp
End_Procedure
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",
"items": [
"sample string 1"
],
"tabLabel": "sample string 29",
"maximumLength": "sample string 30",
"scaleValue": "sample string 31",
"name": "sample string 32",
"type": "sample string 33",
"validationMessage": "sample string 34",
"validationPattern": "sample string 35",
"lastModifiedByUserId": "sample string 36",
"lastModifiedByDisplayName": "sample string 37",
"lastModified": "sample string 38",
"createdByUserId": "sample string 39",
"createdByDisplayName": "sample string 40",
"editable": "sample string 41",
"mergeField": {
"configurationType": "sample string 1",
"path": "sample string 2",
"writeBack": "sample string 3",
"allowSenderToEdit": "sample string 4",
"row": "sample string 5"
},
"stampType": "sample string 42",
"selected": "sample string 43"
}'
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 \"items\": [\n \"sample string 1\"\n ],\n \"tabLabel\": \"sample string 29\",\n \"maximumLength\": \"sample string 30\",\n \"scaleValue\": \"sample string 31\",\n \"name\": \"sample string 32\",\n \"type\": \"sample string 33\",\n \"validationMessage\": \"sample string 34\",\n \"validationPattern\": \"sample string 35\",\n \"lastModifiedByUserId\": \"sample string 36\",\n \"lastModifiedByDisplayName\": \"sample string 37\",\n \"lastModified\": \"sample string 38\",\n \"createdByUserId\": \"sample string 39\",\n \"createdByDisplayName\": \"sample string 40\",\n \"editable\": \"sample string 41\",\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 42\",\n \"selected\": \"sample string 43\"\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}}",
"type": "string"
},
{
"key": "customTabId",
"value": "{{customTabId}}",
"type": "string"
}
]
},
"description": "Updates the information in a custom tab for the specified account."
},
"response": [
]
}