zendesk_api 0.1.11 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,229 @@
1
+ ## Forums
2
+
3
+ ### JSON Format
4
+ Forums are represented with the following 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 forum
10
+ | name | string | no | yes | The name of the forum
11
+ | description | string | no | no | A description of the forum
12
+ | category_id | integer | no | no | Category this forum is in
13
+ | organization_id | integer | no | no | Organization this forum is restricted to
14
+ | locale_id | integer | no | no | User locale id this forum is restricted to
15
+ | locked | boolean | no | no | Whether this forum is locked such that new entries and comments cannot be made
16
+ | unanswered_topics | integer | yes | no | Contains the number of unanswered questions if this forum's topics are questions.
17
+ | position | integer | no | no | The position of this forum relative to other forums in the same category
18
+ | forum_type | string | no | no | The type of the topics in this forum, valid values: "articles", "ideas" or "questions"
19
+ | access | string | no | no | Who has access to this forum, valid values: "everybody", "logged-in users" or "agents only"
20
+ | created_at | date | yes | no | The time the forum was created
21
+ | updated_at | date | yes | no | The time of the last update of the forum
22
+
23
+ #### Example
24
+ ```js
25
+ {
26
+ "id": 35436,
27
+ "url": "https://company.zendesk.com/api/v2/forums/35436.json",
28
+ "name": "FAQs",
29
+ "description:": "This forum contains all product FAQs",
30
+ "category_id": null,
31
+ "organization_id": null,
32
+ "locale_id": null,
33
+ "locked": true,
34
+ "position": 4,
35
+ "forum_type": "articles",
36
+ "access": "everybody",
37
+ "created_at": "2010-07-20T22:55:29Z",
38
+ "updated_at": "2012-03-05T10:38:52Z"
39
+ }
40
+ ```
41
+
42
+ ### List Forums
43
+ `GET /api/v2/forums.json`
44
+
45
+ `GET /api/v2/categories/{id}/forums.json`
46
+
47
+ #### Allowed For:
48
+
49
+ * Anyone on accounts that have at least one publicly accessible forum
50
+ * End users and agents on accounts that have at least one logged-in user accessible forum
51
+ * Admins
52
+
53
+ Only lists the forums available to the inquiring user as per the individual forum settings.
54
+
55
+ #### Using curl
56
+
57
+ ```bash
58
+ curl https://{subdomain}.zendesk.com/api/v2/forums.json \
59
+ -v -u {email_address}:{password}
60
+ ```
61
+
62
+ #### Example Response
63
+
64
+ ```http
65
+ Status: 200 OK
66
+
67
+ {
68
+ "forums": [
69
+ {
70
+ "id": 35436,
71
+ "name": "FAQs",
72
+ "description:": "This forum contains all product FAQs",
73
+ "category_id": null,
74
+ "organization_id": null,
75
+ "locale_id": null,
76
+ "locked": true,
77
+ "position": 4,
78
+ "forum_type": "articles",
79
+ "access": "everybody",
80
+ "created_at": "2010-07-20T22:55:29Z",
81
+ "updated_at": "2012-03-05T10:38:52Z"
82
+ },
83
+ {
84
+ "id": 12,
85
+ ...
86
+ "created_at": "2011-07-20T04:31:29Z",
87
+ "updated_at": "2012-02-02T10:32:59Z"
88
+ }
89
+ ]
90
+ }
91
+ ```
92
+
93
+ ### Show Forum
94
+ `GET /api/v2/forums/{id}.json`
95
+
96
+ #### Allowed For:
97
+
98
+ * Anyone with permission to access this specific forum
99
+
100
+ #### Using curl
101
+
102
+ ```bash
103
+ curl https://{subdomain}.zendesk.com/api/v2/forums/{id}.json \
104
+ -v -u {email_address}:{password}
105
+ ```
106
+
107
+ #### Example Response
108
+
109
+ ```http
110
+ Status: 200 OK
111
+
112
+ {
113
+ "forum": {
114
+ "id": 35436,
115
+ "name": "FAQs",
116
+ "description:": "This forum contains all product FAQs",
117
+ "category_id": null,
118
+ "organization_id": null,
119
+ "locale_id": null,
120
+ "locked": true,
121
+ "position": 4,
122
+ "forum_type": "articles",
123
+ "access": "everybody",
124
+ "created_at": "2010-07-20T22:55:29Z",
125
+ "updated_at": "2012-03-05T10:38:52Z"
126
+ }
127
+ }
128
+ ```
129
+
130
+ ### Create Forum
131
+ `POST /api/v2/forums.json`
132
+
133
+ #### Allowed For
134
+
135
+ * Admins on non-enterprise accounts
136
+ * Admins and agents will full forum access on enterprise accounts
137
+
138
+ #### Using curl
139
+
140
+ ```bash
141
+ curl https://{subdomain}.zendesk.com/api/v2/forums.json \
142
+ -H "Content-Type: application/json" -X POST \
143
+ -d '{"forum": {"name": "My Forum", "forum_type": "articles", "access": "logged-in users" }}' \
144
+ -v -u {email_address}:{password}
145
+ ```
146
+
147
+ #### Example Response
148
+
149
+ ```http
150
+ Status: 201 Created
151
+ Location: https://{subdomain}.zendesk.com/api/v2/forums/{id}.json
152
+
153
+ {
154
+ "forum": {
155
+ "id": 354882,
156
+ "name": "My Forum",
157
+ "description:": null,
158
+ "category_id": null,
159
+ "organization_id": null,
160
+ "locale_id": null,
161
+ "locked": false,
162
+ "position": 9999,
163
+ "forum_type": "articles",
164
+ "access": "logged-in users",
165
+ "created_at": "2012-03-05T10:38:52Z",
166
+ "updated_at": "2012-03-05T10:38:52Z"
167
+ }
168
+ }
169
+ ```
170
+
171
+ ### Update Forum
172
+ `PUT /api/v2/forum/{id}.json`
173
+
174
+ #### Allowed For
175
+
176
+ * Admins on non-enterprise accounts
177
+ * Admins and agents will full forum access on enterprise accounts
178
+
179
+ #### Using curl
180
+
181
+ ```bash
182
+ curl https://{subdomain}.zendesk.com/api/v2/forums/{id}.json \
183
+ -H "Content-Type: application/json" -d '{"forum": {"name": "The Forum"}}' \
184
+ -v -u {email_address}:{password} -X PUT
185
+ ```
186
+
187
+ #### Example Response
188
+
189
+ ```http
190
+ Status: 200 OK
191
+
192
+ {
193
+ "forum": {
194
+ "id": 354882,
195
+ "name": "The Forum",
196
+ "description:": null,
197
+ "category_id": null,
198
+ "organization_id": null,
199
+ "locale_id": null,
200
+ "locked": false,
201
+ "position": 9999,
202
+ "forum_type": "articles",
203
+ "access": "logged-in users",
204
+ "updated_at": "2012-03-05T10:38:52Z",
205
+ "updated_at": "2012-03-10T04:28:11Z"
206
+ }
207
+ }
208
+ ```
209
+
210
+ ### Delete Forum
211
+ `DELETE /api/v2/forums/{id}.json`
212
+
213
+ #### Allowed For
214
+
215
+ * Admins on non-enterprise accounts
216
+ * Admins and agents will full forum access on enterprise accounts
217
+
218
+ #### Using curl
219
+
220
+ ```bash
221
+ curl https://{subdomain}.zendesk.com/api/v2/forums/{id}.json \
222
+ -v -u {email_address}:{password} -X DELETE
223
+ ```
224
+
225
+ #### Example Response
226
+
227
+ ```http
228
+ Status: 200 OK
229
+ ```
@@ -0,0 +1,229 @@
1
+ ## Group Memberships
2
+
3
+ A membership links an agent to a group. Groups can have many agents, as agents can be in many groups. You can use the API to list what agents are in which groups, and reassign group members.
4
+
5
+ ### JSON Format
6
+ Memberships are simple links between a user and a group
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 record
12
+ | user_id | integer | no | yes | The id of an agent
13
+ | group_id | integer | no | yes | The id of a group
14
+ | default | boolean | no | no | If true, tickets assigned directly to the agent will assume this membership's group.
15
+ | created_at | date | yes | no | The time the membership was created
16
+ | updated_at | date | yes | no | The time of the last update of the membership
17
+
18
+ #### Example
19
+ ```js
20
+ {
21
+ "id": 4,
22
+ "user_id": 29,
23
+ "group_id": 12,
24
+ "default": true,
25
+ "created_at": "2009-05-13T00:07:08Z",
26
+ "updated_at": "2011-07-22T00:11:12Z"
27
+ }
28
+ ```
29
+
30
+ ### List Memberships
31
+ `GET /api/v2/group_memberships.json`
32
+
33
+ `GET /api/v2/users/{user_id}/group_memberships.json`
34
+
35
+ `GET /api/v2/groups/{group_id}/memberships.json`
36
+
37
+ #### Allowed For:
38
+
39
+ * Agents
40
+
41
+ #### Using curl
42
+
43
+ ```bash
44
+ curl https://{subdomain}.zendesk.com/api/v2/group_memberships.json \
45
+ -v -u {email_address}:{password}
46
+ ```
47
+
48
+ #### Example Response
49
+
50
+ ```http
51
+ Status: 200 OK
52
+
53
+ {
54
+ "group_memberships": [
55
+ {
56
+ "id": 4,
57
+ "user_id": 29,
58
+ "group_id": 12,
59
+ "default": true,
60
+ "created_at": "2009-05-13T00:07:08Z",
61
+ "updated_at": "2011-07-22T00:11:12Z"
62
+ },
63
+ {
64
+ "id": 49,
65
+ "user_id": 155,
66
+ "group_id": 3,
67
+ "default": false,
68
+ "created_at": "2012-03-13T22:01:32Z",
69
+ "updated_at": "2012-03-13T22:01:32Z"
70
+ }
71
+ ]
72
+ }
73
+ ```
74
+
75
+ ### List Assignable Memberships
76
+ `GET /api/v2/group_memberships/assignable.json`
77
+
78
+ `GET /api/v2/groups/{group_id}/memberships/assignable.json`
79
+
80
+ #### Allowed For:
81
+
82
+ * Agents
83
+
84
+ #### Using curl
85
+
86
+ ```bash
87
+ curl https://{subdomain}.zendesk.com/api/v2/group_memberships/assignable.json \
88
+ -v -u {email_address}:{password}
89
+ ```
90
+
91
+ #### Example Response
92
+
93
+ ```http
94
+ Status: 200 OK
95
+
96
+ {
97
+ "group_memberships": [
98
+ {
99
+ "id": 4,
100
+ "user_id": 29,
101
+ "group_id": 12,
102
+ "default": true,
103
+ "created_at": "2009-05-13T00:07:08Z",
104
+ "updated_at": "2011-07-22T00:11:12Z"
105
+ },
106
+ {
107
+ "id": 49,
108
+ "user_id": 155,
109
+ "group_id": 3,
110
+ "default": false,
111
+ "created_at": "2012-03-13T22:01:32Z",
112
+ "updated_at": "2012-03-13T22:01:32Z"
113
+ }
114
+ ]
115
+ }
116
+ ```
117
+
118
+ ### Show Membership
119
+ `GET /api/v2/group_memberships/{id}.json`
120
+
121
+ `GET /api/v2/users/{user_id}/group_memberships/{id}.json`
122
+
123
+ #### Allowed For
124
+
125
+ * Agents
126
+
127
+ #### Using curl
128
+
129
+ ```bash
130
+ curl https://{subdomain}.zendesk.com/api/v2/group_memberships/{id}.json \
131
+ -v -u {email_address}:{password}
132
+ ```
133
+
134
+ #### Example Response
135
+
136
+ ```http
137
+ Status: 200 OK
138
+
139
+ {
140
+ "group_membership": {
141
+ "id": 4,
142
+ "user_id": 29,
143
+ "group_id": 12,
144
+ "default": true,
145
+ "created_at": "2009-05-13T00:07:08Z",
146
+ "updated_at": "2011-07-22T00:11:12Z"
147
+ }
148
+ }
149
+ ```
150
+
151
+ ### Create Membership
152
+ `POST /api/v2/group_memberships.json`
153
+
154
+ `POST /api/v2/users/{user_id}/group_memberships.json`
155
+
156
+ Creating a membership means assigning an agent to a given group
157
+
158
+ #### Allowed For
159
+
160
+ * Admins
161
+
162
+ #### Using curl
163
+
164
+ ```bash
165
+ curl https://{subdomain}.zendesk.com/api/v2/group_memberships.json \
166
+ -X POST -d '{"group_membership": {"user_id": 72, "group_id": 88}}' \
167
+ -H "Content-Type: application/json" -v -u {email_address}:{password}
168
+ ```
169
+
170
+ #### Example Response
171
+
172
+ ```http
173
+ Status: 201 Created
174
+ Location: https://{subdomain}.zendesk.com/api/v2/group_memberships/{id}.json
175
+
176
+ {
177
+ "group_membership": {
178
+ "id": 461,
179
+ "user_id": 72,
180
+ "group_id": 88,
181
+ "default": true,
182
+ "created_at": "2012-04-03T12:34:01Z",
183
+ "updated_at": "2012-04-03T12:34:01Z"
184
+ }
185
+ }
186
+ ```
187
+
188
+ ### Delete Membership
189
+ `DELETE /api/v2/group_memberships/{id}.json`
190
+
191
+ `DELETE /api/v2/users/{user_id}/group_memberships/{id}.json`
192
+
193
+ Immediately removes a user from a group and schedules a job to unassign all working tickets
194
+ that are assigned to the given user and group combination
195
+
196
+ #### Allowed For
197
+
198
+ * Admins
199
+
200
+ #### Using curl
201
+
202
+ ```bash
203
+ curl https://{subdomain}.zendesk.com/api/v2/group_memberships/{id}.json \
204
+ -v -u {email_address}:{password} -X DELETE
205
+ ```
206
+
207
+ #### Example Response
208
+
209
+ ```http
210
+ Status: 200 OK
211
+ ```
212
+
213
+ ### Set membership as default
214
+ `PUT /api/v2/users/{user_id}/group_memberships/{id}/make_default.json`
215
+
216
+ #### Allowed For
217
+
218
+ * Agents
219
+
220
+ #### Using curl
221
+
222
+ ```bash
223
+ curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/group_memberships/{id}/make_default.json \
224
+ -v -u {email_address}:{password} -X PUT
225
+ ```
226
+
227
+ #### Example Response
228
+
229
+ Same as List Memberships