Comment¶
Comment object:
id – integer
content – string
- parent – object with
id
– integertype
– string one of"issue"
,"question"
,"comment"
author – user object
votes – integer
ncomments – integer
ctime – string: iso8601 datetime
mtime – string: iso8601 datetime or null if not modified since creation
user_vote –
0
,1
or-1
: the current vote of the requesting user
Role | Permission |
---|---|
Owner | update |
Authenticated | comment |
Authenticated | vote |
Comment-object¶
-
GET
/api/comments/{id}
¶ returns the comment object
-
PUT
/api/comments/{id}
¶ requires permission:
update
update the comment, returns the updated comment object
Request JSON Object: - content (optional) – string, length ≤ 2000
Comment-vote¶
vote for a comment
-
GET
/api/comments/{id}/vote
¶ requires permission:
vote
Returns the current vote
{"value": 1}
value may be either
-1
,0
or1
-
PUT
/api/comments/{id}/vote
¶ requires permission:
vote
vote up:
{"value": 1}
vote down:
{"value": -1}
Response JSON Object: - votes – on a success vote, the updated vote count is returned
Request JSON Object: - value –
1
or-1
-
DELETE
/api/comments/{id}/vote
¶ requires permission:
vote
unvote
no body required
Response JSON Object: - votes – on a success unvote, the updated vote count is returned
Comment-comment¶
comments on a specific comment
-
GET
/api/comments/{id}/comments
¶ returns the list of comments of the object.
they are ordered by
ctime
, oldest first.{ "data": [ { "id": 10, "parent": { "id": 100 }, "author": "user object", "content": "comment content" } ] }
Query Parameters: - limit (optional) – integer, 0 ≤ x ≤ 1000, default =
100
- offset (optional) – integer, 0 ≤ x, default =
0
- limit (optional) – integer, 0 ≤ x ≤ 1000, default =
-
POST
/api/comments/{id}/comments
¶ requires permission:
comment
post a comment to the object
{ "content": "lorem ipsum ..." }
Request JSON Object: - content – string, length ≤ 2000