Commit 658f260e9835800901462e5a5de350ee84fefe8d
1 parent
961cb285
Exists in
master
and in
4 other branches
add docs for notes API
Showing
2 changed files
with
132 additions
and
0 deletions
Show diff stats
app/views/help/api.html.haml
@@ -21,6 +21,8 @@ | @@ -21,6 +21,8 @@ | ||
21 | = link_to "Issues", "#issues", 'data-toggle' => 'tab' | 21 | = link_to "Issues", "#issues", 'data-toggle' => 'tab' |
22 | %li | 22 | %li |
23 | = link_to "Milestones", "#milestones", 'data-toggle' => 'tab' | 23 | = link_to "Milestones", "#milestones", 'data-toggle' => 'tab' |
24 | + %li | ||
25 | + = link_to "Notes", "#notes", 'data-toggle' => 'tab' | ||
24 | 26 | ||
25 | .tab-content | 27 | .tab-content |
26 | .tab-pane.active#README | 28 | .tab-pane.active#README |
@@ -94,3 +96,12 @@ | @@ -94,3 +96,12 @@ | ||
94 | .file_content.wiki | 96 | .file_content.wiki |
95 | = preserve do | 97 | = preserve do |
96 | = markdown File.read(Rails.root.join("doc", "api", "milestones.md")) | 98 | = markdown File.read(Rails.root.join("doc", "api", "milestones.md")) |
99 | + | ||
100 | + .tab-pane#notes | ||
101 | + .file_holder | ||
102 | + .file_title | ||
103 | + %i.icon-file | ||
104 | + Notes | ||
105 | + .file_content.wiki | ||
106 | + = preserve do | ||
107 | + = markdown File.read(Rails.root.join("doc", "api", "notes.md")) |
@@ -0,0 +1,121 @@ | @@ -0,0 +1,121 @@ | ||
1 | +## List notes | ||
2 | + | ||
3 | +### List project wall notes | ||
4 | + | ||
5 | +Get a list of project wall notes. | ||
6 | + | ||
7 | +``` | ||
8 | +GET /projects/:id/notes | ||
9 | +``` | ||
10 | + | ||
11 | +```json | ||
12 | +[ | ||
13 | + { | ||
14 | + "id": 522, | ||
15 | + "body": "The solution is rather tricky", | ||
16 | + "author": { | ||
17 | + "id": 1, | ||
18 | + "email": "john@example.com", | ||
19 | + "name": "John Smith", | ||
20 | + "blocked": false, | ||
21 | + "created_at": "2012-05-23T08:00:58Z" | ||
22 | + }, | ||
23 | + "updated_at":"2012-11-27T19:16:44Z", | ||
24 | + "created_at":"2012-11-27T19:16:44Z" | ||
25 | + } | ||
26 | +] | ||
27 | +``` | ||
28 | + | ||
29 | +Parameters: | ||
30 | + | ||
31 | ++ `id` (required) - The ID or code name of a project | ||
32 | + | ||
33 | +### List issue notes | ||
34 | + | ||
35 | +Get a list of issue notes. | ||
36 | + | ||
37 | +``` | ||
38 | +GET /projects/:id/issues/:issue_id/notes | ||
39 | +``` | ||
40 | + | ||
41 | +Parameters: | ||
42 | + | ||
43 | ++ `id` (required) - The ID or code name of a project | ||
44 | ++ `issue_id` (required) - The ID of an issue | ||
45 | + | ||
46 | +### List snippet notes | ||
47 | + | ||
48 | +Get a list of snippet notes. | ||
49 | + | ||
50 | +``` | ||
51 | +GET /projects/:id/snippets/:snippet_id/notes | ||
52 | +``` | ||
53 | + | ||
54 | +Parameters: | ||
55 | + | ||
56 | ++ `id` (required) - The ID or code name of a project | ||
57 | ++ `snippet_id` (required) - The ID of a snippet | ||
58 | + | ||
59 | +## Single note | ||
60 | + | ||
61 | +### Single issue note | ||
62 | + | ||
63 | +Get an issue note. | ||
64 | + | ||
65 | +``` | ||
66 | +GET /projects/:id/issues/:issue_id/:notes/:note_id | ||
67 | +``` | ||
68 | + | ||
69 | +Parameters: | ||
70 | + | ||
71 | ++ `id` (required) - The ID or code name of a project | ||
72 | ++ `issue_id` (required) - The ID of a project issue | ||
73 | ++ `note_id` (required) - The ID of an issue note | ||
74 | + | ||
75 | +### Single snippet note | ||
76 | + | ||
77 | +Get a snippet note. | ||
78 | + | ||
79 | +``` | ||
80 | +GET /projects/:id/issues/:snippet_id/:notes/:note_id | ||
81 | +``` | ||
82 | + | ||
83 | +Parameters: | ||
84 | + | ||
85 | ++ `id` (required) - The ID or code name of a project | ||
86 | ++ `snippet_id` (required) - The ID of a project snippet | ||
87 | ++ `note_id` (required) - The ID of an snippet note | ||
88 | + | ||
89 | +## New note | ||
90 | + | ||
91 | +### New issue note | ||
92 | + | ||
93 | +Create a new issue note. | ||
94 | + | ||
95 | +``` | ||
96 | +POST /projects/:id/issues/:issue_id/notes | ||
97 | +``` | ||
98 | + | ||
99 | +Parameters: | ||
100 | + | ||
101 | ++ `id` (required) - The ID or code name of a project | ||
102 | ++ `issue_id` (required) - The ID of an issue | ||
103 | ++ `body` (required) - The content of a note | ||
104 | + | ||
105 | +Will return created note with status `201 Created` on success, or `404 Not found` on fail. | ||
106 | + | ||
107 | +### New snippet note | ||
108 | + | ||
109 | +Create a new snippet note. | ||
110 | + | ||
111 | +``` | ||
112 | +POST /projects/:id/snippets/:snippet_id/notes | ||
113 | +``` | ||
114 | + | ||
115 | +Parameters: | ||
116 | + | ||
117 | ++ `id` (required) - The ID or code name of a project | ||
118 | ++ `snippet_id` (required) - The ID of an snippet | ||
119 | ++ `body` (required) - The content of a note | ||
120 | + | ||
121 | +Will return created note with status `201 Created` on success, or `404 Not found` on fail. |