Votes
Customize your voting link

Custom Links

Pixlbay allows you to add custom parameters to vote links. It provides useful parameters to simplify or track the votes from your website.

Create a custom vote link

To create a custom vote link, you need to add the custom parameters to the vote link. The custom parameters are added to the vote link as query parameters. For example, imagine that you own a server with the slug my-server and you want to track the votes from your website, called mywebsite.com, here's what the vote link would look like:

https://pixlbay.io/my-server?cvid=1234&u=JohnDoe&redirect=https%3A%2F%2Fmywebsite.com

As you can see, the custom parameters are added to the vote link as query parameters. The custom parameters are separated from the vote link by a ? and each parameter is separated by a &.

Available custom parameters

  • cvid - The custom vote ID. This parameter is used to track the votes from your website. It can be any string of your choice, limited to 25 characters. It can be useful to track the votes on your side.
  • u - The username. This parameter is used to pre-fill the username field in the vote form, if you have activated the username field in your server settings.
  • redirect - The redirect URL. This parameter is used to redirect the user to a specific URL after the vote. It must be URL encoded (opens in a new tab). After the vote, the user will be redirected to the URL specified in this parameter, with additional query parameters containing the vote information.

Handling the redirect payload

After the vote, and if the redirect parameter is specified, the user will be redirected to the URL specified in the redirect parameter, with additional query parameters containing the vote information. Here's what the URL would look like:

https://mywebsite.com/?vote=success&vid=a9b5788c-39e8-41ef-8bd4-8dd9b2271445&cvid=123&u=ElBernie&nextVote=2024-02-24T13%3A31%3A42.459Z

The query parameters are:

  • vote - The vote status. It will be set to confirm that the vote was successful.
  • vid - The vote ID. It is the unique identifier of the vote, assigned by Pixlbay. It can be useful to check the vote status with the Pixlbay API (coming soon).
  • cvid - The custom vote ID. It is the custom vote ID you specified in the vote link. It can be useful to track the votes on your side.
  • u - The username. It's the username that was used to vote. It can be useful to track the votes on your side.
  • nextVote - The next vote date. It's the date and time when the user will be able to vote again. It can be useful to display a countdown to the next vote. It is in ISO 8601 format, and it is in UTC time.