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,279 +0,0 @@
1
- ## User Identities
2
-
3
- A user identity is something that can be used to identify an individual. Most likely, it's an email address, a twitter handle or a phone number. Zendesk supports a series of different such identities.
4
-
5
- ### JSON Format
6
- User identities have the following keys:
7
-
8
- | Name | Type | Read-only | Mandatory | Comment
9
- | --------------- | ------- | --------- | --------- | -------
10
- | id | integer | yes | no | Automatically assigned upon creation
11
- | url | string | yes | no | The API url of this identity
12
- | user_id | integer | yes | yes | The id of the user
13
- | type | string | yes | yes | One of "email", "twitter", "facebook", "google", or "phone_number"
14
- | value | string | yes | yes | The identifier for this identity, e.g. an email address
15
- | verified | boolean | no | no | Is true of the identity has gone through verification
16
- | primary | boolean | no | no | Is true of the primary identity of the user
17
- | created_at | date | yes | no | The time the identity got created
18
- | updated_at | date | yes | no | The time the identity got updated
19
-
20
- #### Example
21
- ```js
22
- {
23
- "id": 35436,
24
- "url": "https://company.zendesk.com/api/v2/users/135/identities/35436.json",
25
- "user_id": 135,
26
- "type": "email",
27
- "value": "someone@example.com",
28
- "verified": true,
29
- "primary": true,
30
- "updated_at": "2011-07-20T22:55:29Z",
31
- "created_at": "2011-07-20T22:55:29Z"
32
- }
33
- ```
34
-
35
- ### List User Identities
36
- `GET /api/v2/users/{user_id}/identities.json`
37
-
38
- Returns all user identities for a given user id
39
-
40
- #### Allowed For
41
-
42
- * Agents
43
-
44
- #### Using curl
45
-
46
- ```bash
47
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities.json \
48
- -v -u {email_address}:{password}
49
- ```
50
-
51
- #### Example Response:
52
-
53
- ```http
54
- Status: 200 OK
55
-
56
- {
57
- "identities": [
58
- {
59
- "id": 35436,
60
- "user_id": 135,
61
- "type": "email",
62
- "value": "someone@example.com",
63
- "verified": true,
64
- "primary": true,
65
- "updated_at": "2011-07-20T22:55:29Z",
66
- "created_at": "2011-07-20T22:55:29Z"
67
- },
68
- {
69
- "id": 77136,
70
- "user_id": 135,
71
- "type": "twitter",
72
- "value": "didgeridooboy",
73
- "verified": true,
74
- "primary": false,
75
- "updated_at": "2012-02-12T14:25:21Z",
76
- "created_at": "2012-02-12T14:25:21Z"
77
- }
78
- ]
79
- }
80
- ```
81
-
82
- ### Show a User Identity
83
- `GET /api/v2/users/{user_id}/identities/{id}.json`
84
-
85
- Shows the identity with the given id
86
-
87
- #### Allowed For
88
-
89
- * Agents
90
-
91
- #### Using curl
92
-
93
- ```bash
94
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities/{id}.json \
95
- -v -u {email_address}:{password}
96
- ```
97
-
98
- #### Example Response:
99
-
100
- ```http
101
- Status: 200 OK
102
-
103
- {
104
- "id": 77938,
105
- "user_id": 13531,
106
- "type": "twitter",
107
- "value": "cabanaboy",
108
- "verified": false,
109
- "primary": false,
110
- "updated_at": "2012-02-12T14:25:21Z",
111
- "created_at": "2012-02-12T14:25:21Z"
112
- }
113
- ```
114
-
115
- ### Add User Identity
116
- `POST /api/v2/users/{user_id}/identities.json`
117
-
118
- Add new identities for a given user id. Identities that can be added are:
119
-
120
- * email - e.g., `{ "type" : "email", "value" : "someone@example.com" }`
121
- * twitter - e.g., `{ "type" : "twitter", "value" : "screen_name" }`
122
- * facebook - e.g., `{ "type" : "facebook", "value" : "855769377321" }`
123
- * google - e.g., `{ "type" : "google", "value" : "example@gmail.com" }`
124
-
125
- If you need to create an identity without sending out a verification email, pass a `"verified": true` parameter.
126
-
127
- #### Allowed For
128
-
129
- * Agents
130
-
131
- #### Using curl
132
-
133
- ```bash
134
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities.json \
135
- -H "Content-Type: application/json" -X POST \
136
- -d '{"identity": {"type": "email", "value": "foo@bar.com"}}' -v -u {email_address}:{password}
137
- ```
138
-
139
- #### Example Response
140
-
141
- ```http
142
- Status: 201 Created
143
- Location: https://{subdomain}.zendesk.com/api/v2/users/135/identities/78138.json
144
-
145
- {
146
- "id": 78138,
147
- "user_id": 135,
148
- "type": "twitter",
149
- "value": "cabanaboy",
150
- "verified": false,
151
- "primary": false,
152
- "updated_at": "2012-02-12T14:25:21Z",
153
- "created_at": "2012-02-12T14:25:21Z"
154
- }
155
- ```
156
-
157
- ### Update a given User Identity
158
- `PUT /api/v2/users/{user_id}/identities/{id}.json?identity[verified]=true`
159
-
160
- This API method only allows you to set an identity as verified. You cannot otherwise
161
- change value of an identity but must create a new identity and delete the one you're
162
- replacing.
163
-
164
- #### Allowed For
165
-
166
- * Agents
167
-
168
- #### Using curl
169
-
170
- ```bash
171
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities/{id}.json \
172
- -H "Content-Type: application/json" -X PUT \
173
- -d '{"identity": {"verified": true}}' -v -u {email_address}:{password}
174
- ```
175
-
176
- #### Example Response
177
-
178
- ```http
179
- Status: 200 OK
180
-
181
- {
182
- "id": 78138,
183
- "user_id": 135,
184
- "type": "twitter",
185
- "value": "cabanaboy",
186
- "verified": true,
187
- "primary": false,
188
- "updated_at": "2012-02-12T14:25:21Z",
189
- "created_at": "2012-02-12T14:25:21Z"
190
- }
191
- ```
192
-
193
- ### Make a User Identity the Primary
194
- `PUT /api/v2/users/{user_id}/identities/{id}/make_primary`
195
-
196
- This API method only allows you to set an identity to primary. If you wish to change an identity, you
197
- create a new one with the correct value and delete the old one. This is a collection level operation
198
- and the correct behavior for an API client is to subsequently reload the entire collection.
199
-
200
- #### Allowed For
201
-
202
- * Agents
203
-
204
- #### Using curl
205
-
206
- ```bash
207
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities/{id}/make_primary.json \
208
- -X PUT -v -u {email_address}:{password}
209
- ```
210
-
211
- #### Example Response
212
-
213
- Same as List User Identities
214
-
215
-
216
- ### Verify a given User Identity
217
- `PUT /users/{user_id}/identities/{id}/verify`
218
-
219
- This API method only allows you to set an identity as verified.
220
-
221
- #### Allowed For
222
-
223
- * Agents
224
-
225
- #### Using curl
226
-
227
- ```bash
228
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities/{id}/verify.json \
229
- -X PUT -v -u {email_address}:{password}
230
- ```
231
-
232
- #### Example Response
233
-
234
- Same as Show a User Identity
235
-
236
-
237
- ### Request User Verification
238
- `PUT /users/{user_id}/identities/{id}/request_verification
239
-
240
- This sends a verification email to the user, asking him to click a link in order to verify ownership of the email address
241
-
242
- #### Allowed For
243
-
244
- * Agents
245
-
246
- #### Using curl
247
-
248
- ```bash
249
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities/{id}/request_verification.json \
250
- -X PUT -v -u {email_address}:{password}
251
- ```
252
-
253
- #### Example Response
254
-
255
- ```http
256
- Status: 200 OK
257
- ```
258
-
259
- ### Delete User Identity
260
- `DELETE /users/{user_id}/identities/{id}.json`
261
-
262
- Delete identity for a given user
263
-
264
- #### Allowed For
265
-
266
- * Agents
267
-
268
- #### Using curl
269
-
270
- ```bash
271
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/identities/{id}.json \
272
- -X DELETE -v -u {email_address}:{password}
273
- ```
274
-
275
- #### Example Response
276
-
277
- ```http
278
- Status: 200 OK
279
- ```
@@ -1,455 +0,0 @@
1
- ## Users
2
-
3
- Zendesk has three main types of users: End-users (your customers), Agents and Administrators.
4
-
5
- #### End-users
6
-
7
- End-users request support via Tickets. End-users have access to the Zendesk end-user portal where they can view forum content, access their ticket history, and submit new Tickets.
8
-
9
- #### Agents
10
-
11
- Agents work in Zendesk to solve Tickets. Agents can be divided into multiple Groups and can also belong to multiple Groups. Agents do not have access to administrative configuration in Zendesk such as business rules or automations, but can configure their own Macros and Views.
12
-
13
- #### Administrators
14
-
15
- Administrators have all the abilities of Agents, plus administrative abilities. Accounts on the Enterprise plan can configure custom roles to give Agents varying degrees of administrative access.
16
-
17
- ### Show Requested Tickets, CCed Tickets and Topics for a User
18
-
19
- See our Tickets API to retrieve [tickets requested by a User](tickets.html#listing-tickets), [tickets on which a user is CCed](tickets.html#listing-tickets).
20
-
21
- See our Topics API to retrieve [topics created by a User](topics.html#list-topics) and [topic comments from a User](topic_comments.html#list-topic-comments).
22
-
23
- ### JSON Format
24
- Users are represented as JSON objects which have the following keys:
25
-
26
- | Name | Type | Read-only | Mandatory | Comment
27
- | --------------------- | ---------------------------- | --------- | --------- | -------
28
- | id | integer | yes | no | Automatically assigned when creating users
29
- | url | string | yes | no | The API url of this user
30
- | name | string | no | yes | The name of the user
31
- | external_id | string | no | no | A unique id you can set on a user
32
- | alias | string | no | no | Agents can have an alias that is displayed to end-users
33
- | created_at | date | yes | no | The time the user was created
34
- | updated_at | date | yes | no | The time of the last update of the user
35
- | active | boolean | yes | no | Users that have been deleted will have the value `false` here
36
- | verified | boolean | no | no | Zendesk has verified that this user is who he says he is
37
- | shared | boolean | yes | no | If this user is shared from a different Zendesk, ticket sharing accounts only
38
- | locale_id | integer | no | no | The language identifier for this user
39
- | time_zone | string | no | no | The time-zone of this user
40
- | last_login_at | date | yes | no | A time-stamp of the last time this user logged in to Zendesk
41
- | email | string | no | yes | The primary email address of this user
42
- | phone | string | no | no | The primary phone number of this user
43
- | identities | Array | no | no | Array of user identities (e.g. email and Twitter) associated with this user. See [User Identities](user_identities.html)
44
- | signature | string | no | no | The signature of this user. Only agents and admins can have signatures
45
- | details | string | no | no | In this field you can store any details obout the user. e.g. the address
46
- | notes | string | no | no | In this field you can store any notes you have about the user
47
- | organization_id | integer | no | no | The id of the organization this user is associated with
48
- | role | string | no | yes | The role of the user. Possible values: `"end-user"`, `"agent"`, `"admin"`
49
- | custom_role_id | integer | no | no | A custom role on the user if the user is an agent on the entreprise plan
50
- | moderator | boolean | no | no | Designates whether this user has forum moderation capabilities
51
- | ticket_restriction | string | no | no | Specified which tickets this user has access to. Possible values are: `"organization"`, `"groups"`, `"assigned"`, `"requested"`, `null`
52
- | only_private_comments | boolean | no | no | `true` if this user only can create private comments
53
- | tags | array | no | no | The tags of the user. Only present if your account has user tagging enabled
54
- | suspended | boolean | no | no | Tickets from suspended users are also suspended, and these users cannot log in to the end-user portal
55
- | photo | [Attachment](attachments.md) | no | no | The user's profile picture represented as an [Attachment](attachments.md) object
56
-
57
- #### Example
58
- ```js
59
- {
60
- "id": 35436,
61
- "url": "https://company.zendesk.com/api/v2/users/35436.json",
62
- "name": "Johnny Agent",
63
- "external_id": "sai989sur98w9",
64
- "alias": "Mr. Johnny",
65
- "created_at": "2009-07-20T22:55:29Z",
66
- "updated_at": "2011-05-05T10:38:52Z",
67
- "active": true,
68
- "verified": true,
69
- "shared": false,
70
- "locale_id": 1,
71
- "time_zone": "Copenhagen",
72
- "last_login_at": "2011-05-05T10:38:52Z",
73
- "email": "johnny@example.com",
74
- "phone": "555-123-4567",
75
- "signature": "Have a nice day, Johnny",
76
- "details": "",
77
- "notes": "Johnny is a nice guy!",
78
- "organization_id": 57542,
79
- "role": "agent",
80
- "custom_role_id": 9373643,
81
- "moderator": true,
82
- "ticket_restriction": "assigned",
83
- "only_private_comments": false,
84
- "tags": ["enterprise", "other_tag"],
85
- "suspended": true,
86
- "photo": {
87
- "id": 928374,
88
- "name": "my_funny_profile_pic.png",
89
- "content_url": "https://company.zendesk.com/photos/my_funny_profile_pic.png",
90
- "content_type": "image/png",
91
- "size": 166144,
92
- "thumbnails": [
93
- {
94
- "id": 928375,
95
- "name": "my_funny_profile_pic_thumb.png",
96
- "content_url": "https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png",
97
- "content_type": "image/png",
98
- "size": 58298,
99
- }
100
- ]
101
- }
102
- }
103
- ```
104
-
105
- ### List Users
106
-
107
- `GET /api/v2/users.json`
108
-
109
- `GET /api/v2/groups/{id}/users.json`
110
-
111
- `GET /api/v2/organizations/{id}/users.json`
112
-
113
- #### Allowed For
114
-
115
- * Agents
116
-
117
- #### Using curl
118
-
119
- ```bash
120
- curl https://{subdomain}.zendesk.com/api/v2/users.json \
121
- -v -u {email_address}:{password}
122
- ```
123
-
124
- #### Example Response
125
-
126
- ```http
127
- Status: 200
128
-
129
- {
130
- "users": [
131
- {
132
- "id": 223443,
133
- "name": "Johnny Agent",
134
- ...
135
- },
136
- {
137
- "id": 8678530,
138
- "name": "James A. Rosen",
139
- ...
140
- }
141
- ]
142
- }
143
- ```
144
-
145
- ### Show User
146
-
147
- `GET /api/v2/users/{id}.json`
148
-
149
- #### Allowed For:
150
-
151
- * Agents
152
-
153
- #### Using curl:
154
-
155
- ```bash
156
- curl https://{subdomain}.zendesk.com/api/v2/users/{id}.json \
157
- -v -u {email_address}:{password}
158
- ```
159
-
160
- #### Example Response
161
-
162
- ```http
163
- Status: 200
164
-
165
- {
166
- "user": {
167
- "id": 35436,
168
- "name": "Johnny Agent",
169
- ...
170
- }
171
- }
172
- ```
173
-
174
- ### Create User
175
- `POST /api/v2/users.json`
176
-
177
- #### Allowed For
178
-
179
- * Agents, restrictions apply on certain actions
180
-
181
- #### Using curl
182
-
183
- ```bash
184
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users.json \
185
- -H "Content-Type: application/json" -X POST -d '{"user": {"name": "Roger Wilco", "email": "roge@example.org"}}'
186
- ```
187
-
188
- If you need to create users without sending out a verification email, pass a `"verified": true` parameter.
189
-
190
- #### Example Response
191
-
192
- ```http
193
- Status: 201 Created
194
- Location: /api/v2/users/{new-user-id}.json
195
-
196
- {
197
- "user": {
198
- "id": 9873843,
199
- "name": "Roger Wilco",
200
- ...
201
- }
202
- }
203
- ```
204
-
205
- ### Create User with Multiple Identities
206
-
207
- If you have a user with multiple identities, such as email addresses and Twitter accounts, you can also include
208
- these values at creation time. This is especially useful when importing users from another system.
209
-
210
- ```bash
211
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users.json \
212
- -H "Content-Type: application/json" -X POST -d '{"user": {"name": "Roger Wilco", "identities": [{ "type": "email", "value": "test@user.com"}, {"type": "twitter", "value": "tester84" }]}}'
213
- ```
214
-
215
- ### Create Many Users
216
- `POST /api/v2/users/create_many.json`
217
-
218
- #### Allowed For
219
-
220
- * Agents, restrictions apply on certain actions
221
-
222
- #### Using curl
223
-
224
- ```bash
225
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users/create_many.json \
226
- -H "Content-Type: application/json" -X POST -d '{"users": [{"name": "Roger Wilco", "email": "roge@example.org", "role": "agent"}, {"name": "Woger Rilco", "email": "woge@example.org", "role": "admin"}]}'
227
- ```
228
-
229
- #### Example Response
230
-
231
- See [Job Status](job_statuses.md#show-job-status)
232
-
233
- ### Update User
234
- `PUT /api/v2/users/{id}.json`
235
-
236
- #### Allowed For
237
-
238
- * Agents, restrictions apply on certain actions
239
-
240
- #### Using curl
241
-
242
- ```bash
243
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users/{id}.json \
244
- -H "Content-Type: application/json" -X PUT -d '{"user": {"name": "Roger Wilco II"}}'
245
- ```
246
-
247
- #### Example Response
248
-
249
- ```http
250
- Status: 200 OK
251
-
252
- {
253
- "user": {
254
- "id": 9873843,
255
- "name": "Roger Wilco II",
256
- ...
257
- }
258
- }
259
- ```
260
-
261
- ### Suspending a User
262
-
263
- You can suspend a User by setting its `suspended` attribute to `true`.
264
-
265
- When a User is suspended, the User is not allowed to login to the end-user portal and
266
- all further tickes are suspended.
267
-
268
- #### Using curl
269
-
270
- ```bash
271
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/users/{id}.json \
272
- -H "Content-Type: application/json" -X PUT -d '{"user": {"suspended":true}}'
273
- ```
274
-
275
- #### Example Response
276
-
277
- ```js
278
- {
279
- "user": {
280
- "id": 9873843,
281
- "name": "Roger Wilco II",
282
- "suspended": true,
283
- ...
284
- }
285
- }
286
- ```
287
-
288
- ### Delete User
289
- `DELETE /api/v2/users/{id}.json`
290
-
291
- #### Allowed For
292
-
293
- * Agents, restrictions apply on certain actions
294
-
295
- #### Using curl
296
-
297
- ```bash
298
- curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users/{id}.json \
299
- -X DELETE
300
- ```
301
-
302
- #### Example Response
303
-
304
- ```http
305
- Status: 200 OK
306
-
307
- {
308
- "user": {
309
- "id": 9873843,
310
- "name": "Roger Wilco II",
311
- ...
312
- "active": false,
313
- ...
314
- }
315
- }
316
- ```
317
-
318
- ### Search Users
319
- `GET /api/v2/users/search.json?query={query}`
320
-
321
- `GET /api/v2/users/search.json?external_id={external_id}`
322
-
323
- You can find a specific user given their `external_id` attribute or email address. Or perform
324
- a search across usernames and email addresses.
325
-
326
- #### Allowed For:
327
-
328
- * Agents
329
-
330
- #### Example Response
331
-
332
- ```http
333
- Status: 200
334
-
335
- [
336
- { .. user record as in the #show method .. },
337
- { .. user record as in the #show method .. }
338
- ]
339
- ```
340
-
341
- ### Autocomplete Users
342
- `POST /api/v2/users/autocomplete.json?name={name}`
343
-
344
-
345
- #### Allowed For
346
-
347
- * Agents
348
-
349
- #### Using curl
350
-
351
- ```bash
352
- curl https://{subdomain}.zendesk.com/api/v2/users/autocomplete.json \
353
- -X POST -d '{"name": "att"}' -H "Accept: application/json" \
354
- -u {email_address}:{password}
355
- ```
356
-
357
- #### Example Response
358
-
359
- ```http
360
- Status: 200
361
-
362
- [
363
- { .. user record as in the #show method .. },
364
- { .. user record as in the #show method .. }
365
- ]
366
- ```
367
-
368
- ### Update a User's Profile Image
369
-
370
- A user's profile image can be updated by uploading a local file or by
371
- referring to an image hosted on a different website. The latter may take
372
- a few minutes to process.
373
-
374
- #### Using curl
375
-
376
- Uploading a local file.
377
-
378
- ```bash
379
- curl -v -u {email_address}:{password} -X PUT \
380
- -F "user[photo][uploaded_data]=@/path/to/profile/image.jpg" \
381
- http://{subdomain}.zendesk.com/api/v2/users/{id}.json
382
- ```
383
-
384
- Setting a remote image URL.
385
-
386
- ```bash
387
- curl -v -u {email_address}:{password} -X PUT -H "Content-Type: application/json" \
388
- -d '{"user": {"remote_photo_url": "http://link.to/profile/image.png"}}' \
389
- http://{subdomain}.zendesk.com/api/v2/users/{id}.json
390
- ```
391
-
392
- ### Show the Currently Authenticated User
393
- `GET /api/v2/users/me.json`
394
-
395
- #### Allowed For:
396
-
397
- * Anyone
398
-
399
- #### Example Response
400
-
401
- ```http
402
- Status: 200
403
-
404
- {
405
- "user": {
406
- "id": 35436,
407
- "name": "Roger Wilco",
408
- ...
409
- }
410
- }
411
- ```
412
-
413
- ### Set a User's Password
414
-
415
- `POST /api/v2/users/{user_id}/password.json`
416
-
417
- #### Allowed For
418
-
419
- * Agents
420
-
421
- #### Using curl
422
-
423
- ```bash
424
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/password.json \
425
- -d '{"password": "newpassword"}' \
426
- -v -u {email_address}:{password} -X POST -H "Content-Type: application/json"
427
- ```
428
-
429
- #### Example Response
430
-
431
- ```http
432
- Status: 200
433
- ```
434
-
435
- ### Change a User's Password
436
-
437
- `PUT /api/v2/users/{user_id}/password.json`
438
-
439
- #### Allowed For
440
-
441
- * Agents
442
-
443
- #### Using curl
444
-
445
- ```bash
446
- curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/password.json \
447
- -d '{"previous_password": "oldpassword", "password": "newpassword"}' \
448
- -v -u {email_address}:{password} -X PUT -H "Content-Type: application/json"
449
- ```
450
-
451
- #### Example Response
452
-
453
- ```http
454
- Status: 200
455
- ```