REST API¶
Member’s Infos¶
List¶
Details¶
-
GET
/api/
(int: user_id)/
¶ Gets a user given by its identifier.
Example request:
GET /api/800/ HTTP/1.1 Host: example.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "pk": 800, "username": "firm1", "is_active": true, "date_joined": "2014-07-28T02:57:31", "site": "http://zestedesavoir.com", "avatar_url": "http://static.wamiz.fr/images/animaux/rongeurs/large/souris.jpg", "biography": "I'm beautiful", "sign": "cool", "show_email": false, "show_sign": true, "hover_or_click": true, "email_for_answer": false, "last_visit": "2015-10-20T03:24:06" }
Parameters: - user_id (int) – user’s unique id
Status Codes: - 200 OK – no error
- 404 Not Found – there’s no user with this id
-
GET
/api/mon-profil/
¶ Gets informations about identified member
Status Codes: - 200 OK – no error
- 401 Unauthorized – user are not authenticated
Request Headers: - Authorization – OAuth2 token to authenticate
-
PUT
/api/
(int: user_id)/
¶ Updates a user given by its identifier.
Parameters: - user_id (int) – user’s unique id
JSON Parameters: - pk (int) – user’s unique id
Status Codes: - 200 OK – no error
- 404 Not Found – there’s no user with this id
Request Headers: - Authorization – OAuth2 token to authenticate
Sanctions¶
Read Only¶
-
POST
/api/
(int: user_id)/lecture-seule/
¶ Applies a read only sanction at a user given.
Parameters: - user_id (int) – user’s unique id
JSON Parameters: - pk (int) – user id to read only
- ls-jrs (string) – Number of days for the sanction.
- ls-text (string) – Description of the sanction.
Status Codes: - 200 OK – no error
- 401 Unauthorized – Not authenticated
- 403 Forbidden – Insufficient rights to call this procedure. Must to be a staff user.
- 401 Unauthorized – Not found
Request Headers: - Authorization – OAuth2 token to authenticate
-
DELETE
/api/
(int: user_id)/lecture-seule
¶ Removes a read only sanction at a user given.
Parameters: - user_id (int) – user’s unique id
JSON Parameters: - pk (int) – id of read only user
Status Codes: - 200 OK – no error
- 401 Unauthorized – Not authenticated
- 403 Forbidden – Insufficient rights to call this procedure. Must to be a staff user.
- 401 Unauthorized – Not found
Request Headers: - Authorization – OAuth2 token to authenticate
Ban¶
-
POST
/api/
(int: user_id)/ban/
¶ Applies a ban sanction at a user given.
Parameters: - user_id (int) – user’s unique id
JSON Parameters: - pk (int) – user id to ban
- ban-jrs (string) – Number of days for the sanction.
- ban-text (string) – Description of the sanction.
Status Codes: - 200 OK – no error
- 401 Unauthorized – Not authenticated
- 403 Forbidden – Insufficient rights to call this procedure. Must to be a staff user.
- 401 Unauthorized – Not found
Request Headers: - Authorization – OAuth2 token to authenticate
-
DELETE
/api/
(int: user_id)/ban/
¶ Removes a ban sanction at a user given.
Parameters: - user_id (int) – user’s unique id
JSON Parameters: - pk (int) – id of banned user
Status Codes: - 200 OK – no error
- 401 Unauthorized – Not authenticated
- 403 Forbidden – Insufficient rights to call this procedure. Must to be a staff user.
- 401 Unauthorized – Not found
Request Headers: - Authorization – OAuth2 token to authenticate