Project

General

Profile

Rest Groups » History » Version 2

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

1 1 Jean-Philippe Lang
h1. Groups
2
3 2 Jean-Philippe Lang
{{>toc}}
4
5 1 Jean-Philippe Lang
h2. /groups.:format
6
7
h3. GET
8
9
Returns the list of groups.
10
11
+Example+:
12
13
  GET /groups.xml
14
15
+Response+:
16
17
<pre>
18
<groups type="array">
19
  <group>
20
    <id>53</id>
21
    <name>Managers</name>
22
  </group>
23
  <group>
24
    <id>55</id>
25
    <name>Developers</name>
26
  </group>
27
</groups>
28
</pre>
29
30
h3. POST
31
32
Creates a group.
33
34
+Parameters+:
35
36
* @group@ (required): a hash of the group attributes, including:
37
38
  * @name@ (required): the group name
39
  * @user_ids@: ids of the group users (an empty group is created if not provided)
40
41
+Example+:
42
43
<pre>
44
POST /groups.xml
45
46
<?xml version="1.0" encoding="ISO-8859-1" ?>
47
<group>
48
  <name>Developers</name>
49
  <user_ids>
50
    <user_id>3</user_id>
51
    <user_id>5</user_id>
52
  </user_ids>
53
</group>
54
</pre>
55
56
+Response+:
57
58
  * @201 Created@: group was created
59
  * @422 Unprocessable Entity@: group was not created due to validation failures (response body contains the error messages)
60
61
h2. /groups/:id.:format
62
63 2 Jean-Philippe Lang
h3. PUT
64 1 Jean-Philippe Lang
65 2 Jean-Philippe Lang
h3. DELETE
66
67 1 Jean-Philippe Lang
h2. /groups/:id/users.:format
68
69 2 Jean-Philippe Lang
h3. POST
70 1 Jean-Philippe Lang
71
h2. /groups/:id/users/:user_id.:format
72
73 2 Jean-Philippe Lang
h3. DELETE