zendesk_api 1.3.5 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/.yardopts +0 -2
  4. data/Gemfile +4 -30
  5. data/Gemfile.lock +38 -80
  6. data/Rakefile +0 -5
  7. data/lib/zendesk_api/actions.rb +3 -2
  8. data/lib/zendesk_api/client.rb +4 -1
  9. data/lib/zendesk_api/collection.rb +4 -0
  10. data/lib/zendesk_api/configuration.rb +2 -0
  11. data/lib/zendesk_api/middleware/request/upload.rb +1 -1
  12. data/lib/zendesk_api/middleware/request/url_based_access_token.rb +26 -0
  13. data/lib/zendesk_api/resources.rb +25 -1
  14. data/lib/zendesk_api/version.rb +1 -1
  15. data/spec/core/client_spec.rb +1 -0
  16. data/spec/core/middleware/request/upload_spec.rb +26 -27
  17. data/spec/core/spec_helper.rb +27 -1
  18. data/spec/live/user_spec.rb +4 -2
  19. data/spec/live/user_view_spec.rb +16 -0
  20. data/spec/live/voice/phone_number_spec.rb +2 -0
  21. data/zendesk_api.gemspec +1 -4
  22. metadata +9 -191
  23. data/Procfile +0 -1
  24. data/bin/zendesk +0 -27
  25. data/config.ru +0 -6
  26. data/config/mongoid.yml +0 -81
  27. data/config/newrelic.yml +0 -255
  28. data/lib/zendesk_api/console/base.rb +0 -12
  29. data/lib/zendesk_api/console/console.rb +0 -144
  30. data/lib/zendesk_api/console/extensions.rb +0 -202
  31. data/lib/zendesk_api/console/options.rb +0 -41
  32. data/lib/zendesk_api/server/base.rb +0 -123
  33. data/lib/zendesk_api/server/docs/account_settings.md +0 -191
  34. data/lib/zendesk_api/server/docs/activity_stream.md +0 -121
  35. data/lib/zendesk_api/server/docs/attachments.md +0 -142
  36. data/lib/zendesk_api/server/docs/autocomplete.md +0 -29
  37. data/lib/zendesk_api/server/docs/automations.md +0 -256
  38. data/lib/zendesk_api/server/docs/categories.md +0 -193
  39. data/lib/zendesk_api/server/docs/changes_roadmap.md +0 -286
  40. data/lib/zendesk_api/server/docs/custom_roles.md +0 -88
  41. data/lib/zendesk_api/server/docs/forum_subscriptions.md +0 -139
  42. data/lib/zendesk_api/server/docs/forums.md +0 -229
  43. data/lib/zendesk_api/server/docs/group_memberships.md +0 -229
  44. data/lib/zendesk_api/server/docs/groups.md +0 -212
  45. data/lib/zendesk_api/server/docs/introduction.md +0 -165
  46. data/lib/zendesk_api/server/docs/job_statuses.md +0 -86
  47. data/lib/zendesk_api/server/docs/locales.md +0 -124
  48. data/lib/zendesk_api/server/docs/macros.md +0 -289
  49. data/lib/zendesk_api/server/docs/organizations.md +0 -271
  50. data/lib/zendesk_api/server/docs/problems.md +0 -117
  51. data/lib/zendesk_api/server/docs/requests.md +0 -274
  52. data/lib/zendesk_api/server/docs/satisfaction_ratings.md +0 -172
  53. data/lib/zendesk_api/server/docs/search.md +0 -106
  54. data/lib/zendesk_api/server/docs/sharing_agreements.md +0 -57
  55. data/lib/zendesk_api/server/docs/side_loading.md +0 -125
  56. data/lib/zendesk_api/server/docs/suspended_tickets.md +0 -184
  57. data/lib/zendesk_api/server/docs/tags.md +0 -145
  58. data/lib/zendesk_api/server/docs/ticket_audits.md +0 -688
  59. data/lib/zendesk_api/server/docs/ticket_export.md +0 -121
  60. data/lib/zendesk_api/server/docs/ticket_fields.md +0 -277
  61. data/lib/zendesk_api/server/docs/ticket_import.md +0 -65
  62. data/lib/zendesk_api/server/docs/ticket_metrics.md +0 -125
  63. data/lib/zendesk_api/server/docs/tickets.md +0 -696
  64. data/lib/zendesk_api/server/docs/topic_comments.md +0 -221
  65. data/lib/zendesk_api/server/docs/topic_subscriptions.md +0 -140
  66. data/lib/zendesk_api/server/docs/topic_votes.md +0 -153
  67. data/lib/zendesk_api/server/docs/topics.md +0 -335
  68. data/lib/zendesk_api/server/docs/triggers.md +0 -264
  69. data/lib/zendesk_api/server/docs/user_identities.md +0 -279
  70. data/lib/zendesk_api/server/docs/users.md +0 -455
  71. data/lib/zendesk_api/server/docs/views.md +0 -644
  72. data/lib/zendesk_api/server/helper.rb +0 -110
  73. data/lib/zendesk_api/server/html_renderer.rb +0 -98
  74. data/lib/zendesk_api/server/models/user_request.rb +0 -16
  75. data/lib/zendesk_api/server/models/zlib_json.rb +0 -13
  76. data/lib/zendesk_api/server/public/config.rb +0 -26
  77. data/lib/zendesk_api/server/public/doc/ZendeskAPI.html +0 -131
  78. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ability.html +0 -592
  79. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Activity.html +0 -979
  80. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Attachment.html +0 -658
  81. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Automation.html +0 -805
  82. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Bookmark.html +0 -606
  83. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMData.html +0 -592
  84. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMDataStatus.html +0 -592
  85. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Category.html +0 -825
  86. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Client.html +0 -1226
  87. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Collection.html +0 -2606
  88. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Configuration.html +0 -1302
  89. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create.html +0 -392
  90. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create/ClassMethods.html +0 -283
  91. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CreateResource.html +0 -878
  92. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CustomRole.html +0 -592
  93. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Data.html +0 -1406
  94. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DataResource.html +0 -823
  95. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DeleteResource.html +0 -815
  96. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy.html +0 -357
  97. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy/ClassMethod.html +0 -295
  98. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error.html +0 -115
  99. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/ClientError.html +0 -127
  100. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/NetworkError.html +0 -127
  101. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/RecordInvalid.html +0 -371
  102. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/RecordNotFound.html +0 -127
  103. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Forum.html +0 -1559
  104. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ForumSubscription.html +0 -979
  105. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Group.html +0 -606
  106. data/lib/zendesk_api/server/public/doc/ZendeskAPI/GroupMembership.html +0 -979
  107. data/lib/zendesk_api/server/public/doc/ZendeskAPI/JobStatus.html +0 -598
  108. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Locale.html +0 -598
  109. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Macro.html +0 -805
  110. data/lib/zendesk_api/server/public/doc/ZendeskAPI/MobileDevice.html +0 -724
  111. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OAuthClient.html +0 -606
  112. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OAuthToken.html +0 -810
  113. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Organization.html +0 -1379
  114. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OrganizationField.html +0 -606
  115. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Read.html +0 -341
  116. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ReadResource.html +0 -797
  117. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request.html +0 -1189
  118. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request/Comment.html +0 -993
  119. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Resource.html +0 -1263
  120. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Role.html +0 -592
  121. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Rule.html +0 -610
  122. data/lib/zendesk_api/server/public/doc/ZendeskAPI/RuleExecution.html +0 -679
  123. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SatisfactionRating.html +0 -1327
  124. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Save.html +0 -494
  125. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search.html +0 -411
  126. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search/Result.html +0 -462
  127. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Setting.html +0 -742
  128. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SharingAgreement.html +0 -598
  129. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SingularResource.html +0 -610
  130. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SuspendedTicket.html +0 -911
  131. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket.html +0 -3094
  132. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Audit.html +0 -787
  133. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Comment.html +0 -1039
  134. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Tag.html +0 -606
  135. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketField.html +0 -606
  136. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketMetric.html +0 -782
  137. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic.html +0 -1449
  138. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicComment.html +0 -1122
  139. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicVote.html +0 -983
  140. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicComment.html +0 -1039
  141. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicSubscription.html +0 -979
  142. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Trigger.html +0 -805
  143. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update.html +0 -392
  144. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update/ClassMethod.html +0 -287
  145. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UpdateResource.html +0 -878
  146. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Upload.html +0 -1176
  147. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User.html +0 -3974
  148. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/Identity.html +0 -926
  149. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/TopicComment.html +0 -656
  150. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UserField.html +0 -606
  151. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Verbs.html +0 -332
  152. data/lib/zendesk_api/server/public/doc/ZendeskAPI/View.html +0 -1650
  153. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewCount.html +0 -592
  154. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewRow.html +0 -1744
  155. data/lib/zendesk_api/server/public/doc/_index.html +0 -799
  156. data/lib/zendesk_api/server/public/doc/class_list.html +0 -53
  157. data/lib/zendesk_api/server/public/doc/css/common.css +0 -1
  158. data/lib/zendesk_api/server/public/doc/css/full_list.css +0 -57
  159. data/lib/zendesk_api/server/public/doc/css/style.css +0 -338
  160. data/lib/zendesk_api/server/public/doc/file.Readme.html +0 -137
  161. data/lib/zendesk_api/server/public/doc/file_list.html +0 -55
  162. data/lib/zendesk_api/server/public/doc/frames.html +0 -28
  163. data/lib/zendesk_api/server/public/doc/index.html +0 -137
  164. data/lib/zendesk_api/server/public/doc/js/app.js +0 -214
  165. data/lib/zendesk_api/server/public/doc/js/full_list.js +0 -173
  166. data/lib/zendesk_api/server/public/doc/js/jquery.js +0 -4
  167. data/lib/zendesk_api/server/public/doc/method_list.html +0 -2332
  168. data/lib/zendesk_api/server/public/doc/top-level-namespace.html +0 -112
  169. data/lib/zendesk_api/server/public/favicon.ico +0 -0
  170. data/lib/zendesk_api/server/public/images/glyphicons-halflings-white.png +0 -0
  171. data/lib/zendesk_api/server/public/images/glyphicons-halflings.png +0 -0
  172. data/lib/zendesk_api/server/public/images/spinner.gif +0 -0
  173. data/lib/zendesk_api/server/public/images/zendesk_developers_bg.png +0 -0
  174. data/lib/zendesk_api/server/public/images/zendesk_developers_header.png +0 -0
  175. data/lib/zendesk_api/server/public/javascripts/application.js +0 -186
  176. data/lib/zendesk_api/server/public/javascripts/bootstrap-alert.js +0 -90
  177. data/lib/zendesk_api/server/public/javascripts/bootstrap-button.js +0 -96
  178. data/lib/zendesk_api/server/public/javascripts/bootstrap-carousel.js +0 -169
  179. data/lib/zendesk_api/server/public/javascripts/bootstrap-collapse.js +0 -157
  180. data/lib/zendesk_api/server/public/javascripts/bootstrap-dropdown.js +0 -100
  181. data/lib/zendesk_api/server/public/javascripts/bootstrap-modal.js +0 -218
  182. data/lib/zendesk_api/server/public/javascripts/bootstrap-popover.js +0 -98
  183. data/lib/zendesk_api/server/public/javascripts/bootstrap-scrollspy.js +0 -151
  184. data/lib/zendesk_api/server/public/javascripts/bootstrap-tab.js +0 -135
  185. data/lib/zendesk_api/server/public/javascripts/bootstrap-tooltip.js +0 -275
  186. data/lib/zendesk_api/server/public/javascripts/bootstrap-transition.js +0 -61
  187. data/lib/zendesk_api/server/public/javascripts/bootstrap-typeahead.js +0 -285
  188. data/lib/zendesk_api/server/public/sass/screen.scss +0 -102
  189. data/lib/zendesk_api/server/public/sass/styles.scss +0 -5
  190. data/lib/zendesk_api/server/public/stylesheets/developer.screen.css +0 -836
  191. data/lib/zendesk_api/server/public/stylesheets/screen.css +0 -129
  192. data/lib/zendesk_api/server/public/stylesheets/styles.css +0 -6208
  193. data/lib/zendesk_api/server/templates/footer.haml +0 -13
  194. data/lib/zendesk_api/server/templates/header.haml +0 -20
  195. data/lib/zendesk_api/server/templates/index.haml +0 -68
  196. data/lib/zendesk_api/server/templates/layout.haml +0 -44
  197. data/lib/zendesk_api/server/templates/param.haml +0 -4
  198. data/lib/zendesk_api/server/templates/search.haml +0 -23
  199. data/lib/zendesk_api/server/templates/sidebar.haml +0 -7
  200. data/spec/server/app_spec.rb +0 -140
  201. data/spec/server/helper_spec.rb +0 -97
  202. data/spec/server/html_renderer_spec.rb +0 -130
  203. data/spec/server/spec_helper.rb +0 -43
@@ -1,644 +0,0 @@
1
- ## Views
2
-
3
- A view consists of one or more conditions that define a collection of tickets to display. If the conditions are met, the ticket is included in the view. For example, a view can display all open tickets that were last updated more than 24 hours ago.
4
-
5
- For more information, see [Using views to manage ticket workflow](https://support.zendesk.com/entries/20103667).
6
-
7
-
8
- ### JSON Format
9
- Views are represented as simple flat JSON objects which have the following keys.
10
-
11
- | Name | Type | Comment
12
- | --------------- | ---------------------------| -------------------
13
- | id | integer | Automatically assigned when created
14
- | title | string | The title of the view
15
- | active | boolean | Useful for determining if the view should be displayed
16
- | restriction | object | Who may access this account. Will be null when everyone in the account can access it.
17
- | execution | [Execute](#execution) | An object describing how the view should be executed
18
- | conditions | [Conditions](#conditions) | An object describing how the view is constructed
19
- | created_at | date | The time the view was created
20
- | updated_at | date | The time of the last update of the view
21
-
22
- #### Example
23
- ```js
24
- {
25
- "view": {
26
- "id": 25,
27
- "title": "Tickets updated <12 Hours",
28
- "active": true,
29
- "execution": { ... },
30
- "conditions": [ ... ],
31
- "restriction": {
32
- "type": "User",
33
- "id": 4
34
- }
35
- }
36
- }
37
- ```
38
-
39
- ### Execution
40
- View Execution is a read-only object that describes how to display a collection of tickets in a View.
41
-
42
- | Name | Type | Comment
43
- | --------------- | ------- | -------
44
- | columns | Array | The ticket fields to display. Custom fields have an id, title, type and url referencing the [Ticket Field](ticket_fields.md)
45
- | group | Object | When present, the structure indicating how the tickets are grouped
46
- | sort | Object | The column structure of the field used for sorting.
47
-
48
- #### Example
49
- ```js
50
- {
51
- "execution":{
52
- "columns": [
53
- { "id": "status", "title": "Status" },
54
- { "id": "updated", "title": "Updated" },
55
- {
56
- "id": 5, "title": "Account", "type": "text",
57
- "url": "https://example.zendesk.com/api/v2/ticket_fields/5.json"
58
- },
59
- ...
60
- ]
61
- "group": { "id": "status", "title": "Status", "order": "desc" },
62
- "sort": { "id": "updated", "title": "Updated", "order": "desc" }
63
- }
64
- }
65
- ```
66
-
67
- ### Conditions
68
- The conditions under which a ticket is selected.
69
-
70
- | Name | Type | Comment
71
- | ------------ | ------- | -------
72
- | all | array | Tickets must fulfill *all* of these conditions to be considered matching
73
- | any | array | Tickets may satisfy *any* of these conditions to be considered matching
74
-
75
- #### Example
76
- ```js
77
- {
78
- "conditions": {
79
- "all": [
80
- { "field": "status", "operator": "less_than", "value": "solved" },
81
- { "field": "assignee", "operator": "is", "value": "me" },
82
- ],
83
- "any": [
84
- ]
85
- }
86
- }
87
- ```
88
-
89
- <!---
90
-
91
- ### View Rows
92
-
93
- View Rows are read-only and represented as simple flat JSON objects which have the following keys.
94
-
95
- | Name | Type | Comment
96
- | --------------- | --------------------------- | -------------------
97
- | view | Array | View that was executed. Consists of id and url.
98
- | rows | Array | Array of tickets contained in the view, described by the fields.
99
- | columns | Array | Array of [Fields](#execution) and [Custom Fields](#execution) representing the columns in each row.
100
-
101
- A row contains the data indicated by the idenitifiers in the columns array.
102
-
103
- | Name | Type | Optional | Comment
104
- | ---------------------- | ---------------------------- | --------- | ----------------
105
- | ticket | Object | no | Ticket id, url, subject, description, status, type, priority and comment this row is a subset of.
106
- | custom_fields | Array | no | Custom fields values.
107
- | group | Integer | yes | Id of this ticket's group.
108
- | organization | Integer | yes | Id of this ticket's organization.
109
- | requester | Integer | yes | Id of this ticket's requester.
110
- | assignee | Integer | yes | Id of this ticket's assignee.
111
- | submitter | Integer | yes | Id of this ticket's submitter.
112
- | locale | String | yes | Locale of the requester.
113
- | type | String | yes | See [Ticket](tickets.md#json-format)
114
- | priority | String | yes | See [Ticket](tickets.md#json-format)
115
- | status | String | yes | See [Ticket](tickets.md#json-format)
116
- | updated_by_type | String | yes | Last updated by 'agent' or 'end user'
117
- | subject | DateTime | yes | Ticket subject.
118
- | requester_updated_at | DateTime | yes | When the requester last updated the ticket.
119
- | assignee_updated_at | DateTime | yes | When the assignee last updated the ticket.
120
- | assigned | DateTime | yes | When the ticket was assigned last.
121
- | due_date | DateTime | yes | When the ticket is due.
122
- | solved | DateTime | yes | When the ticket was solved.
123
- | created | DateTime | yes | When the ticket was created.
124
- | updated | DateTime | yes | When the ticket was updated.
125
-
126
- #### Example
127
- ```js
128
- {
129
- "view": {
130
- "id": 5,
131
- "url": "https://example.zendesk.com/api/v2/views/5.json"
132
- },
133
- "rows": [
134
- {
135
- "ticket": { ... },
136
- "locale": "en-US",
137
- "group": { ... },
138
- ...
139
- },
140
- ...
141
- ],
142
- "columns": [
143
- {
144
- "id": "locale",
145
- "title": "Locale"
146
- },
147
- {
148
- "id": 5,
149
- "title": "Account",
150
- "url": ...
151
- },
152
- ...
153
- ]
154
- }
155
- ```
156
-
157
- -->
158
-
159
- ### List Views
160
- `GET /api/v2/views.json`
161
-
162
- Lists shared and personal Views available to the current user
163
-
164
- #### Allowed For:
165
-
166
- * Agents
167
-
168
- #### Using curl
169
-
170
- ```bash
171
- curl https://{subdomain}.zendesk.com/api/v2/views.json \
172
- -v -u {email_address}:{password}
173
- ```
174
-
175
- #### Example Response
176
-
177
- ```http
178
- Status: 200 OK
179
-
180
- {
181
- "views": [
182
- {
183
- "id":25,
184
- "title":"Tickets updated <12 Hours",
185
- "active":true,
186
- "execution":{ ... },
187
- "conditions": { ... },
188
- "restriction":{ ... }
189
- },
190
- {
191
- "id":23,
192
- "title":"Unassigned tickets",
193
- "active":false,
194
- "execution":{ ... },
195
- "conditions": { ... },
196
- "restriction":{ ... }
197
- },
198
- ...
199
- ],
200
- "count": 7,
201
- "next_page": null,
202
- "previous_page": null
203
- }
204
- ```
205
-
206
- ### List Active Views
207
- `GET /api/v2/views/active.json`
208
-
209
- Lists active shared and personal Views available to the current user
210
-
211
- #### Allowed For:
212
-
213
- * Agents
214
-
215
- #### Using curl
216
-
217
- ```bash
218
- curl https://{subdomain}.zendesk.com/api/v2/views/active.json \
219
- -v -u {email_address}:{password}
220
- ```
221
-
222
- #### Example Response
223
-
224
- ```http
225
- Status: 200 OK
226
-
227
- {
228
- "views": [
229
- {
230
- "id": 25,
231
- "title": "Tickets updated <12 Hours",
232
- "active": true
233
- "execution": { ... },
234
- "conditions": { ... },
235
- "restriction": { ... }
236
- },
237
- ...
238
- ],
239
- "count": 7,
240
- "next_page": null,
241
- "previous_page": null
242
- }
243
- ```
244
-
245
- ### List Views - Compact
246
- `GET /api/v2/views/compact.json`
247
-
248
- A compacted list of shared and personal views available to the current user
249
-
250
- #### Allowed For:
251
-
252
- * Agents
253
-
254
- #### Using curl
255
-
256
- ```bash
257
- curl https://{subdomain}.zendesk.com/api/v2/views/compact.json \
258
- -v -u {email_address}:{password}
259
- ```
260
-
261
- #### Example Response
262
-
263
- ```http
264
- Status: 200 OK
265
-
266
- {
267
- "views": [
268
- {
269
- "id": 25,
270
- "title": "Tickets updated <12 Hours",
271
- "active": true
272
- "execution": { ... },
273
- "conditions": { ... },
274
- "restriction": { ... }
275
- },
276
- ...
277
- ],
278
- "count": 7,
279
- "next_page": null,
280
- "previous_page": null
281
- }
282
- ```
283
-
284
- ### Getting Views
285
- `GET /api/v2/views/{id}.json`
286
-
287
- #### Allowed For:
288
-
289
- * Agents
290
-
291
- #### Using curl
292
-
293
- ```bash
294
- curl https://{subdomain}.zendesk.com/api/v2/views/{id}.json \
295
- -v -u {email_address}:{password}
296
- ```
297
-
298
- #### Example Response
299
-
300
- ```http
301
- Status: 200 OK
302
-
303
- {
304
- "view": {
305
- "id": 25,
306
- "title": "Tickets updated <12 Hours",
307
- "active": true
308
- "execution": { ... },
309
- "conditions": { ... },
310
- "restriction": { ... }
311
- }
312
- }
313
- ```
314
-
315
- ### Create View
316
- `POST /api/v2/views.json`
317
-
318
- #### Allowed For
319
-
320
- * Agents
321
-
322
- #### Using curl
323
-
324
- ```bash
325
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/views.json \
326
- -H "Content-Type: application/json" -X POST -d '{"view":{"title":"Roger Wilco", "all": [{ "field": "status", "operator": "is", "value": "open" }]}}'
327
- ```
328
-
329
- #### Example Response
330
-
331
- ```http
332
- Status: 201 Created
333
- Location: /api/v2/view/{new-view-id}.json
334
-
335
- {
336
- "view": {
337
- "id": 9873843,
338
- "title": "Roger Wilco",
339
- ...
340
- }
341
- }
342
- ```
343
-
344
- ### Update View
345
- `PUT /api/v2/view/{id}.json`
346
-
347
- #### Allowed For
348
-
349
- * Agents
350
-
351
- #### Using curl
352
-
353
- ```bash
354
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/view/{id}.json \
355
- -H "Content-Type: application/json" -X PUT -d '{"view":{"title":"Roger Wilco II"}}'
356
- ```
357
-
358
- #### Example Response
359
-
360
- ```http
361
- Status: 200 OK
362
-
363
- {
364
- "view": {
365
- "id": 9873843,
366
- "title": "Roger Wilco II",
367
- ...
368
- }
369
- }
370
- ```
371
-
372
- ### Executing Views
373
- `GET /api/v2/views/{id}/execute.json`
374
-
375
- You execute a view in order to get the tickets that fulfill the conditions of the view.
376
-
377
- The view execution system is designed for periodic rather than high-frequency API usage. In particular, views that are called very
378
- frequently by an API client (more often than once every 5 minutes on average) may be cached by our software. This means
379
- that the API client will still receive a result however that result may have been computed at any time within the last 10
380
- minutes.
381
-
382
- If you are looking for a method to get the latest changes to your Zendesk via the API we recommend the ticket export API
383
- which can be called as often as once a minute, and will return all the tickets changed since last poll.
384
-
385
- View output sorting can be controlled by passing the sort_by and sort_order parameters in the
386
- format described in the table under [view previewing](#previewing-views).
387
-
388
- #### Allowed For:
389
-
390
- * Agents
391
-
392
- #### Using curl
393
-
394
- ```bash
395
- curl https://{subdomain}.zendesk.com/api/v2/views/{id}/execute.json \
396
- -v -u {email_address}:{password}
397
- ```
398
-
399
- With sort options:
400
-
401
- ```bash
402
- curl https://{subdomain}.zendesk.com/api/v2/views/{id}/execute.json?sort_by=id&sort_order=desc \
403
- -v -u {email_address}:{password}
404
- ```
405
-
406
- #### Example Response
407
-
408
- ```http
409
- Status: 200 OK
410
-
411
- {
412
- "view": {
413
- "id": 25,
414
- "url": ...
415
- },
416
- "rows": [
417
- {
418
- "ticket": { ... },
419
- "locale": "en-US",
420
- "group": 1,
421
- ...
422
- },
423
- ...
424
- ],
425
- "columns": [
426
- {
427
- "id": "locale",
428
- "title": "Locale"
429
- },
430
- {
431
- "id": 5,
432
- "title": "Account",
433
- "url": ...
434
- },
435
- ...
436
- ],
437
- "groups": [ ... ]
438
- }
439
- ```
440
-
441
- ### Getting Tickets from a view
442
- `GET /api/v2/views/{id}/tickets.json`
443
-
444
- #### Allowed For
445
-
446
- * Agents
447
-
448
- #### Using curl:
449
-
450
- ```bash
451
- curl https://{subdomain}.zendesk.com/api/v2/views/{id}/tickets.json \
452
- -v -u {email_address}:{password}
453
- ```
454
-
455
- #### Example Responses
456
-
457
- ```http
458
- Status: 200 OK
459
-
460
- {
461
- "tickets": [
462
- {
463
- "id": 35436,
464
- "subject": "Help I need somebody!",
465
- ...
466
- },
467
- {
468
- "id": 20057623,
469
- "subject": "Not just anybody!",
470
- ...
471
- },
472
- ]
473
- }
474
- ```
475
-
476
- ### Previewing Views
477
- `POST /api/v2/views/preview.json`
478
-
479
- Views can be previewed by constructing the conditions in the [proper format](#conditions) and nesting them under the 'view' key.
480
- The output can also be controlled by passing in any of the following parameters and nesting them under the 'view' key.
481
-
482
- | Name | Type | Comment
483
- | --------------- | ------- | -------
484
- | columns | Array | The ticket fields to display. System fields are looked up by name, custom fields by title or id.
485
- | group_by | String | When present, the field by which the tickets are grouped
486
- | group_order | String | The direction the tickets are grouped. May be one of 'asc' or 'desc'
487
- | sort_order | String | The direction the tickets are sorted. May be one of 'asc' or 'desc'
488
- | sort_by | String | The ticket field used for sorting. This will either be a title or a custom field id.
489
-
490
- #### Allowed For:
491
-
492
- * Agents
493
-
494
- #### Using curl
495
-
496
- ```bash
497
- curl https://{subdomain}.zendesk.com/api/v2/views/preview.json \
498
- -v -u {email_address}:{password} -X POST -H "Content-Type: application/json" \
499
- -d '{"view": {"all": [{"operator": "is", "value": "open", "field": "status"}], "output": {"columns": ["subject"]}}}'
500
- ```
501
-
502
- #### Example Response
503
-
504
- ```http
505
- Status: 200 OK
506
-
507
- {
508
- "rows": [
509
- {
510
- "ticket": { ... },
511
- "subject": "en-US",
512
- ...
513
- },
514
- ...
515
- ],
516
- "columns": [
517
- {
518
- "id": "subject",
519
- "title": "Subject"
520
- },
521
- ...
522
- ]
523
- }
524
- ```
525
-
526
- ### View Counts and Caching
527
-
528
- The view count APIs allow an API consumer to estimate how many tickets remain in a View without having to retrieve the entire View.
529
- These APIs are intended to help estimate View size; from a business perspective, accuracy becomes less relevant as your View size increases.
530
- To ensure quality of service, these counts are cached more heavily as the number of tickets in a View grows. For a View with thousands of tickets,
531
- you can expect its count to be cached for 60-90 minutes and may not reflect the actual number of tickets in your View.
532
-
533
- ### View Counts
534
- `GET /api/v2/views/count_many.json?ids={view_id},{view_id}`
535
-
536
- Calculates the size of the view in terms of number of tickets the view will return.
537
- Only returns values for personal and shared views accessible to the user performing
538
- the request.
539
-
540
- #### Allowed For:
541
-
542
- * Agents
543
-
544
- #### Using curl
545
-
546
- ```bash
547
- curl https://{subdomain}.zendesk.com/api/v2/views/count_many.json?ids={view_id} \
548
- -v -u {email_address}:{password}
549
- ```
550
-
551
- #### Example Response
552
-
553
- When you retrieve view counts that are not "fresh", it's recommended to wait for a short
554
- while an poll again for only the stale view counts.
555
-
556
- ```http
557
- Status: 200 OK
558
-
559
- {
560
- "view_counts": [{
561
- "view_id": 25,
562
- "url": "https://company.zendesk.com/api/v2/views/25/count.json",
563
- "value": 719,
564
- "pretty": "~700",
565
- "fresh": true
566
- },
567
- {
568
- "view_id": 78,
569
- "url": "https://company.zendesk.com/api/v2/views/78/count.json",
570
- "value": null,
571
- "pretty": "...",
572
- "fresh": false
573
- }
574
- ]}
575
- ```
576
-
577
- ### View Count
578
- `GET /api/v2/views/{id}/count.json`
579
-
580
- Returns the ticket count for a single view.
581
-
582
- #### Allowed For:
583
-
584
- * Agents
585
-
586
- #### Using curl
587
-
588
- ```bash
589
- curl https://{subdomain}.zendesk.com/api/v2/views/{id}/count.json \
590
- -v -u {email_address}:{password}
591
- ```
592
-
593
- #### Example Response
594
-
595
- ```http
596
- Status: 200 OK
597
- {
598
- "view_count": {
599
- "view_id": 25,
600
- "url": "https://company.zendesk.com/api/v2/views/25/count.json",
601
- "value": 719,
602
- "pretty": "~700",
603
- "fresh": true
604
- }
605
- }
606
- ```
607
-
608
- ### Exporting Views
609
- `GET /api/v2/views/{id}/export.json`
610
-
611
- Returns the csv attachment of the current view if possible.
612
- Enqueues a job to produce the csv if needed.
613
-
614
- #### Allowed For:
615
-
616
- * Agents
617
-
618
- #### Using curl
619
-
620
- ```bash
621
- curl https://{subdomain}.zendesk.com/api/v2/views/{id}/export.json \
622
- -v -u {email_address}:{password}
623
- ```
624
-
625
- #### Example Responses
626
-
627
- ##### With available data
628
- ```http
629
- Status: 200
630
- Content-Disposition: Attachment
631
- [CSV data]
632
- ```
633
-
634
- ##### Starting a CSV job
635
- ```http
636
- Status: 201
637
-
638
- {
639
- "export": {
640
- "view_id": 25,
641
- "status": "starting"
642
- }
643
- }
644
- ```