Rest Groups » History » Version 2

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

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
<?xml version="1.0" encoding="ISO-8859-1" ?>
47 1 Jean-Philippe Lang
<group>
48 1 Jean-Philippe Lang
  <name>Developers</name>
49 1 Jean-Philippe Lang
  <user_ids>
50 1 Jean-Philippe Lang
    <user_id>3</user_id>
51 1 Jean-Philippe Lang
    <user_id>5</user_id>
52 1 Jean-Philippe Lang
  </user_ids>
53 1 Jean-Philippe Lang
</group>
54 1 Jean-Philippe Lang
</pre>
55 1 Jean-Philippe Lang
56 1 Jean-Philippe Lang
+Response+:
57 1 Jean-Philippe Lang
58 1 Jean-Philippe Lang
  * @201 Created@: group was created
59 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: group was not created due to validation failures (response body contains the error messages)
60 1 Jean-Philippe Lang
61 1 Jean-Philippe Lang
h2. /groups/:id.:format
62 1 Jean-Philippe Lang
63 2 Jean-Philippe Lang
h3. PUT
64 1 Jean-Philippe Lang
65 2 Jean-Philippe Lang
h3. DELETE
66 2 Jean-Philippe Lang
67 1 Jean-Philippe Lang
h2. /groups/:id/users.:format
68 1 Jean-Philippe Lang
69 2 Jean-Philippe Lang
h3. POST
70 1 Jean-Philippe Lang
71 1 Jean-Philippe Lang
h2. /groups/:id/users/:user_id.:format
72 1 Jean-Philippe Lang
73 2 Jean-Philippe Lang
h3. DELETE