Browse Source

Transferring blueprint from apiary.io

master
Julio Biason 11 years ago
parent
commit
9df78693e5
  1. 40
      apiary.apib

40
apiary.apib

@ -45,19 +45,18 @@ User management.
{ "status": "ERROR", "error": "username already exists" } { "status": "ERROR", "error": "username already exists" }
## Single User [/user/{token}/{username}/] ## Single User [/user/{username}/]
Manage a single user. Manage a single user.
+ Parameters + Parameters
+ token ... The user token.
+ username ... Username used in the creation process. + username ... Username used in the creation process.
### Update information [POST] ### Update information [POST]
+ Request (application/json) + Request (application/json)
{ "full_name": "Full name", "password": "hash" } { "token": "userToken", "full_name": "Full name", "password": "hash" }
+ Response 200 (application/json) + Response 200 (application/json)
@ -74,6 +73,10 @@ Manage a single user.
### Remove user [DELETE] ### Remove user [DELETE]
+ Request (application/json)
{ "token": "userToken" }
+ Response 200 (application/json) + Response 200 (application/json)
{ "status": "OK" } { "status": "OK" }
@ -89,17 +92,18 @@ Manage a single user.
# Group Places # Group Places
Retrieval and management (for admin users) for lunching. Retrieval and management (for admin users) for lunching.
## Places [/places/{token}/] ## Places [/places/]
Retrieve the list of all places the user has access. Retrieve the list of all places the user has access.
+ Parameters
+ token ... The user token.
### Retrieval [GET] ### Retrieval [GET]
Retrieve the list of places. Retrieve the list of places.
+ Resquest (application/json)
{ "token": "userToken" }
+ Response 200 (application/json) + Response 200 (application/json)
{ "status": "OK", "places": [{"name": "Place 1", "id": 1} { "status": "OK", "places": [{"name": "Place 1", "id": 1}
@ -111,7 +115,7 @@ Add a new place. The user must be admin to do so.
+ Request (application/json) + Request (application/json)
{ "place": "Place Name" } { "token": "userToken", "place": "Place Name" }
+ Response 200 (application/json) + Response 200 (application/json)
@ -126,19 +130,18 @@ Add a new place. The user must be admin to do so.
{ "status": "ERROR", "error": "User is not admin" } { "status": "ERROR", "error": "User is not admin" }
## Place management [/places/{token}/{id}/] ## Place management [/places/{id}/]
Manage a single place. The user must be admin. Manage a single place. The user must be admin.
+ Parameters + Parameters
+ token ... The user token.
+ id ... The place id. + id ... The place id.
### Edit a place [POST] ### Edit a place [POST]
+ Request (application/json) + Request (application/json)
{ "name": "Place 3" } { "token": "userToken", "name": "Place 3" }
+ Response 200 (application/json) + Response 200 (application/json)
@ -154,6 +157,10 @@ Manage a single place. The user must be admin.
### Remove a place [DELETE] ### Remove a place [DELETE]
+ Request (application/json)
{ "token": "userToken" }
+ Response 200 (application/json) + Response 200 (application/json)
{ "status": "OK" } { "status": "OK" }
@ -169,18 +176,15 @@ Manage a single place. The user must be admin.
# Group Voting # Group Voting
User voting. User voting.
## Voting [/vote/{token}/] ## Voting [/vote/]
Make a vote for the day. The day is controlled by the server itself. If a vote has been cast Make a vote for the day. The day is controlled by the server itself. If a vote has been cast
but later removed, the server will also but later removed, the server will also
+ Parameters
+ token ... The user token.
### Cast a vote [POST] ### Cast a vote [POST]
+ Request (application/json) + Request (application/json)
{ "choices": [1, 2, 3] } { "token": "userToken", "choices": [1, 2, 3] }
+ Response 200 (application/json) + Response 200 (application/json)
@ -203,6 +207,10 @@ but later removed, the server will also
Remove a vote for the day. Once a vote has been removed, it can't be Remove a vote for the day. Once a vote has been removed, it can't be
recasted. recasted.
+ Request (application/json)
{ "token": "userToken" }
+ Response 200 (application/json) + Response 200 (application/json)
{ "status": "OK" } { "status": "OK" }

Loading…
Cancel
Save