Check if a token is valid or not.
Need bearer
Returned payload :
-
200
{ "id": 1, "username": "root", "groupId": 2, "teamCode": null }
-
401
Invalid token
Get a token from a username and a code (or password).
Sent payload :
{
"username": "username",
"code": "code"
}
OR
{
"username": "username",
"password": "password"
}
Returned payload :
-
200
{ "user": { "id": 1, "username": "root", "groupId": 2, "teamCode": null }, "token": "token" }
-
400
Missing parameters
-
401
Invalid code or password
-
404
Username not found
Get user list
Need bearer
Returned payload :
-
200
[ { "userId": 0, "username": "username_1", "teamCode": "CODE" }, { "userId": 1, "username": "usernam2", "teamCode": "CODE" } ]
-
401
Unauthorized
-
404
No existing users
Create a new user
Sent payload :
{
"username": "username",
"code": "code"
}
OR
{
"username": "username",
"password": "password"
}
Returned payload :
-
200
{ "id": 2, "username": "test", "groupId": 1, "teamCode": null, "token": "token" }
-
400
Missing body part
-
409
Username already used
Get player infos from it’s id
Need bearer
Returned payload :
-
200
{ "id": 1, "username": "root", "groupId": 2, "teamCode": null }
-
401
Unauthorized
-
404
User not found
Get all the teams
Need bearer
URL settings :
- complete : Can be “id” or “users”, and add more things (like members) to be added
Returned payload :
-
200
[ { "code": "GW7G7", "name": "test", "score": 0, "ownerId": 1 } ] OR [ { "code": "Q7ITI", "name": "test", "score": 0, "ownerId": 1, "members": [ 2 ] } ] OR [ { "code": "Q7ITI", "name": "test", "score": 0, "ownerId": 1, "owner": { "id": 1, "username": "root" }, "members": [ { "id": 2, "username": "test" } ] } ]
-
401
Unauthorized
-
404
No teams found
Create a new team
Need bearer
Sent payload :
{
"teamName": "Team Name"
}
Returned payload :
-
201
{ "score": 0, "name": "test", "code": "IFAIN3", "ownerId": 1 }
-
401
Unauthorized
Get team infos
Need bearer
Returned payload :
-
200
{ "code": "SZFTQ", "name": "test", "score": 0, "ownerId": 1 } OR { "code": "Q7ITI", "name": "test", "score": 0, "ownerId": 1, "members": [ 2 ] } OR { "code": "Q7ITI", "name": "test", "score": 0, "ownerId": 1, "owner": { "id": 1, "username": "root" }, "members": [ { "id": 2, "username": "test" } ] }
-
401
Unauthorized
-
404
Team not found
Remove a member from his team
Need bearer + need to be team owner
URL settings :
- id
Returned payload :
-
204
Player removed from the team
-
401
Unauthorized
-
403
User is not the team owner
-
404
Member not in the team
Update team score
Need bearer + need password authentication
Sent payload :
{
"teamCode": "code",
"newScore": 10
}
Returned payload :
-
200
{ "message": "Score updated" }
-
401
Unauthorized
-
403
Missing permission “score.update”
-
404
Team not found
Get all notifications sent to a member
Need bearer
Returned payload :
-
200
[ { "id": 1, "type": "info", "jsonContent": { "message": "Message content" }, "senderId": null, "receiverId": 1 } ]
-
401
Unauthorized
-
404
No notices found
Create a new notification to a player
Need bearer
Sent payload :
{
"targetId": 2,
"type": "info",
"content": {
"message": "Message content"
}
}
Returned payload :
-
201
{ "id": 1, "senderId": 1, "receiverId": 2, "type": "info", "jsonContent": { "message": "Message content" } }
-
401
Unauthorized
Do an action in API side, depending of the notification’s type and content
Need bearer
URL settings :
- notificationId
Returned payload :
-
204
Notification accepted
-
401
Unauthorized
-
404
Notification not found
Do an action in API side, depending of the notification’s type and content
Need bearer
URL settings :
- notificationId
Returned payload :
-
204
Notification declined
-
401
Unauthorized
-
404
Notification not found