Chilkat Online Tools

Delphi (DLL) / Support API / Update Many Automations

Back to Collection Items

var

begin
CkHttp_putBasicAuth(http,True);CkHttp_putLogin(http,'login');CkHttp_putPassword(http,'password');CkHttpResponse_GetBodySb(resp,sbResponseBody);CkJsonObject_LoadSb(jResp,sbResponseBody);CkJsonObject_putEmitCompact(jResp,False);CkJsonObject_putI(jResp,i);active := CkJsonObject__stringOf(jResp,'automations[i].active');created_at := CkJsonObject__stringOf(jResp,'automations[i].created_at');default := CkJsonObject__stringOf(jResp,'automations[i].default');id := CkJsonObject__stringOf(jResp,'automations[i].id');position := CkJsonObject__stringOf(jResp,'automations[i].position');raw_title := CkJsonObject__stringOf(jResp,'automations[i].raw_title');title := CkJsonObject__stringOf(jResp,'automations[i].title');updated_at := CkJsonObject__stringOf(jResp,'automations[i].updated_at');j := 0;count_j := CkJsonObject_SizeOfArray(jResp,'automations[i].actions');CkJsonObject_putJ(jResp,j);field := CkJsonObject__stringOf(jResp,'automations[i].actions[j].field');value := CkJsonObject__stringOf(jResp,'automations[i].actions[j].value');j := j + 1;j := 0;count_j := CkJsonObject_SizeOfArray(jResp,'automations[i].conditions.all');CkJsonObject_putJ(jResp,j);field := CkJsonObject__stringOf(jResp,'automations[i].conditions.all[j].field');operator := CkJsonObject__stringOf(jResp,'automations[i].conditions.all[j].operator');value := CkJsonObject__stringOf(jResp,'automations[i].conditions.all[j].value');j := j + 1;j := 0;count_j := CkJsonObject_SizeOfArray(jResp,'automations[i].conditions.any');CkJsonObject_putJ(jResp,j);field := CkJsonObject__stringOf(jResp,'automations[i].conditions.any[j].field');operator := CkJsonObject__stringOf(jResp,'automations[i].conditions.any[j].operator');value := CkJsonObject__stringOf(jResp,'automations[i].conditions.any[j].value');j := j + 1;i := i + 1;


Curl Command

curl  -u login:password -X PUT
	-H "Accept: application/json"
https://example.zendesk.com/api/v2/automations/update_many

Postman Collection Item JSON

{
  "name": "Update Many Automations",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v2/automations/update_many",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "automations",
        "update_many"
      ]
    },
    "description": "**Note**: You might be restricted from updating some default automations. If included in a bulk update, the unrestricted automations will be updated.\n\n#### Allowed For\n\n* Agents\n\n#### Request Parameters\n\nThe PUT request expects an `automations` object that lists the automations to update.\n\nEach automation may have the following properties:\n\n| Name     | Mandatory | Description\n| -------- | --------- | -----------\n| id       | yes       | The ID of the automation to update\n| position | no        | The new position of the automation\n| active   | no        | The active status of the automation (true or false)\n\n#### Example Request\n\n```js\n{\n  \"automations\": [\n    {\"id\": 25, \"position\": 3},\n    {\"id\": 23, \"position\": 5},\n    {\"id\": 27, \"position\": 9},\n    {\"id\": 22, \"position\": 7}\n  ]\n}\n```\n"
  },
  "response": [
    {
      "name": "Success response",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/automations/update_many",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "automations",
            "update_many"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"automations\": [\n    {\n      \"actions\": [\n        {\n          \"field\": \"<string>\",\n          \"value\": \"<string>\"\n        },\n        {\n          \"field\": \"<string>\",\n          \"value\": \"<string>\"\n        }\n      ],\n      \"active\": \"<boolean>\",\n      \"conditions\": {\n        \"all\": [\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          },\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          }\n        ],\n        \"any\": [\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          },\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          }\n        ]\n      },\n      \"created_at\": \"<dateTime>\",\n      \"default\": \"<boolean>\",\n      \"id\": \"<integer>\",\n      \"position\": \"<integer>\",\n      \"raw_title\": \"<string>\",\n      \"title\": \"<string>\",\n      \"updated_at\": \"<dateTime>\"\n    },\n    {\n      \"actions\": [\n        {\n          \"field\": \"<string>\",\n          \"value\": \"<string>\"\n        },\n        {\n          \"field\": \"<string>\",\n          \"value\": \"<string>\"\n        }\n      ],\n      \"active\": \"<boolean>\",\n      \"conditions\": {\n        \"all\": [\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          },\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          }\n        ],\n        \"any\": [\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          },\n          {\n            \"field\": \"<string>\",\n            \"operator\": \"<string>\",\n            \"value\": \"<string>\"\n          }\n        ]\n      },\n      \"created_at\": \"<dateTime>\",\n      \"default\": \"<boolean>\",\n      \"id\": \"<integer>\",\n      \"position\": \"<integer>\",\n      \"raw_title\": \"<string>\",\n      \"title\": \"<string>\",\n      \"updated_at\": \"<dateTime>\"\n    }\n  ],\n  \"count\": \"<integer>\",\n  \"next_page\": \"<string>\",\n  \"previous_page\": \"<string>\"\n}"
    }
  ]
}