The OTP API: How to Protect Your Votes from Fraud

The OTP API: How to Protect Your Votes from Fraud

  • Published on
    5th Nov 2025
  • Updated on
    5th Nov 2025

The OTP API (One-Time Password) from Private-Server.net is a security system that lets you validate and control every vote on your server page. In practice, instead of allowing anyone to vote freely, only users for whom your site has generated a unique code are authorized to submit a vote.

Step-by-step process

  1. The visitor clicks the “Vote” button on your website.
  2. Your server calls the Private-Server.net OTP API to generate a unique code.
  3. The API returns this code, for example: token=ABCD1234.
  4. You then redirect the visitor to the Private-Server.net voting URL, adding the OTP code as a GET parameter.

Example of a redirection URL:

https://private-server.net/en/discord/private-server-discord/vote?token=ABCD1234

If the user accesses the page without the ?token= parameter, an error message will be displayed when they attempt to vote.

Why this system is secure

  • Users can only vote if you have generated a code; competitors cannot create valid OTPs.
  • Automated or fake votes are blocked. A competitor trying to “boost” your votes will not be able to do so.
  • You maintain full control over voters and can keep activity logs to analyze vote patterns.

Full example of the process

[Visitor] → clicks "Vote" on your website
     ↓
[Your site] → calls the Private-Server.net API to create an OTP
     ↓
API response: token=XYZ789
     ↓
Automatic redirection of the visitor:
https://private-server.net/en/discord/private-server-discord/vote?token=XYZ789
     ↓
[Private-Server.net] → verifies the code and records the vote

More information

  • Check out our documentation to implement the OTP API: https://private-server.net/en/documentation
  • Enable the “OTP” option in your server settings on Private-Server.net (Do not enable it before implementing the API, otherwise your votes will be blocked.)
  • Servers with the OTP API enabled can now validate votes using the OTP code instead of relying on the voter’s IP address.

Reviews

No comments yet.

Comment

To comment, you must be logged in.


To comment, you must be logged in.