Solution¶
Solution object:
- id – integer
- title – string
- content – string
- tags – array of string
- author – user object
- issue – null / issue object (only
id
,title
)- 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- views – integer: number of views
- popularity – float
Role | Permission |
---|---|
Authenticated | create |
Owner | update |
Authenticated | comment |
Authenticated | vote |
Solution-list¶
-
GET
/api/solutions
¶ Query Parameters: - limit (optional) – integer, 0 ≤ x ≤ 1000, default =
100
- offset (optional) – integer, 0 ≤ x, default =
0
- ordering (optional) –
popularity
orlatest
, default ='popularity'
- limit (optional) – integer, 0 ≤ x ≤ 1000, default =
-
POST
/api/solutions
¶ requires permission:
create
create a solution
Status Codes: - 422 Unprocessable Entity –
issue_id
does not refer to a valid issue
returns created solution object on success
Request JSON Object: - content – string, length ≤ 30000
- issue_id (optional) – integer or
null
, default =null
- tags – array of [string, length ≤ 30]
- title – string, length ≤ 80
- 422 Unprocessable Entity –
Solution-object¶
Solution of the id
-
GET
/api/solutions/{id}
¶ returns the solution object
-
PUT
/api/solutions/{id}
¶ requires permission:
update
update the solution
Status Codes: - 422 Unprocessable Entity –
issue_id
does not refer to a valid issue
returns updated solution object on success
Request JSON Object: - content (optional) – string, length ≤ 30000
- issue_id (optional) – integer or
null
- tags (optional) – array of [string, length ≤ 30]
- title (optional) – string, length ≤ 80
- 422 Unprocessable Entity –
Solution-vote¶
Entity representing the user’s vote of the issue
-
GET
/api/solutions/{id}/vote
¶ requires permission:
vote
Returns the current vote
{"value": 1}
value may be either
-1
,0
or1
-
PUT
/api/solutions/{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/solutions/{id}/vote
¶ requires permission:
vote
unvote
no body required
Response JSON Object: - votes – on a success unvote, the updated vote count is returned
Solution-comment¶
Comment for the solution
-
GET
/api/solutions/{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/solutions/{id}/comments
¶ requires permission:
comment
post a comment to the object
{ "content": "lorem ipsum ..." }
Request JSON Object: - content – string, length ≤ 2000