You can use our API directly to assign score to your players and create new players.
Generic score endpoint
This endpoint is used when you want to assign points to a given player without specifying the action type (e.g. release, documentation, etc.).
PUT
https://api.quboo.io/score/generic
Headers:
x-quboo-access-key: your-quboo-access-key
x-quboo-secret-key: your-quboo-secret-key
Content-Type: application/json
Body:
{
"playerLogin": "mechero",
"uniqueId": "master-1213314",
"description": "Pull Request 23892 completed",
"score": 50
}
playerLogin
(mandatory): the unique identifier of the player that will get the score.uniqueId
(mandatory): a unique identifier, generated on your side, that identifies this score action. It helps you prevent that you assign score more than once for the same score action.description
(optional): use this field to specify why you’re rewarding the player.score
(optional): set the points you want to give to the player (default is 10).
Release Score endpoint
Use this endpoint to reward a player for completing a Release action. See the Release Game Mode for more details.
PUT
https://api.quboo.io/score/release
Headers:
x-quboo-access-key: your-quboo-access-key
x-quboo-secret-key: your-quboo-secret-key
Content-Type: application/json
Body:
{
"playerLogin": "mechero",
"uniqueId": "master-1213314",
"description": "Release of Quboo Plugin"
}
playerLogin
(mandatory): the unique identifier of the player that will get the score.uniqueId
(mandatory): a unique identifier, generated on your side, that identifies this release action. It helps you prevent that you assign score more than once for the same release.description
(optional): use this field to specify why you’re rewarding the player.
Documentation Score endpoint
Use this endpoint to reward a player for completing a Documentation action. See the Documentation Game Mode for more details.
PUT
https://api.quboo.io/score/documentation
Headers:
x-quboo-access-key: your-quboo-access-key
x-quboo-secret-key: your-quboo-secret-key
Content-Type: application/json
Body:
{
"playerLogin": "mechero",
"uniqueId": "master-1213314",
"description": "Architecture documentation added to repository"
}
playerLogin
(mandatory): the unique identifier of the player that will get the score.uniqueId
(mandatory): a unique identifier, generated on your side, that identifies this documentation action. It helps you prevent that you assign score more than once for the same action.description
(optional): use this field to specify why you’re rewarding the player.
Create new players
To make your life easier, the Quboo Score API also allows the creation of players. The way it works is simple: if the player login you’re passing does not exist, a new player will be created with that login identifier.
Note that, if you want to make use of the Multiplayer mode, you should organize your new players in Teams as with any other players. Keep in mind that the score that a player has won before transferring the player to a new team is not transferred with them.
Examples
For these examples we use httpie. You can install the tool following the instructions in this link or you can also use curl
or any other tool you’re more familiar with it.
http PUT https://api.quboo.io/score/generic \
x-quboo-access-key:ACCESS x-quboo-secret-key:SECRET \
playerLogin=mechero uniqueId=id-238929389 score=15 description="Score action example 1"
You just need to replace ACCESS
and SECRET
for your Quboo Access and Secret keys respectively. This command will assign 15 points to the player identified with login id mechero
. If you run this command, you should get a response similar to this one:
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
{
"campaignId": "9ac46e92-cb41-48d2-8c6a-af52e11121f4",
"description": "Score action example 1",
"id": "d0301474-b8bc-441e-a8e5-8387d370e560",
"orgUniqueId": "0a7734c2-6f10-4efb-be34-dc2ea9fce353-id-238929389",
"organizationId": "0a7734c2-6f10-4efb-be34-dc2ea9fce353",
"playerId": "2343ed1b-8bcc-4dbe-bbc0-416d2330e50b",
"score": 15,
"scoreType": "GENERIC",
"teamId": "----",
"wonAt": "2019-11-24T10:23:44.413689Z"
}
This response indicates that the call was successful (200
) and it will give you some context information.