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
| Field | Type | Required | Description |
|---|---|---|---|
roundId | string | Yes | Unique identifier for the tournament round |
userId | string | No | Unique identifier for the user |
walletAddress | string | No | User's wallet address |
score | number | Yes | Player's game score |
projectId | string | No | Project identifier (nullable) |
roomId | string | Yes | Game 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
| Field | Type | Description |
|---|---|---|
message | string | Success 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
| Error | Description | Solution |
|---|---|---|
| Invalid game key | Server key is invalid or missing | Check your server key |
| Invalid request | Request payload is malformed | Verify request body structure |
| Round not found | Round ID doesn't exist | Verify the round ID |
| Missing player info | Neither userId nor walletAddress provided | Provide userId or walletAddress |