Getting started
Get your server API token
To create a new server API token, you juste have to go to the "API" tab of your server dashboard.
Then click on the +
icon to create a new token. Enter a name for your token and click on "Create".
The token will be displayed only once, so make sure to copy it and store it in a safe place!
Making requests
All requests to the API must be authenticated with your server API token. You can do this by including an Authorization
header in your request with the value Bearer [your token]
. There's no need to use your server ID or any other information in the request, only the token is required.
All requests must use json as the content type. The API will respond with json as well.
The base URL for the API is https://api.pixlbay.io
.
Here is an example of how to make a request to the API using JavaScript:
const request = await fetch('https://api.pixlbay.io/v1/votes/ElBernie', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer PXB_S_1234567890abcdef',
},
});