Start
A step-to-step tutorial to use OpenBlacklist
Hey ! Here, you will find a step to step guide of how to use OpenBlacklist's Rest API and how to recieve events !
Choose your programing language !
Other Programming Languages
Using another programming language ? No Problem !
Sending Requests
To send a request, you will need to respect a certain scheme:
/api/<version>/<action>/<value>
so for example, to check if an user is blacklisted, do
GET /api/v1/user/840749770221682689
{
"isBlacklisted": true,
"user": {
"id": "840749770221682689",
"username": "kingqs",
"blacklisted_reasons": {
"fr_fr": "Raid, spam, massping",
"en_gb": "Raid, spam, massping",
"es_sp": "Incursión, spam, envío masivo"
}
}
}
Headers
You need to add the key you got from the OpenBlacklist Website in the Authorization header !
await fetch("https://openbl.clarty.org/api/v1/user/840749770221682689", {
headers: {
Authorization: "your-key-here"
}
})
Go see more on the API Documentation
Recieving Requests
To recieve requests, it is pretty simple, make a web server that listens to any port and any route, for example, with Node.js, you'll do:
import express from "express" // Import express
const app = express() // Create an app
app.get("/obl", (req, res) => { // Recieve GET requests at /obl
})
app.listen(3000) // Listens to the port 3000
So the route you will put in your OpenBlacklist Dashboard is http://myip:3000/obl
the default package you will recieve is:
{
"metadata": { event: "<add|remove>", pass: "the-pass-you-put-in-dash" },
"user": {
"id": "id-of-blacklist-user",
"username": "username-of-blacklist-user",
"displayname": "displayName-of-blacklist-user"
},
"reasons": {
"fr": "in french",
"en": "in english",
"es": "in spanish"
}
}
Always check if the pass in metadata.pass is the same as the one that you put in the obl dashboard !
MetaData
Metadata is really important, it shows what even has been sent to you, and the pass you provided in the OpenBlacklist Dashboard !
User
User is literally just the user info, allows you to not make the fetch call yourself to the discord api !
Reasons
We have 3 languages supported at this moment, french, english and spanish ! Just select the one you prefer !
And that's it ! You're done with this guide that totally didn't take me 3 days to make ! Explore the rest, of the documentation, it will be useful !
Last updated