unicodeC / DocuSign REST API / Updates custom tab information.
Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkHttpResponseW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkJsonObjectW json;
HCkStringBuilderW sbRequestBody;
HCkHttpResponseW resp;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
// 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"
// }
json = CkJsonObjectW_Create();
CkJsonObjectW_UpdateString(json,L"font",L"sample string 1");
CkJsonObjectW_UpdateString(json,L"bold",L"sample string 2");
CkJsonObjectW_UpdateString(json,L"italic",L"sample string 3");
CkJsonObjectW_UpdateString(json,L"underline",L"sample string 4");
CkJsonObjectW_UpdateString(json,L"fontColor",L"sample string 5");
CkJsonObjectW_UpdateString(json,L"fontSize",L"sample string 6");
CkJsonObjectW_UpdateString(json,L"anchor",L"sample string 7");
CkJsonObjectW_UpdateString(json,L"anchorXOffset",L"sample string 8");
CkJsonObjectW_UpdateString(json,L"anchorYOffset",L"sample string 9");
CkJsonObjectW_UpdateString(json,L"anchorUnits",L"sample string 10");
CkJsonObjectW_UpdateString(json,L"anchorIgnoreIfNotPresent",L"sample string 11");
CkJsonObjectW_UpdateString(json,L"anchorMatchWholeWord",L"sample string 12");
CkJsonObjectW_UpdateString(json,L"anchorCaseSensitive",L"sample string 13");
CkJsonObjectW_UpdateString(json,L"anchorHorizontalAlignment",L"sample string 14");
CkJsonObjectW_UpdateString(json,L"paymentItemCode",L"sample string 15");
CkJsonObjectW_UpdateString(json,L"paymentItemDescription",L"sample string 16");
CkJsonObjectW_UpdateString(json,L"paymentItemName",L"sample string 17");
CkJsonObjectW_UpdateString(json,L"height",L"sample string 18");
CkJsonObjectW_UpdateString(json,L"width",L"sample string 19");
CkJsonObjectW_UpdateString(json,L"customTabId",L"sample string 20");
CkJsonObjectW_UpdateString(json,L"initialValue",L"sample string 21");
CkJsonObjectW_UpdateString(json,L"includedInEmail",L"sample string 22");
CkJsonObjectW_UpdateString(json,L"disableAutoSize",L"sample string 23");
CkJsonObjectW_UpdateString(json,L"concealValueOnDocument",L"sample string 24");
CkJsonObjectW_UpdateString(json,L"locked",L"sample string 25");
CkJsonObjectW_UpdateString(json,L"required",L"sample string 26");
CkJsonObjectW_UpdateString(json,L"shared",L"sample string 27");
CkJsonObjectW_UpdateString(json,L"collaborative",L"sample string 28");
CkJsonObjectW_UpdateString(json,L"requireInitialOnSharedChange",L"sample string 29");
CkJsonObjectW_UpdateString(json,L"requireAll",L"sample string 30");
CkJsonObjectW_UpdateString(json,L"items[0]",L"sample string 1");
CkJsonObjectW_UpdateString(json,L"tabLabel",L"sample string 31");
CkJsonObjectW_UpdateString(json,L"maximumLength",L"sample string 32");
CkJsonObjectW_UpdateString(json,L"scaleValue",L"sample string 33");
CkJsonObjectW_UpdateString(json,L"name",L"sample string 34");
CkJsonObjectW_UpdateString(json,L"type",L"sample string 35");
CkJsonObjectW_UpdateString(json,L"validationMessage",L"sample string 36");
CkJsonObjectW_UpdateString(json,L"validationPattern",L"sample string 37");
CkJsonObjectW_UpdateString(json,L"lastModifiedByUserId",L"sample string 38");
CkJsonObjectW_UpdateString(json,L"lastModifiedByDisplayName",L"sample string 39");
CkJsonObjectW_UpdateString(json,L"lastModified",L"sample string 40");
CkJsonObjectW_UpdateString(json,L"createdByUserId",L"sample string 41");
CkJsonObjectW_UpdateString(json,L"createdByDisplayName",L"sample string 42");
CkJsonObjectW_UpdateString(json,L"editable",L"sample string 43");
CkJsonObjectW_UpdateString(json,L"mergeField.configurationType",L"sample string 1");
CkJsonObjectW_UpdateString(json,L"mergeField.path",L"sample string 2");
CkJsonObjectW_UpdateString(json,L"mergeField.writeBack",L"sample string 3");
CkJsonObjectW_UpdateString(json,L"mergeField.allowSenderToEdit",L"sample string 4");
CkJsonObjectW_UpdateString(json,L"mergeField.row",L"sample string 5");
CkJsonObjectW_UpdateString(json,L"stampType",L"sample string 44");
CkJsonObjectW_UpdateString(json,L"selected",L"sample string 45");
// Adds the "Authorization: Bearer {{accessToken}}" header.
CkHttpW_putAuthToken(http,L"{{accessToken}}");
CkHttpW_SetRequestHeader(http,L"Accept",L"application/json");
sbRequestBody = CkStringBuilderW_Create();
CkJsonObjectW_EmitSb(json,sbRequestBody);
resp = CkHttpW_PTextSb(http,L"PUT",L"https://domain.com/v2.1/accounts/{{accountId}}/tab_definitions/{{customTabId}}",sbRequestBody,L"utf-8",L"application/json",FALSE,FALSE);
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(json);
CkStringBuilderW_Dispose(sbRequestBody);
return;
}
wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
CkHttpResponseW_Dispose(resp);
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(json);
CkStringBuilderW_Dispose(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": [
]
}