Skip to main content

Set New Point

Set or update a player's game points for a specific round.

Endpoint

POST /api/v2/game-point/

Authentication

This endpoint requires a game server key in the header:

x-game-server-key: your-server-key

Description

This endpoint allows you to set or update a player's game points for a specific tournament round. You can identify the player either by userId or walletAddress.

Request Body

FieldTypeRequiredDescription
roundIdstringYesUnique identifier for the tournament round
userIdstringNoUnique identifier for the user
walletAddressstringNoUser's wallet address
scorenumberYesPlayer's game score
projectIdstringNoProject identifier (nullable)
roomIdstringYesGame room identifier

Note: Either userId or walletAddress should be provided to identify the player.

Request Example

{
"roundId": "round-123",
"userId": "user-456",
"score": 1500,
"projectId": "project-789",
"roomId": "room-abc"
}

Alternative with Wallet Address

{
"roundId": "round-123",
"walletAddress": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
"score": 2000,
"roomId": "room-def"
}

Response

Success Response (200)

{
"message": "Done"
}

Error Response (400)

{
"message": "Invalid request payload",
"status": 400
}

Error Response (401)

{
"message": "Invalid game server key",
"status": 401
}

Error Response (404)

{
"message": "Round not found",
"status": 404
}

Response Fields

FieldTypeDescription
messagestringSuccess message (usually "Done")

Usage Example

const response = await fetch("https://api.intraverse.io/api/v2/game-point/", {
method: "POST",
headers: {
"x-game-server-key": "your-server-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
roundId: "round-123",
userId: "user-456",
score: 1500,
projectId: "project-789",
roomId: "room-abc",
}),
});

const result = await response.json();

console.log(result.message); // "Done"

With Wallet Address

const response = await fetch("https://api.intraverse.io/api/v2/game-point/", {
method: "POST",
headers: {
"x-game-server-key": "your-server-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
roundId: "round-123",
walletAddress: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
score: 2000,
roomId: "room-def",
}),
});

const result = await response.json();

console.log(result.message); // "Done"

Error Handling

ErrorDescriptionSolution
Invalid game keyServer key is invalid or missingCheck your server key
Invalid requestRequest payload is malformedVerify request body structure
Round not foundRound ID doesn't existVerify the round ID
Missing player infoNeither userId nor walletAddress providedProvide userId or walletAddress

Next Steps