
Check Vote Status
Verify if a user can vote for your server
Endpoint
GET
/v1/votes/server/:serverToken/:ipAddressParameters
serverTokenstringYour server's unique identifier
ipAddressstringThe user's IP address (e.g., 192.168.1.1)
Response Examples
Can Vote
{
"can_vote": true,
"seconds_until_next_vote": 0
}Cannot Vote Yet
{
"can_vote": false,
"seconds_until_next_vote": 86400
}Code Examples
async function checkVoteStatus(serverToken, userIp) {
const url = `https://api.server-hytale.com/v1/votes/server/${serverToken}/${userIp}`;
const res = await fetch(url);
const { can_vote, seconds_until_next_vote } = await res.json();
if (can_vote) {
console.log('User can vote now!');
} else {
console.log(`User can vote in ${seconds_until_next_vote}s`);
}
}Need help?
Join our Discord community to get assistance with integrating our API into your application.