Back to Collection Items
func chilkatTest() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = CkoHttp()!
var success: Bool
// 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"
// }
let json = CkoJsonObject()!
json.update("font", value: "sample string 1")
json.update("bold", value: "sample string 2")
json.update("italic", value: "sample string 3")
json.update("underline", value: "sample string 4")
json.update("fontColor", value: "sample string 5")
json.update("fontSize", value: "sample string 6")
json.update("anchor", value: "sample string 7")
json.update("anchorXOffset", value: "sample string 8")
json.update("anchorYOffset", value: "sample string 9")
json.update("anchorUnits", value: "sample string 10")
json.update("anchorIgnoreIfNotPresent", value: "sample string 11")
json.update("anchorMatchWholeWord", value: "sample string 12")
json.update("anchorCaseSensitive", value: "sample string 13")
json.update("anchorHorizontalAlignment", value: "sample string 14")
json.update("paymentItemCode", value: "sample string 15")
json.update("paymentItemDescription", value: "sample string 16")
json.update("paymentItemName", value: "sample string 17")
json.update("height", value: "sample string 18")
json.update("width", value: "sample string 19")
json.update("customTabId", value: "sample string 20")
json.update("initialValue", value: "sample string 21")
json.update("includedInEmail", value: "sample string 22")
json.update("disableAutoSize", value: "sample string 23")
json.update("concealValueOnDocument", value: "sample string 24")
json.update("locked", value: "sample string 25")
json.update("required", value: "sample string 26")
json.update("shared", value: "sample string 27")
json.update("collaborative", value: "sample string 28")
json.update("items[0]", value: "sample string 1")
json.update("tabLabel", value: "sample string 29")
json.update("maximumLength", value: "sample string 30")
json.update("scaleValue", value: "sample string 31")
json.update("name", value: "sample string 32")
json.update("type", value: "sample string 33")
json.update("validationMessage", value: "sample string 34")
json.update("validationPattern", value: "sample string 35")
json.update("lastModifiedByUserId", value: "sample string 36")
json.update("lastModifiedByDisplayName", value: "sample string 37")
json.update("lastModified", value: "sample string 38")
json.update("createdByUserId", value: "sample string 39")
json.update("createdByDisplayName", value: "sample string 40")
json.update("editable", value: "sample string 41")
json.update("mergeField.configurationType", value: "sample string 1")
json.update("mergeField.path", value: "sample string 2")
json.update("mergeField.writeBack", value: "sample string 3")
json.update("mergeField.allowSenderToEdit", value: "sample string 4")
json.update("mergeField.row", value: "sample string 5")
json.update("stampType", value: "sample string 42")
json.update("selected", value: "sample string 43")
// Adds the "Authorization: Bearer {{accessToken}}" header.
http.authToken = "{{accessToken}}"
http.setRequestHeader("Accept", value: "application/json")
let sbRequestBody = CkoStringBuilder()!
json.emitSb(sbRequestBody)
var resp: CkoHttpResponse? = http.pTextSb("PUT", url: "https://domain.com/v2.1/accounts/{{accountId}}/tab_definitions/{{customTabId}}", textData: sbRequestBody, charset: "utf-8", contentType: "application/json", md5: false, gzip: false)
if http.lastMethodSuccess == false {
print("\(http.lastErrorText!)")
return
}
print("\(resp!.statusCode.intValue)")
print("\(resp!.bodyStr!)")
resp = nil
}
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": [
]
}