API endpoint for chat's banlist

Hi,

my Name is Alexander and I am the software developer for Gronkh’s Twitch channel.

It would be really, really awesome if we can get a API endpoint to receive all created bans/timeouts by our mods.
In best case the following information:

  • DateTime of ban/timeout created
  • User who has been banned/timeouted
  • User who has created the ban/timeout
  • Length (if just a timeout)
  • Active (True/False if it was a ban but it has been unbanned)

This would help us a lot to manage our channel.
I’ve seen there is already a feature request on github: https://github.com/justintv/Twitch-API/issues/17

Regards,
Alexander

1 Like

This might fit better into the API forum.

Having reasons would be good too. And all the same information for unbans too, or at least some way of marking a ban as reverted, e.g. as described above.

I’ve posted it in Chat because the description told me that “Feature requests, bugs, and suggestions for both the IRC interface and web APIs are welcome.”.

And yes, reasons would be also nice. I really hope the Twitch staff will integrate this API soon. :heart_eyes:

I propose to modify your request as follows:

Unauthenticated

  • Endpoint: https://api.twitch.tv/kraken/channels/{TestChannel}/BanInfo
  • Method: GET
  • Pupose: Allows any user to check their timeout/ban against a channel - This endpoint is restricted to the current user, it checks the current users credentials against the test channel for timeout/ban status
  • Fields
    a) Datetime of ban/timeout
    b) Length of timeout (0/null for ban)

Authenticated

[List of users]

  • Endpoint: https://api.twitch.tv/kraken/channels/{TestChannel}/BanInfo?limit=100&offset=0
  • Method: GET
  • Required Scope: channel_blocks_read
  • Purpose: Gets a list of all users banned/timeout (paged)
  • Fields (All fields related to banned/timed out user
    a) UserID
    b) Channel name
    c) Datetime of ban/timeout creation (UTC)
    d) Ban type (timeout, ban)
    e) Length (0/null for ban)
    (Dropped ‘Active’, this endpoint should not track historical bans IMO)

[Single User]

  • Endpoint: https://api.twitch.tv/kraken/channels/{TestChannel}/BanInfo/{CheckUser}
  • Method: GET
  • Required Scope: channel_blocks_read
  • Purpose: Checks if designated user is timed out/banned, null if the user is not timed out/banned (NULL if not timedout/banned)
  • Fields (All fields related to banned/timed out user
    a) UserID
    b) Channel name
    c) Datetime of ban/timeout creation (UTC)
    d) Ban type (timeout, ban)
    e) Length (0/null for ban)
    (Dropped ‘Active’, this endpoint should not track historical bans IMO)

[Timeout/Ban new user]

A possible edit to the Timeout/Ban POST request would be taking a List(ban user json object) so that you can bulk ban users. Practical use for this would likely be mostly related to events? Ideally the timeout/ban endpoint could take a twitch user id, or channel name based on something like (_id=####, name=somename) [one or the other needs to be populated, not both]

Reasoning for using channel_blocks_(read|write): Currently the users ignore list uses user_blocks_(read, write) so an ignored user for a ‘channel’ is timeout/banned.

What are your use cases for an API like this? Do you imagine that you’ll be able to query every time a person has been banned? Or just the current ban? Interested in thoughts around the uses for this API.

My primary use case is to get a list of banned users for easy display/management, the POST endpoint would be to help support automod features, especially around being able to track what mod did something, and not needing to be directly in chat to be able to manage timeouts/bans in chat. Another use case would be cross client integrations, such as minecraft servers, curse voice, discord, teamspeak, etc. If you ban someone from those servers, you can create a plugin that auto posts to the twitch endpoint (if you have twitch account linking) to ban/timeout that user from chat (or unban them)

The single user unauthorized endpoint is primarily for channel transparency on what’s going on with timeouts/bans, especially for fast flowing chats (think kripp speed) where the ‘you are not allowed to talk for some # of seconds’ just vanishes in the blink of an eye.

Single user authorized is to support research efforts for (mostly) moderators, so there’s an easy way to tell if the user is actually banned, and if so, why. (Add the json response result to an app that can track bans and you have a comprehensive dashboard for mods to research if a ban is justified or not)

The full list would make retrieving the full list of bans for auto unbans after time easier, or unbans for type offenses, basically, a pardoning system for non violent offenders.

In my case we just need one endpoint to get a full banlist (with pagination?) to see which users are currently banned on our chat.

Use cases:

  • Checking which mod has created the ban/timeout (if user contacts our mod team)
  • If I have the timestamp, I can easily show the last messages of the user (via our own chat history) to check if the ban was correct or a just mistake
  • And for sure it would be a nice to have if we can take a look at all active channel bans (for example: creating stats)

Result: Making the life for our mod team easier :slight_smile:

Regards
Alexander

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.