Rest Groups » History » Version 3

Jean-Philippe Lang, 2012-06-03 15:15

1 1 Jean-Philippe Lang
h1. Groups
2 1 Jean-Philippe Lang
3 2 Jean-Philippe Lang
{{>toc}}
4 2 Jean-Philippe Lang
5 1 Jean-Philippe Lang
h2. /groups.:format
6 1 Jean-Philippe Lang
7 1 Jean-Philippe Lang
h3. GET
8 1 Jean-Philippe Lang
9 1 Jean-Philippe Lang
Returns the list of groups.
10 1 Jean-Philippe Lang
11 1 Jean-Philippe Lang
+Example+:
12 1 Jean-Philippe Lang
13 1 Jean-Philippe Lang
  GET /groups.xml
14 1 Jean-Philippe Lang
15 1 Jean-Philippe Lang
+Response+:
16 1 Jean-Philippe Lang
17 1 Jean-Philippe Lang
<pre>
18 1 Jean-Philippe Lang
<groups type="array">
19 1 Jean-Philippe Lang
  <group>
20 1 Jean-Philippe Lang
    <id>53</id>
21 1 Jean-Philippe Lang
    <name>Managers</name>
22 1 Jean-Philippe Lang
  </group>
23 1 Jean-Philippe Lang
  <group>
24 1 Jean-Philippe Lang
    <id>55</id>
25 1 Jean-Philippe Lang
    <name>Developers</name>
26 1 Jean-Philippe Lang
  </group>
27 1 Jean-Philippe Lang
</groups>
28 1 Jean-Philippe Lang
</pre>
29 1 Jean-Philippe Lang
30 1 Jean-Philippe Lang
h3. POST
31 1 Jean-Philippe Lang
32 1 Jean-Philippe Lang
Creates a group.
33 1 Jean-Philippe Lang
34 1 Jean-Philippe Lang
+Parameters+:
35 1 Jean-Philippe Lang
36 1 Jean-Philippe Lang
* @group@ (required): a hash of the group attributes, including:
37 1 Jean-Philippe Lang
38 1 Jean-Philippe Lang
  * @name@ (required): the group name
39 1 Jean-Philippe Lang
  * @user_ids@: ids of the group users (an empty group is created if not provided)
40 1 Jean-Philippe Lang
41 1 Jean-Philippe Lang
+Example+:
42 1 Jean-Philippe Lang
43 1 Jean-Philippe Lang
<pre>
44 1 Jean-Philippe Lang
POST /groups.xml
45 1 Jean-Philippe Lang
46 1 Jean-Philippe Lang
<group>
47 1 Jean-Philippe Lang
  <name>Developers</name>
48 1 Jean-Philippe Lang
  <user_ids>
49 1 Jean-Philippe Lang
    <user_id>3</user_id>
50 1 Jean-Philippe Lang
    <user_id>5</user_id>
51 1 Jean-Philippe Lang
  </user_ids>
52 1 Jean-Philippe Lang
</group>
53 1 Jean-Philippe Lang
</pre>
54 1 Jean-Philippe Lang
55 1 Jean-Philippe Lang
+Response+:
56 1 Jean-Philippe Lang
57 1 Jean-Philippe Lang
  * @201 Created@: group was created
58 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: group was not created due to validation failures (response body contains the error messages)
59 1 Jean-Philippe Lang
60 1 Jean-Philippe Lang
h2. /groups/:id.:format
61 1 Jean-Philippe Lang
62 2 Jean-Philippe Lang
h3. PUT
63 1 Jean-Philippe Lang
64 3 Jean-Philippe Lang
Updates an existing group.
65 3 Jean-Philippe Lang
66 2 Jean-Philippe Lang
h3. DELETE
67 1 Jean-Philippe Lang
68 3 Jean-Philippe Lang
Deletes an existing group.
69 3 Jean-Philippe Lang
70 1 Jean-Philippe Lang
h2. /groups/:id/users.:format
71 1 Jean-Philippe Lang
72 2 Jean-Philippe Lang
h3. POST
73 1 Jean-Philippe Lang
74 3 Jean-Philippe Lang
Adds an existing user to a group.
75 3 Jean-Philippe Lang
76 3 Jean-Philippe Lang
+Parameters+:
77 3 Jean-Philippe Lang
78 3 Jean-Philippe Lang
* @user_id@ (required): id of the user to add to the group.
79 3 Jean-Philippe Lang
80 3 Jean-Philippe Lang
+Example+:
81 3 Jean-Philippe Lang
82 3 Jean-Philippe Lang
<pre>
83 3 Jean-Philippe Lang
POST /groups/10/users.xml
84 3 Jean-Philippe Lang
85 3 Jean-Philippe Lang
<user_id>5</user_id>
86 3 Jean-Philippe Lang
</pre>
87 3 Jean-Philippe Lang
88 3 Jean-Philippe Lang
+Response+:
89 3 Jean-Philippe Lang
90 3 Jean-Philippe Lang
* @200 OK@: user was added to the group
91 3 Jean-Philippe Lang
92 1 Jean-Philippe Lang
h2. /groups/:id/users/:user_id.:format
93 1 Jean-Philippe Lang
94 1 Jean-Philippe Lang
h3. DELETE
95 3 Jean-Philippe Lang
96 3 Jean-Philippe Lang
Removes a user from a group.
97 3 Jean-Philippe Lang
98 3 Jean-Philippe Lang
+Example+:
99 3 Jean-Philippe Lang
100 3 Jean-Philippe Lang
<pre>
101 3 Jean-Philippe Lang
DELETE /groups/10/users/5.xml
102 3 Jean-Philippe Lang
</pre>
103 3 Jean-Philippe Lang
104 3 Jean-Philippe Lang
+Response+:
105 3 Jean-Philippe Lang
106 3 Jean-Philippe Lang
* @200 OK@: user was removed to the group