Custom Post Requests

What are they ?

Custom post requests are made to recieve a POST request from the OpenBlacklist servers to know when someone is added or removed from the Blacklist !

How to use it ?

1

Listen to a port and choose a route

Listen to the port where your server is running, and choose a route, for example /obl, make the URL in your OpenBlacklist Dashboard be the same as your server:port/route !

2

Wait for someone to be added

We will add a "Test" button soon, but before, you will need to wait someone is added or removed to the blacklist, you will recieve:

{
    "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"
    }
}

Here, there are 2 important parts of the request:

  • Metadata

  • User data & Reasons

What is metadata ?

Metadata is what OpenBlacklist gives you to make your life easier, there is the pass you provided on the dashboard, and the event: "add" or "remove" ! ALWAYS CHECK THE PASS

User Data and Reasons

User Data contains the id, username and displayname of the user added, when removed, displayname is not available as is it not stored in database !

Reasons are the same but in 3 languages ! Only available on addition

  • French: "fr"

  • English: "en"

  • Spanish: "es"

And yeah !

Blacklist Addition Data

{
    "metadata": { event: "add", 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"
    }
}

Blacklist Remove Data

{
    "metadata": { event: "remove", pass: "the-pass-you-put-in-dash" },
    "user": {
        "id": "id-of-blacklist-user",
        "username": "username-of-blacklist-user"
    }
}

Last updated