zendesk_api 0.1.11 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. data/.gitignore +3 -0
  2. data/.travis.yml +1 -3
  3. data/Gemfile +24 -0
  4. data/Gemfile.lock +75 -10
  5. data/Procfile +1 -0
  6. data/Rakefile +10 -3
  7. data/Readme.md +65 -0
  8. data/bin/zendesk +26 -0
  9. data/config.ru +6 -0
  10. data/config/mongoid.yml +81 -0
  11. data/lib/zendesk_api/actions.rb +2 -2
  12. data/lib/zendesk_api/collection.rb +15 -4
  13. data/lib/zendesk_api/console/base.rb +12 -0
  14. data/lib/zendesk_api/console/console.rb +144 -0
  15. data/lib/zendesk_api/console/extensions.rb +183 -0
  16. data/lib/zendesk_api/console/options.rb +41 -0
  17. data/lib/zendesk_api/resource.rb +12 -1
  18. data/lib/zendesk_api/resources.rb +28 -8
  19. data/lib/zendesk_api/server/base.rb +119 -0
  20. data/lib/zendesk_api/server/docs/account_settings.md +145 -0
  21. data/lib/zendesk_api/server/docs/activity_stream.md +121 -0
  22. data/lib/zendesk_api/server/docs/attachments.md +73 -0
  23. data/lib/zendesk_api/server/docs/autocomplete.md +29 -0
  24. data/lib/zendesk_api/server/docs/categories.md +193 -0
  25. data/lib/zendesk_api/server/docs/custom_roles.md +88 -0
  26. data/lib/zendesk_api/server/docs/forum_subscriptions.md +139 -0
  27. data/lib/zendesk_api/server/docs/forums.md +229 -0
  28. data/lib/zendesk_api/server/docs/group_memberships.md +229 -0
  29. data/lib/zendesk_api/server/docs/groups.md +212 -0
  30. data/lib/zendesk_api/server/docs/introduction.md +159 -0
  31. data/lib/zendesk_api/server/docs/job_statuses.md +86 -0
  32. data/lib/zendesk_api/server/docs/locales.md +124 -0
  33. data/lib/zendesk_api/server/docs/macros.md +287 -0
  34. data/lib/zendesk_api/server/docs/organizations.md +253 -0
  35. data/lib/zendesk_api/server/docs/problems.md +117 -0
  36. data/lib/zendesk_api/server/docs/requests.md +256 -0
  37. data/lib/zendesk_api/server/docs/satisfaction_ratings.md +136 -0
  38. data/lib/zendesk_api/server/docs/search.md +106 -0
  39. data/lib/zendesk_api/server/docs/sharing_agreements.md +57 -0
  40. data/lib/zendesk_api/server/docs/side_loading.md +125 -0
  41. data/lib/zendesk_api/server/docs/suspended_tickets.md +182 -0
  42. data/lib/zendesk_api/server/docs/tags.md +36 -0
  43. data/lib/zendesk_api/server/docs/ticket_audits.md +657 -0
  44. data/lib/zendesk_api/server/docs/ticket_export.md +121 -0
  45. data/lib/zendesk_api/server/docs/ticket_fields.md +277 -0
  46. data/lib/zendesk_api/server/docs/ticket_import.md +65 -0
  47. data/lib/zendesk_api/server/docs/ticket_metrics.md +125 -0
  48. data/lib/zendesk_api/server/docs/tickets.md +622 -0
  49. data/lib/zendesk_api/server/docs/topic_comments.md +221 -0
  50. data/lib/zendesk_api/server/docs/topic_subscriptions.md +140 -0
  51. data/lib/zendesk_api/server/docs/topic_votes.md +154 -0
  52. data/lib/zendesk_api/server/docs/topics.md +335 -0
  53. data/lib/zendesk_api/server/docs/triggers.md +199 -0
  54. data/lib/zendesk_api/server/docs/user_identities.md +279 -0
  55. data/lib/zendesk_api/server/docs/users.md +400 -0
  56. data/lib/zendesk_api/server/docs/views.md +505 -0
  57. data/lib/zendesk_api/server/helper.rb +104 -0
  58. data/lib/zendesk_api/server/html_renderer.rb +98 -0
  59. data/lib/zendesk_api/server/models/user_request.rb +16 -0
  60. data/lib/zendesk_api/server/models/zlib_json.rb +13 -0
  61. data/lib/zendesk_api/server/public/config.rb +26 -0
  62. data/lib/zendesk_api/server/public/favicon.ico +0 -0
  63. data/lib/zendesk_api/server/public/images/glyphicons-halflings-white.png +0 -0
  64. data/lib/zendesk_api/server/public/images/glyphicons-halflings.png +0 -0
  65. data/lib/zendesk_api/server/public/images/spinner.gif +0 -0
  66. data/lib/zendesk_api/server/public/images/zendesk_developers_bg.png +0 -0
  67. data/lib/zendesk_api/server/public/images/zendesk_developers_header.png +0 -0
  68. data/lib/zendesk_api/server/public/javascripts/application.js +186 -0
  69. data/lib/zendesk_api/server/public/javascripts/bootstrap-alert.js +90 -0
  70. data/lib/zendesk_api/server/public/javascripts/bootstrap-button.js +96 -0
  71. data/lib/zendesk_api/server/public/javascripts/bootstrap-carousel.js +169 -0
  72. data/lib/zendesk_api/server/public/javascripts/bootstrap-collapse.js +157 -0
  73. data/lib/zendesk_api/server/public/javascripts/bootstrap-dropdown.js +100 -0
  74. data/lib/zendesk_api/server/public/javascripts/bootstrap-modal.js +218 -0
  75. data/lib/zendesk_api/server/public/javascripts/bootstrap-popover.js +98 -0
  76. data/lib/zendesk_api/server/public/javascripts/bootstrap-scrollspy.js +151 -0
  77. data/lib/zendesk_api/server/public/javascripts/bootstrap-tab.js +135 -0
  78. data/lib/zendesk_api/server/public/javascripts/bootstrap-tooltip.js +275 -0
  79. data/lib/zendesk_api/server/public/javascripts/bootstrap-transition.js +61 -0
  80. data/lib/zendesk_api/server/public/javascripts/bootstrap-typeahead.js +285 -0
  81. data/lib/zendesk_api/server/public/sass/screen.scss +102 -0
  82. data/lib/zendesk_api/server/public/sass/styles.scss +5 -0
  83. data/lib/zendesk_api/server/public/stylesheets/developer.screen.css +836 -0
  84. data/lib/zendesk_api/server/public/stylesheets/screen.css +129 -0
  85. data/lib/zendesk_api/server/public/stylesheets/styles.css +6208 -0
  86. data/lib/zendesk_api/server/templates/footer.haml +13 -0
  87. data/lib/zendesk_api/server/templates/header.haml +20 -0
  88. data/lib/zendesk_api/server/templates/index.haml +68 -0
  89. data/lib/zendesk_api/server/templates/layout.haml +44 -0
  90. data/lib/zendesk_api/server/templates/param.haml +4 -0
  91. data/lib/zendesk_api/server/templates/search.haml +23 -0
  92. data/lib/zendesk_api/server/templates/sidebar.haml +7 -0
  93. data/lib/zendesk_api/version.rb +1 -1
  94. data/spec/{association_spec.rb → core/association_spec.rb} +1 -1
  95. data/spec/{client_spec.rb → core/client_spec.rb} +1 -1
  96. data/spec/{collection_spec.rb → core/collection_spec.rb} +1 -1
  97. data/spec/{configuration_spec.rb → core/configuration_spec.rb} +1 -1
  98. data/spec/{create_resource_spec.rb → core/create_resource_spec.rb} +1 -1
  99. data/spec/{data_resource_spec.rb → core/data_resource_spec.rb} +1 -1
  100. data/spec/{inflection_spec.rb → core/inflection_spec.rb} +1 -1
  101. data/spec/{lru_cache_spec.rb → core/lru_cache_spec.rb} +1 -1
  102. data/spec/{middleware → core/middleware}/request/etag_cache_spec.rb +1 -1
  103. data/spec/{middleware → core/middleware}/request/retry_spec.rb +1 -1
  104. data/spec/{middleware → core/middleware}/request/test.jpg +0 -0
  105. data/spec/{middleware → core/middleware}/request/upload_spec.rb +1 -1
  106. data/spec/{middleware → core/middleware}/response/callback_spec.rb +1 -1
  107. data/spec/{middleware → core/middleware}/response/deflate_spec.rb +1 -1
  108. data/spec/{middleware → core/middleware}/response/gzip_spec.rb +1 -1
  109. data/spec/{middleware → core/middleware}/response/parse_iso_dates_spec.rb +1 -1
  110. data/spec/{read_resource_spec.rb → core/read_resource_spec.rb} +1 -1
  111. data/spec/{rescue_spec.rb → core/rescue_spec.rb} +1 -1
  112. data/spec/{resource_spec.rb → core/resource_spec.rb} +1 -1
  113. data/spec/{search_spec.rb → core/search_spec.rb} +1 -1
  114. data/spec/{spec_helper.rb → core/spec_helper.rb} +5 -5
  115. data/spec/{trackie_spec.rb → core/trackie_spec.rb} +1 -1
  116. data/{live → spec/live}/Readme.md +0 -0
  117. data/{live → spec/live}/activity_spec.rb +1 -1
  118. data/{live → spec/live}/audit_spec.rb +1 -1
  119. data/{live → spec/live}/bookmark_spec.rb +1 -1
  120. data/{live → spec/live}/category_spec.rb +1 -1
  121. data/{live → spec/live}/collection_spec.rb +1 -1
  122. data/{live → spec/live}/crm_spec.rb +1 -1
  123. data/{live → spec/live}/custom_role_spec.rb +1 -1
  124. data/{live → spec/live}/forum_spec.rb +1 -1
  125. data/{live → spec/live}/forum_subscription_spec.rb +1 -1
  126. data/{live → spec/live}/group_membership_spec.rb +1 -1
  127. data/{live → spec/live}/group_spec.rb +1 -1
  128. data/{live → spec/live}/identity_spec.rb +1 -1
  129. data/{live → spec/live}/locale_spec.rb +1 -1
  130. data/{live → spec/live}/macro_spec.rb +1 -1
  131. data/{live → spec/live}/mobile_device_spec.rb +1 -1
  132. data/{live → spec/live}/organization_spec.rb +1 -1
  133. data/{live → spec/live}/request_spec.rb +1 -1
  134. data/{live → spec/live}/satisfaction_rating_spec.rb +1 -1
  135. data/{live → spec/live}/setting_spec.rb +1 -1
  136. data/{live → spec/live}/suspended_ticket_spec.rb +1 -1
  137. data/{live → spec/live}/ticket_field_spec.rb +1 -1
  138. data/{live → spec/live}/ticket_metrics_spec.rb +1 -1
  139. data/{live → spec/live}/ticket_spec.rb +1 -1
  140. data/spec/live/topic_comment_spec.rb +24 -0
  141. data/{live → spec/live}/topic_spec.rb +1 -1
  142. data/{live → spec/live}/topic_subscription_spec.rb +1 -1
  143. data/{live → spec/live}/topic_vote_spec.rb +1 -1
  144. data/{live → spec/live}/upload_spec.rb +1 -1
  145. data/{live → spec/live}/user_spec.rb +1 -1
  146. data/{live → spec/live}/view_spec.rb +1 -1
  147. data/spec/macros/resource_macros.rb +1 -1
  148. data/spec/server/app_spec.rb +140 -0
  149. data/spec/server/helper_spec.rb +97 -0
  150. data/spec/server/html_renderer_spec.rb +130 -0
  151. data/spec/server/spec_helper.rb +43 -0
  152. metadata +198 -77
  153. data/live/topic_comment_spec.rb +0 -13
@@ -0,0 +1,335 @@
1
+ ## Topics
2
+
3
+ ### JSON Format
4
+ Topics are represented in JSON with the below attributes
5
+
6
+ | Name | Type | Read-only | Mandatory | Comment
7
+ | --------------- | ------- | --------- | --------- | -------
8
+ | id | integer | yes | no | Automatically assigned upon creation
9
+ | url | string | yes | no | The API url of this topic
10
+ | title | string | no | yes | The title of the topic
11
+ | body | string | no | yes | The unescaped body of the topic
12
+ | topic_type | string | yes | no | The type of topic. Either "articles", "ideas" or "questions"
13
+ | submitter_id | integer | no | no | The id of the user who submitted the topic
14
+ | updater_id | integer | no | no | The id of the person to last update the topic
15
+ | forum_id | integer | no | no | Forum that the topic is associated to
16
+ | locked | boolean | no | no | Whether comments are allowed
17
+ | pinned | boolean | no | no | If the topic is marked as pinned and hence eligible to show up on the front page
18
+ | highlighted | boolean | no | no | Set to true to highlight a topic within its forum
19
+ | answered | boolean | yes | no | Set to true if the topic is a question and it has been marked as answered.
20
+ | comments_count | integer | yes | no | THe number of comments on this topic
21
+ | position | integer | no | no | The position of this topic relative to other topics in the same forum
22
+ | tags | array | no | no | The tags set on the topic
23
+ | created_at | date | yes | no | The time the topic was created
24
+ | updated_at | date | yes | no | The time of the last update of the topic
25
+
26
+ #### Example
27
+ ```js
28
+ {
29
+ "id": 35436,
30
+ "url": "https://company.zendesk.com/api/v2/topics/35436.json",
31
+ "title": "How to Disassemble the ED209",
32
+ "body": "Carefully with very large pliers",
33
+ "topic_type": "articles",
34
+ "submitter_id": 116,
35
+ "updater_id": 116,
36
+ "forum_id": 1239,
37
+ "locked": true,
38
+ "pinned": false,
39
+ "locked": true,
40
+ "position": 1,
41
+ "tags": ["danger"]
42
+ "created_at": "2009-07-20T22:55:29Z",
43
+ "updated_at": "2011-05-05T10:38:52Z"
44
+ }
45
+ ```
46
+
47
+ ### List Topics
48
+ `GET /api/v2/topics.json`
49
+
50
+ `GET /api/v2/forums/{id}/topics.json`
51
+
52
+ `GET /api/v2/users/{id}/topics.json`
53
+
54
+ #### Allowed For:
55
+
56
+ * Admins on non-enterprise accounts
57
+ * Admins and agents will full forum access on enterprise accounts
58
+
59
+ #### Using curl
60
+
61
+ ```bash
62
+ curl https://{subdomain}.zendesk.com/api/v2/topics.json \
63
+ -v -u {email_address}:{password}
64
+ ```
65
+
66
+ #### Example Response
67
+
68
+ ```http
69
+ Status: 200 OK
70
+
71
+ {
72
+ "topics": [
73
+ {
74
+ "id": 35436,
75
+ "name": "FAQs",
76
+ "description:": "This topic contains all product FAQs",
77
+ "topic_type": "questions",
78
+ "category_id": null,
79
+ "organization_id": null,
80
+ "locale_id": null,
81
+ "locked": true,
82
+ "position": 4,
83
+ "access": "everybody",
84
+ "attachments": [
85
+ {
86
+ "id": 498483,
87
+ "name": "crash.log",
88
+ "content_url": "https://company.zendesk.com/attachments/crash.log",
89
+ "content_type": "text/plain",
90
+ "size": 2532,
91
+ "thumbnails": []
92
+ }
93
+ ],
94
+ "created_at": "2010-07-20T22:55:29Z",
95
+ "updated_at": "2012-03-05T10:38:52Z"
96
+ },
97
+ {
98
+ "id": 12,
99
+ ...
100
+ "created_at": "2011-07-20T04:31:29Z",
101
+ "updated_at": "2012-02-02T10:32:59Z"
102
+ }
103
+ ]
104
+ }
105
+ ```
106
+
107
+ ### Show Topic
108
+ `GET /api/v2/topics/{id}.json`
109
+
110
+ #### Allowed For:
111
+
112
+ * Users who are permitted to see the enclosing forum
113
+
114
+ #### Using curl
115
+
116
+ ```bash
117
+ curl https://{subdomain}.zendesk.com/api/v2/topics/{id}.json \
118
+ -v -u {email_address}:{password}
119
+ ```
120
+
121
+ #### Example Response
122
+
123
+ ```http
124
+ Status: 200 OK
125
+
126
+ {
127
+ "topic": {
128
+ "id": 35436,
129
+ "title": "How to Disassemble the ED209",
130
+ "body": "Carefully with very large pliers",
131
+ "topic_type": "articles",
132
+ "submitter_id": 116,
133
+ "updater_id": 116,
134
+ "forum_id": 1239,
135
+ "locked": true,
136
+ "pinned": false,
137
+ "locked": true,
138
+ "position": 1,
139
+ "tags": ["danger"],
140
+ "attachments": [
141
+ {
142
+ "id": 498483,
143
+ "name": "crash.log",
144
+ "content_url": "https://company.zendesk.com/attachments/crash.log",
145
+ "content_type": "text/plain",
146
+ "size": 2532,
147
+ "thumbnails": []
148
+ }
149
+ ],
150
+ "created_at": "2011-05-05T10:38:52Z",
151
+ "updated_at": "2011-05-05T10:38:52Z"
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### Create Topic
157
+ `POST /api/v2/topics.json`
158
+
159
+ #### Allowed For
160
+
161
+ * Admins, agents and users as permitted by the parent forum access settings
162
+
163
+ #### Using curl
164
+
165
+ ```bash
166
+ curl https://{subdomain}.zendesk.com/api/v2/topics.json \
167
+ -H "Content-Type: application/json" -v -u {email_address}:{password} -X POST \
168
+ -d '{"topic": {"forum_id": 12, "title": "My Topic", "body": "This is a test topic."}}'
169
+ ```
170
+
171
+ #### Example Response
172
+
173
+ ```http
174
+ Status: 201 Created
175
+ Location: https://{subdomain}.zendesk.com/api/v2/topics/{id}.json
176
+
177
+ {
178
+ "topic": {
179
+ "id": 35436,
180
+ "title": "My Topic",
181
+ "body": "Carefully with very large pliers",
182
+ "topic_type": "articles",
183
+ "submitter_id": 116,
184
+ "updater_id": 116,
185
+ "forum_id": 1239,
186
+ "locked": true,
187
+ "pinned": false,
188
+ "locked": true,
189
+ "position": 1,
190
+ "tags": ["danger"],
191
+ "attachments": [
192
+ {
193
+ "id": 498483,
194
+ "name": "crash.log",
195
+ "content_url": "https://company.zendesk.com/attachments/crash.log",
196
+ "content_type": "text/plain",
197
+ "size": 2532,
198
+ "thumbnails": []
199
+ }
200
+ ],
201
+ "created_at": "2011-05-05T10:38:52Z",
202
+ "updated_at": "2011-05-05T10:38:52Z"
203
+ }
204
+ }
205
+ ```
206
+
207
+ ### Show Multiple Topics
208
+ `POST /api/v2/topics/show_many.json?ids={ids}`
209
+
210
+ Accepts a comma separated list of topic ids to return.
211
+
212
+ #### Allowed For:
213
+
214
+ * Admins
215
+ * Agents
216
+
217
+ #### Using curl
218
+
219
+ ```bash
220
+ curl https://{subdomain}.zendesk.com/api/v2/topics/show_many.json?ids={id,id,id} \
221
+ -v -u {email_address}:{password} -X POST
222
+ ```
223
+
224
+ #### Example Response
225
+
226
+ ```http
227
+ Status: 200 OK
228
+
229
+ {
230
+ "topics": [
231
+ {
232
+ "id": 35436,
233
+ "name": "FAQs",
234
+ "description:": "This topic contains all product FAQs",
235
+ "topic_type": "questions",
236
+ "category_id": null,
237
+ "organization_id": null,
238
+ "locale_id": null,
239
+ "locked": true,
240
+ "position": 4,
241
+ "access": "everybody",
242
+ "attachments": [
243
+ {
244
+ "id": 498483,
245
+ "name": "crash.log",
246
+ "content_url": "https://company.zendesk.com/attachments/crash.log",
247
+ "content_type": "text/plain",
248
+ "size": 2532,
249
+ "thumbnails": []
250
+ }
251
+ ],
252
+ "created_at": "2010-07-20T22:55:29Z",
253
+ "updated_at": "2012-03-05T10:38:52Z"
254
+ },
255
+ {
256
+ "id": 12,
257
+ ...
258
+ "created_at": "2011-07-20T04:31:29Z",
259
+ "updated_at": "2012-02-02T10:32:59Z"
260
+ }
261
+ ]
262
+ }
263
+ ```
264
+
265
+ ### Update Topic
266
+ `PUT /api/v2/topics/{id}.json`
267
+
268
+ #### Allowed For
269
+
270
+ * Admins and agents as permitted by the parent forum access settings
271
+ * The user who created the topic, restricted by the current parent forum access settings
272
+
273
+ #### Using curl
274
+
275
+ ```bash
276
+ curl https://{subdomain}.zendesk.com/api/v2/topics/{id}.json \
277
+ -H "Content-Type: application/json" -d '{"topic": { "title": "How to Disassemble a Robot" }}' \
278
+ -v -u {email_address}:{password} -X PUT
279
+ ```
280
+
281
+ #### Example Response
282
+
283
+ ```http
284
+ Status: 200 OK
285
+
286
+ {
287
+ "topic": {
288
+ "id": 35436,
289
+ "title": "How to Disassemble a Robot",
290
+ "body": "Carefully with very large pliers",
291
+ "topic_type": "articles",
292
+ "submitter_id": 116,
293
+ "updater_id": 116,
294
+ "forum_id": 1239,
295
+ "locked": true,
296
+ "pinned": false,
297
+ "locked": true,
298
+ "position": 1,
299
+ "tags": ["danger"],
300
+ "attachments": [
301
+ {
302
+ "id": 498483,
303
+ "name": "crash.log",
304
+ "content_url": "https://company.zendesk.com/attachments/crash.log",
305
+ "content_type": "text/plain",
306
+ "size": 2532,
307
+ "thumbnails": []
308
+ }
309
+ ],
310
+ "created_at": "2011-05-05T10:38:52Z",
311
+ "updated_at": "2012-03-11T14:09:18Z"
312
+ }
313
+ }
314
+ ```
315
+
316
+ ### Delete Topic
317
+ `DELETE /api/v2/topics/{id}.json`
318
+
319
+ #### Allowed For
320
+
321
+ * Admins and agents as permitted by the parent forum access settings
322
+ * The user who created the topic, restricted by the current parent forum access settings
323
+
324
+ #### Using curl
325
+
326
+ ```bash
327
+ curl https://{subdomain}.zendesk.com/api/v2/topic/{id}.json \
328
+ -v -u {email_address}:{password} -X DELETE
329
+ ```
330
+
331
+ #### Example Response
332
+
333
+ ```http
334
+ Status: 200 OK
335
+ ```
@@ -0,0 +1,199 @@
1
+ ## Triggers
2
+
3
+ ### JSON Format
4
+ Triggers are read-only and represented as simple flat JSON objects which have the following keys.
5
+
6
+ | Name | Type | Comment
7
+ | --------------- | ---------------------------| -------------------
8
+ | id | integer | Automatically assigned when created
9
+ | title | string | The title of the trigger
10
+ | active | boolean | Whether the trigger is active
11
+ | conditions | [Conditions](#conditions) | An object that describes the conditions under which the trigger will execute
12
+ | actions | [Actions](#actions) | An object describing what the trigger will do
13
+ | created_at | date | The time the trigger was created
14
+ | updated_at | date | The time of the last update of the trigger
15
+
16
+ #### Example
17
+ ```js
18
+ {
19
+ "trigger": {
20
+ "id": 25,
21
+ "title": "Notify requester of comment update",
22
+ "active": true,
23
+ "actions": { ... },
24
+ "conditions": { ... },
25
+ "updated_at": "2012-09-25T22:50:26Z",
26
+ "created_at": "2012-09-25T22:50:26Z"
27
+ }
28
+ }
29
+ ```
30
+
31
+ ### Conditions
32
+ The conditions under which a ticket is selected.
33
+
34
+ | Name | Type | Comment
35
+ | ------------ | ------- | -------
36
+ | all | array | Tickets must fulfill *all* of these conditions to be considered matching
37
+ | any | array | Tickets may satisfy *any* of these conditions to be considered matching
38
+
39
+ #### Example
40
+ ```js
41
+ {
42
+ "conditions": {
43
+ "all": [
44
+ { "field": "status", "operator": "less_than", "value": "solved" },
45
+ { "field": "assignee", "operator": "is", "value": "me" },
46
+ ],
47
+ "any": [
48
+ ]
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Actions
54
+ The actions that will be applied to the ticket.
55
+
56
+ | Name | Type | Comment
57
+ | ------------ | ------- | -------
58
+ | field | string | The ticket field being modified
59
+ | value | string | The new value of the field
60
+
61
+ #### Example
62
+ ```js
63
+ {
64
+ "actions": [
65
+ { "field": "status", "value": "solved" },
66
+ { "field": "assignee", "value": "me" },
67
+ ]
68
+ }
69
+ ```
70
+
71
+ ### List Triggers
72
+ `GET /api/v2/triggers.json`
73
+
74
+ Lists all triggers for the current account
75
+
76
+ #### Allowed For:
77
+
78
+ * Agents
79
+
80
+ #### Using curl
81
+
82
+ ```bash
83
+ curl https://{subdomain}.zendesk.com/api/v2/triggers.json \
84
+ -v -u {email_address}:{password}
85
+ ```
86
+
87
+ #### Example Response
88
+
89
+ ```http
90
+ Status: 200 OK
91
+
92
+ {
93
+ "triggers": [
94
+ {
95
+ "url"=>"http://{subdomain}.zendesk.com/api/v2/triggers/25.json",
96
+ "id": 25,
97
+ "title": "Close and Save",
98
+ "active": true
99
+ "conditions": [ ... ],
100
+ "actions": [ ... ],
101
+ "updated_at": "2012-09-25T22:50:26Z",
102
+ "created_at": "2012-09-25T22:50:26Z"
103
+ },
104
+ {
105
+ "url"=>"http://{subdomain}.zendesk.com/api/v2/triggers/26.json",
106
+ "id": 26,
107
+ "title": "Assign priority tag",
108
+ "active": false
109
+ "conditions": [ ... ],
110
+ "actions": [ ... ],
111
+ "updated_at": "2012-09-25T22:50:26Z",
112
+ "created_at": "2012-09-25T22:50:26Z"
113
+ }
114
+ ],
115
+ "count": 2,
116
+ "previous_page": null,
117
+ "next_page": null
118
+ }
119
+ ```
120
+
121
+ ### Getting Triggers
122
+ `GET /api/v2/triggers/{id}.json`
123
+
124
+ #### Allowed For:
125
+
126
+ * Agents
127
+
128
+ #### Using curl
129
+
130
+ ```bash
131
+ curl https://{subdomain}.zendesk.com/api/v2/triggers/{id}.json \
132
+ -v -u {email_address}:{password}
133
+ ```
134
+
135
+ #### Example Response
136
+
137
+ ```http
138
+ Status: 200 OK
139
+
140
+ {
141
+ "trigger": {
142
+ "id": 25,
143
+ "title": "Tickets updated <12 Hours",
144
+ "active": true
145
+ "conditions": [ ... ],
146
+ "actions": [ ... ],
147
+ "updated_at": "2012-09-25T22:50:26Z",
148
+ "created_at": "2012-09-25T22:50:26Z"
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### List active Triggers
154
+ `GET /api/v2/triggers/active.json`
155
+
156
+ Lists all active triggers
157
+
158
+ #### Allowed For:
159
+
160
+ * Agents
161
+
162
+ #### Using curl
163
+
164
+ ```bash
165
+ curl https://{subdomain}.zendesk.com/api/v2/triggers/active.json \
166
+ -v -u {email_address}:{password}
167
+ ```
168
+
169
+ #### Example Response
170
+
171
+ ```http
172
+ Status: 200 OK
173
+
174
+ {
175
+ "triggers": [
176
+ {
177
+ "id": 25,
178
+ "title": "Close and Save",
179
+ "active": true
180
+ "conditions": [ ... ],
181
+ "actions": [ ... ],
182
+ "updated_at": "2012-09-25T22:50:26Z",
183
+ "created_at": "2012-09-25T22:50:26Z"
184
+ },
185
+ {
186
+ "id": 28,
187
+ "title": "Close and redirect to topics",
188
+ "active": true
189
+ "conditions": [ ... ],
190
+ "actions": [ ... ],
191
+ "updated_at": "2012-09-25T22:50:26Z",
192
+ "created_at": "2012-09-25T22:50:26Z"
193
+ }
194
+ ],
195
+ "count": 2,
196
+ "previous_page": null,
197
+ "next_page": null
198
+ }
199
+ ```