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,106 @@
1
+ ## Search
2
+
3
+ The search API is a unified search API that returns tickets, users, organizations, and forum topics. Define filters to narrow your search results according to result type, date attributes, and object attributes such as ticket requester or tag.
4
+
5
+ ### A few example queries
6
+
7
+ | Search query | Returns...
8
+ | ------------------------------------------------------------ | ----------
9
+ | status<solved requester:user@domain.com type:ticket | All unsolved tickets requested by user@domain.com
10
+ | type:user tags:premium_support | All users tagged with ``premium_support``
11
+ | created>2012-06-17 type:ticket organization:"Mondocam Photo" | Tickets created within the Mondocam Photo organization after July 17, 2012
12
+
13
+ Our [search reference](https://support.zendesk.com/entries/20239737-zendesk-search-reference) offers a complete guide to all search filters available for advanced search.
14
+
15
+ ### JSON Format
16
+ Queries are represented as JSON objects which have the following keys.
17
+
18
+ | Name | Type | Comment
19
+ | --------------------- | ---------------------| --------------------
20
+ | count | integer | The total number of results matching this query
21
+ | next_page | string | URL to the next page of results
22
+ | prev_page | string | URL to the previous page of results
23
+ | results | array | May consist of Tickets, Users, Groups, Organizations, and Topics. A ``result_type`` value is added to each result object and can have the following values: ``ticket``, ``user``, ``group``, ``organization``, ``topic``.
24
+
25
+ #### Example
26
+ ```js
27
+ {
28
+ "count": 1234,
29
+ "next_page": "https://foo.zendesk.com/api/v2/search.json?query=\"type:Group hello\"&sort_by=created_at&sort_order=desc&page=2",
30
+ "prev_page": null,
31
+ "results": [
32
+ {
33
+ "name": "Hello DJs",
34
+ "created_at": "2009-05-13T00:07:08Z",
35
+ "updated_at": "2011-07-22T00:11:12Z",
36
+ "id": 211,
37
+ "result_type": "group"
38
+ "url": "https://foo.zendesk.com/api/v2/groups/211.json"
39
+ },
40
+ {
41
+ "name": "Hello MCs",
42
+ "created_at": "2009-08-26T00:07:08Z",
43
+ "updated_at": "2010-05-13T00:07:08Z",
44
+ "id": 122,
45
+ "result_type": "group"
46
+ "url": "https://foo.zendesk.com/api/v2/groups/122.json"
47
+ }
48
+ ...
49
+ ]
50
+ }
51
+ ```
52
+
53
+ ### Search
54
+ `GET /api/v2/search.json?query={search term}`
55
+
56
+ #### Available parameters
57
+
58
+ | Name | Type | Required | Comments
59
+ | --------------------- | --------------------| --------- | -------------------
60
+ | query | string | yes | The search text to be matched. Examples: "carrot potato", "'carrot potato'"
61
+ | sort_by | string | no | Possible values are 'updated_at', 'created_at', 'priority', 'status', and 'ticket_type'
62
+ | sort_order | string | no | One of 'relevance', 'asc', 'desc'. Defaults to 'relevance' when no 'order' criteria is requested.
63
+
64
+ #### Allowed For:
65
+
66
+ * Logged in users
67
+
68
+ #### Using curl
69
+
70
+ ```bash
71
+ curl https://{subdomain}.zendesk.com/api/v2/search.json?query={search term} \
72
+ -v -u {email_address}:{password}
73
+ ```
74
+
75
+ ### Errors JSON Format
76
+ Errors are represented as JSON objects which have the following keys:
77
+
78
+ | Name | Type | Comment
79
+ | --------------------- | ---------------------| --------------------
80
+ | error | string | The type of error. e.g.: 'unavailable', 'invalid'
81
+ | description | string |
82
+
83
+ #### Example
84
+ ```js
85
+ {
86
+ "error": "unavailable",
87
+ "description": "Sorry, we could not complete your search query. Please try again in a moment."
88
+ }
89
+ ```
90
+
91
+ ### Anonymous search
92
+ `GET /api/v2/portal/search.json?query={search term}`
93
+
94
+ This resource behaves the same as /api/v2/search, but allows anonymous users to search public forums.
95
+
96
+ #### Allowed For:
97
+
98
+ * Logged in users
99
+ * Anonymous users on public forums
100
+
101
+ #### Using curl
102
+
103
+ ```bash
104
+ curl https://{subdomain}.zendesk.com/api/v2/portal/search.json?query={search term} \
105
+ -v -u {email_address}:{password}
106
+ ```
@@ -0,0 +1,57 @@
1
+ ## Sharing Agreements
2
+
3
+ ### JSON Format
4
+ Sharing Agreements have the following format:
5
+
6
+ | Name | Type | Comment
7
+ | --------------- | --------------------------------- | -------
8
+ | id | integer | Automatically assigned upon creation
9
+ | name | string | Name of this sharing agreement
10
+ | type | string | Can be one of the following: inbound, outbound
11
+ | partner_name | string | Can be one of the following: jira, null
12
+ | status | string | Can be one of the following: accepted, declined, pending, inactive
13
+ | created_at | date | The time the record was created
14
+
15
+ #### Example
16
+ ```js
17
+ {
18
+ "id": 88335,
19
+ "url": "https://company.zendesk.com/api/v2/agreements/88335.json",
20
+ "name": "Ticket Sharing",
21
+ "type": "inbound",
22
+ "status": "accepted",
23
+ "created_at": "2012-02-20T22:55:29Z"
24
+ }
25
+ ```
26
+
27
+ ### List Sharing Agreements
28
+ `GET /api/v2/sharing_agreements.json`
29
+
30
+ #### Allowed For:
31
+
32
+ * Agents
33
+
34
+ #### Using curl
35
+
36
+ ```bash
37
+ curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements.json \
38
+ -v -u {email_address}:{password}
39
+ ```
40
+
41
+ #### Example Response
42
+
43
+ ```http
44
+ Status: 200 OK
45
+
46
+ {
47
+ "sharing_agreements": [
48
+ {
49
+ "id": 1,
50
+ "name": "Foo @ Zendesk",
51
+ "type": "inbound",
52
+ ...
53
+ },
54
+ ...
55
+ ]
56
+ }
57
+ ```
@@ -0,0 +1,125 @@
1
+ ## Side-Loading
2
+ ### Overview
3
+ Side loading is an API feature that allows you to retrieve related records as part of a single request. For example, consider getting a list of group memberships, your response looks like this:
4
+
5
+ ```js
6
+ {
7
+ "group_memberships": [
8
+ {
9
+ "id": 4,
10
+ "user_id": 29,
11
+ "group_id": 12,
12
+ "created_at": "2009-05-13T00:07:08Z",
13
+ "updated_at": "2011-07-22T00:11:12Z"
14
+ },
15
+ {
16
+ "id": 49,
17
+ "user_id": 155,
18
+ "group_id": 3,
19
+ "created_at": "2012-03-13T22:01:32Z",
20
+ "updated_at": "2012-03-13T22:01:32Z"
21
+ }
22
+ ]
23
+ }
24
+ ```
25
+
26
+ By allowing side loading of users and groups, this response turns into:
27
+
28
+ ```js
29
+ {
30
+ "group_memberships": [
31
+ {
32
+ "id": 4,
33
+ "user_id": 29,
34
+ "group_id": 12,
35
+ "created_at": "2009-05-13T00:07:08Z",
36
+ "updated_at": "2011-07-22T00:11:12Z"
37
+ },
38
+ {
39
+ "id": 49,
40
+ "user_id": 155,
41
+ "group_id": 3,
42
+ "created_at": "2012-03-13T22:01:32Z",
43
+ "updated_at": "2012-03-13T22:01:32Z"
44
+ }
45
+ ],
46
+ "users": [
47
+ { "id": 29, ... },
48
+ { "id": 155, ... }
49
+ ],
50
+ "groups": [
51
+ { "id": 12, ... },
52
+ { "id": 3, ... }
53
+ ]
54
+ }
55
+ ```
56
+
57
+ Meaning, we now return the full serialized representation of users and groups referred from the primary collection being retrieved. In order to side load resources, all you need to do is to add `include=users,groups` parameter to the HTTP request.
58
+
59
+ ### Special Sideloads
60
+
61
+ #### Abilities
62
+
63
+ A resource may have an additional `abilities` sideload which represents the abilities that the current user has on a given resource. For example:
64
+
65
+ `GET /api/v2/users/me.json?include=abilities`
66
+
67
+ ```js
68
+ {
69
+ "abilities": [
70
+ {
71
+ "can_edit": true,
72
+ "can_edit_password": true,
73
+ "can_manage_identities_of": true,
74
+ "can_verify_identities": false,
75
+ "url": "http://dev.localhost:3001/api/v2/users/11.json",
76
+ "user_id": 11
77
+ }
78
+ ],
79
+ "user": {
80
+ "active": true,
81
+ "alias": null,
82
+ "created_at": "2012-05-08T01:04:47Z",
83
+ "custom_role_id": null,
84
+ "details": null,
85
+ "email": "agent@zendesk.com",
86
+ "external_id": null,
87
+ "id": 11,
88
+ "last_login_at": "2012-05-21T21:19:19Z",
89
+ "locale_id": null,
90
+ "moderator": true,
91
+ "name": "Agent Extraordinaire",
92
+ "notes": null,
93
+ "only_private_comments": false,
94
+ "organization_id": 11,
95
+ "phone": null,
96
+ "photo": null,
97
+ "role": "admin",
98
+ "shared": false,
99
+ "signature": null,
100
+ "suspended": false,
101
+ "tags": [],
102
+ "ticket_restriction": null,
103
+ "time_zone": "Pacific Time (US & Canada)",
104
+ "updated_at": "2012-05-08T01:04:47Z",
105
+ "url": "http://dev.localhost:3001/api/v2/users/11.json",
106
+ "verified": true
107
+ }
108
+ }
109
+ ```
110
+
111
+ ### Supported End Points
112
+
113
+ Currently the below end points support side loading. You can side load a single type of resource, or given in the examples.
114
+
115
+ * `/api/v2/organizations.json?include=users,groups`
116
+ * `/api/v2/tickets/123/audits.json?include=users,organizations,groups,tickets`
117
+ * `/api/v2/tickets/123.json?include=users,organizations,groups`
118
+ * `/api/v2/users/123.json?include=organizations,abilities,custom_roles`
119
+ * `/api/v2/memberships.json?include=users,groups`
120
+ * `/api/v2/topics.json?include=users,forums`
121
+ * `/api/v2/forums/123/topics.json?include=users`
122
+ * `/api/v2/users/123/topics.json?include=users`
123
+ * `/api/v2/topic_comments.json?include=users`
124
+ * `/api/v2/topics/123/comments.json?include=users`
125
+ * `/api/v2/users/123/topic_comments.json?include=users`
@@ -0,0 +1,182 @@
1
+ ## Suspended Tickets
2
+
3
+
4
+ | Name | Type | Read-only | Mandatory | Comment
5
+ | ---------------- | ---------------------- | --------- | --------- | -------
6
+ | id | integer | yes | no | Automatically assigned
7
+ | url | string | yes | no | The API url of this ticket
8
+ | author | object | yes | no | The author id (if available), name and email
9
+ | subject | string | yes | no | The value of the subject field for this ticket
10
+ | content | string | yes | no | The content that was flagged
11
+ | cause | string | yes | no | Why the ticket was suspended
12
+ | message_id | string | yes | no | The id of the email, if available
13
+ | created_at | date | yes | no | When this record was created
14
+ | updated_at | date | yes | no | When this record last got updated
15
+ | via | [Via](#the-via-object) | yes | no | This object explains how the ticket was created
16
+
17
+ #### Example
18
+ ```js
19
+ {
20
+ "id": 435,
21
+ "url": "https://example.zendesk.com/api/v2/tickets/35436.json",
22
+ "author": { "id": 1, "name": "Mr. Roboto", "email": "styx@example.com" },
23
+ "subject": "Help, my printer is on fire!",
24
+ "content": "Out Of Office Reply",
25
+ "cause": "Detected as spam",
26
+ "created_at": "2009-07-20T22:55:29Z",
27
+ "updated_at": "2011-05-05T10:38:52Z",
28
+ "via": {
29
+ "channel": "web"
30
+ }
31
+ }
32
+ ```
33
+
34
+ ### Listing Suspended Tickets
35
+ `GET /api/v2/suspended_tickets.json`
36
+
37
+ #### Allowed For
38
+
39
+ * Unrestricted Agents
40
+
41
+ #### Using curl
42
+
43
+ ```bash
44
+ curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets.json \
45
+ -v -u {email_address}:{password}
46
+ ```
47
+
48
+ #### Example Response
49
+ ```http
50
+ Status: 200 OK
51
+
52
+ {
53
+ "suspended_tickets": [
54
+ {
55
+ "id": 3436,
56
+ "subject": "Help I need somebody!",
57
+ "cause": "Detected as spam",
58
+ ...
59
+ },
60
+ {
61
+ "id": 207623,
62
+ "subject": "Not just anybody!",
63
+ "cause": "Automated response mail",
64
+ ...
65
+ },
66
+ ]
67
+ }
68
+ ```
69
+
70
+ ### Getting Suspended Tickets
71
+ `GET /api/v2/suspended_tickets/{id}.json`
72
+
73
+ #### Allowed For
74
+
75
+ * Unrestricted Agents
76
+
77
+ #### Using curl:
78
+
79
+ ```bash
80
+ curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/{id}.json \
81
+ -v -u {email_address}:{password}
82
+ ```
83
+
84
+ #### Example Response
85
+
86
+ ```http
87
+ Status: 200 OK
88
+
89
+ {
90
+ "suspended_ticket": {
91
+ {
92
+ "id": 35436,
93
+ "subject": "My printer is on fire!",
94
+ "cause": "Automated response mail",
95
+ ...
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ ### Recovering Suspended Tickets
102
+ `PUT /api/v2/suspended_tickets/{id}/recover.json`
103
+
104
+ #### Allowed For
105
+
106
+ * Unrestricted Agents
107
+
108
+ #### Using curl
109
+
110
+ ```bash
111
+ curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/{id}/recover.json \
112
+ -X PUT -v -u {email_address}:{password}
113
+ ```
114
+
115
+ #### Example Response
116
+
117
+ ```http
118
+ Status: 200 OK
119
+ ```
120
+
121
+ ### Recovering Multiple Suspended Tickets
122
+ `PUT /api/v2/suspended_tickets/recover_many.json?ids={id1},{id2}`
123
+
124
+ Note: Suspended tickets that fail to be recovered will be included in the response.
125
+
126
+ #### Allowed For
127
+
128
+ * Unrestricted Agents
129
+
130
+ #### Using curl
131
+
132
+ ```bash
133
+ curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/recover_many.json?ids={id1},{id2} \
134
+ -H "Content-Type: application/json" -X PUT \
135
+ -v -u {email_address}:{password}
136
+ ```
137
+
138
+ #### Example Response
139
+
140
+ ```http
141
+ Status: 200 OK
142
+ ```
143
+
144
+ ### Deleting Tickets
145
+ `DELETE /api/v2/suspended_tickets/{id}.json`
146
+
147
+ #### Allowed For
148
+
149
+ * Unrestricted Agents
150
+
151
+ #### Using curl
152
+
153
+ ```bash
154
+ curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/{id}.json \
155
+ -v -u {email_address}:{password} -X DELETE
156
+ ```
157
+
158
+ #### Example Response
159
+
160
+ ```http
161
+ Status: 200 OK
162
+ ```
163
+
164
+ ### Deleting Multiple Tickets
165
+ `DELETE /api/v2/suspended_tickets/destroy_many.json?ids={id1},{id2}`
166
+
167
+ #### Allowed For
168
+
169
+ * Unrestricted Agents
170
+
171
+ #### Using curl
172
+
173
+ ```bash
174
+ curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/destroy_many.json?ids={id1},{id2} \
175
+ -v -u {email_address}:{password} -X DELETE
176
+ ```
177
+
178
+ #### Example Response
179
+
180
+ ```http
181
+ Status: 200 OK
182
+ ```