POST http://localhost/register
Content-Type: application/json
{
"name": "Your Name"
}
Response:
{
"user": {
"id": "6fe8b74d-b8ce-45de-a3e3-119f752c1e0e",
"name": "Your Name"
},
"token": "6fe8b74d-b8ce-45de-a3e3-119f752c1e0e"
}
token
will be used for authorization.
POST http://localhost/rooms
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
{
"name": "Room 1",
"voteTemplate": 1
}
Room response example
{
"id": "831a6wkf",
"name": "Room 1",
"status": 1,
"owner": true,
"seats": [
{
"user": {
"id": "6a4be959-d3f7-469a-8b8a-820fd5cd2081",
"name": "Your Name"
},
"vote": {
"value": 0,
"type": "unknown"
},
"voted": false,
"voteOpened": true,
"owner": true,
"active": false
}
],
"templateTitle": "Modified fibonacci",
"voteCards": [
{
"vote": {
"value": 0,
"type": "unknown"
},
"active": false
},
{
"vote": {
"value": 0,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 0.5,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 1,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 2,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 0,
"type": "infinity"
},
"active": false
}
]
}
GET http://localhost/rooms/templates
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
Response example
{
"templates": [
{
"title": "Fibonacci",
"votes": [
{
"value": 0,
"type": "unknown"
},
{
"value": 0,
"type": "value"
},
{
"value": 1,
"type": "value"
},
{
"value": 0,
"type": "infinity"
}
]
},
{
"title": "Modified fibonacci",
"votes": [
{
"value": 0,
"type": "unknown"
},
{
"value": 0,
"type": "break"
},
{
"value": 0,
"type": "value"
},
{
"value": 0.5,
"type": "value"
},
{
"value": 1,
"type": "value"
}
]
}
]
}
Index should be passed to voteTemplate
field when creating a room.
Join room and get info about it.
GET http://localhost/rooms/t0m9f7ar
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
Response will contain room.
Only owner can update room.
PATCH http://localhost/rooms/t0m9f7ar
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
{
"name": "New room name"
}
Response will contain room.
POST http://localhost/rooms/t0m9f7ar/leave
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
Response:
{
"message": "Room left"
}
POST http://localhost/rooms/t0m9f7ar/vote
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
{
"value": 5
}
value
should contain index from vote template.
Response:
{
"message": "Voted"
}
POST http://localhost/rooms/t0m9f7ar/end
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
Only owner can do this.
Response will contain room.
POST http://localhost/rooms/t0m9f7ar/reset
Content-Type: application/json
Authorization: 6fe8b74d-b8ce-45de-a3e3-119f752c1e0e
Only owner can do this.
Response will contain room.
Example shown in example file
On room status change, voting, joining and leaving message will be received with room object.
Room response example
{
"id": "831a6wkf",
"name": "Room 1",
"status": 1,
"owner": true,
"seats": [
{
"user": {
"id": "6a4be959-d3f7-469a-8b8a-820fd5cd2081",
"name": "Your Name"
},
"vote": {
"value": 0,
"type": "unknown"
},
"voted": false,
"voteOpened": true,
"owner": true,
"active": false
}
],
"templateTitle": "Modified fibonacci",
"voteCards": [
{
"vote": {
"value": 0,
"type": "unknown"
},
"active": false
},
{
"vote": {
"value": 0,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 0.5,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 1,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 2,
"type": "value"
},
"active": false
},
{
"vote": {
"value": 0,
"type": "infinity"
},
"active": false
}
]
}
id
- id, used in urlname
- name to showstatus
- room status, 1 - voting, 2 - voted, triggered by end vote and reset roomowner
- is current user (you) is owner of this roomseats
- users in the roomuser
- info about user in seatvote
- user's votevalue
- integer valuetype
- vote type, available types:value
- numeric valueunknown
- vote is unknown, "?"break
- need a break, "coffee"infinity
- infinity
voted
- user has votedvoteOpened
- is card opened or not?owner
- user is room owneractive
- user is active, subscribed and will get all the info
templateTitle
- title of the room templatevoteCards
- available vote cardsvote
- vote, same as within templateactive
- card is active (selected) for current user (you)