Chilkat Online Tools

Unicode C++ / Support API / Update Macro

Back to Collection Items

void ChilkatSample(void)
    {
    http.put_BasicAuth(true);    http.put_Login(L"login");    http.put_Password(L"password");    json.UpdateString(L"macro.title",L"<string>");    json.UpdateString(L"macro.actions[0].field",L"<string>");    json.UpdateString(L"macro.actions[0].value",L"<string>");    json.UpdateString(L"macro.actions[1].field",L"<string>");    json.UpdateString(L"macro.actions[1].value",L"<string>");    json.UpdateString(L"macro.active",L"<boolean>");    json.UpdateString(L"macro.description",L"<string>");    json.UpdateString(L"macro.restriction.id",L"<integer>");    json.UpdateString(L"macro.restriction.ids[0]",L"<integer>");    json.UpdateString(L"macro.restriction.ids[1]",L"<integer>");    json.UpdateString(L"macro.restriction.type",L"<string>");    json.UpdateString(L"macro.restriction.dolore_dc",L"velit irure");    json.UpdateInt(L"macro.restriction.ullamco368",46888012);    json.EmitSb(sbRequestBody);    resp->GetBodySb(sbResponseBody);    jResp.LoadSb(sbResponseBody);    jResp.put_EmitCompact(false);    jResp.put_I(i);    field = jResp.stringOf(L"macro.actions[i].field");    value = jResp.stringOf(L"macro.actions[i].value");    i = i + 1;
    }

Curl Command

curl  -u login:password -X PUT
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "macro": {
    "title": "<string>",
    "actions": [
      {
        "field": "<string>",
        "value": "<string>"
      },
      {
        "field": "<string>",
        "value": "<string>"
      }
    ],
    "active": "<boolean>",
    "description": "<string>",
    "restriction": {
      "id": "<integer>",
      "ids": [
        "<integer>",
        "<integer>"
      ],
      "type": "<string>",
      "dolore_dc": "velit irure",
      "ullamco368": 46888012
    }
  }
}'
https://example.zendesk.com/api/v2/macros/:macro_id

Postman Collection Item JSON

{
  "name": "Update Macro",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"macro\": {\n    \"title\": \"<string>\",\n    \"actions\": [\n      {\n        \"field\": \"<string>\",\n        \"value\": \"<string>\"\n      },\n      {\n        \"field\": \"<string>\",\n        \"value\": \"<string>\"\n      }\n    ],\n    \"active\": \"<boolean>\",\n    \"description\": \"<string>\",\n    \"restriction\": {\n      \"id\": \"<integer>\",\n      \"ids\": [\n        \"<integer>\",\n        \"<integer>\"\n      ],\n      \"type\": \"<string>\",\n      \"dolore_dc\": \"velit irure\",\n      \"ullamco368\": 46888012\n    }\n  }\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/v2/macros/:macro_id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "macros",
        ":macro_id"
      ],
      "variable": [
        {
          "key": "macro_id",
          "value": "<integer>"
        }
      ]
    },
    "description": "#### Allowed For\n* Agents\n"
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"macro\": {\n    \"title\": \"<string>\",\n    \"actions\": [\n      {\n        \"field\": \"<string>\",\n        \"value\": \"<string>\"\n      },\n      {\n        \"field\": \"<string>\",\n        \"value\": \"<string>\"\n      }\n    ],\n    \"active\": \"<boolean>\",\n    \"description\": \"<string>\",\n    \"restriction\": {\n      \"id\": \"<integer>\",\n      \"ids\": [\n        \"<integer>\",\n        \"<integer>\"\n      ],\n      \"type\": \"<string>\",\n      \"dolore_dc\": \"velit irure\",\n      \"ullamco368\": 46888012\n    }\n  }\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/macros/:macro_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "macros",
            ":macro_id"
          ],
          "variable": [
            {
              "key": "macro_id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"macro\": {\n    \"actions\": [\n      {\n        \"field\": \"<string>\",\n        \"value\": \"<string>\"\n      },\n      {\n        \"field\": \"<string>\",\n        \"value\": \"<string>\"\n      }\n    ],\n    \"title\": \"<string>\",\n    \"active\": \"<boolean>\",\n    \"created_at\": \"<dateTime>\",\n    \"default\": \"<boolean>\",\n    \"description\": \"<string>\",\n    \"id\": \"<integer>\",\n    \"position\": \"<integer>\",\n    \"restriction\": {\n      \"utc\": -57663786.73485631,\n      \"sint_c\": 56026975.00248328\n    },\n    \"updated_at\": \"<dateTime>\",\n    \"url\": \"<string>\",\n    \"app_installation\": \"<string>\",\n    \"categories\": \"<string>\",\n    \"permissions\": \"<string>\",\n    \"usage_1h\": \"<integer>\",\n    \"usage_7d\": \"<integer>\",\n    \"usage_24h\": \"<integer>\",\n    \"usage_30d\": \"<integer>\"\n  }\n}"
    }
  ]
}