I am primarily a C# developer, I see in the documentation that if I want to have a chat bot join a custom room on my channel it needs to be through the room UUID.
It also says that to get this room uuid I can use the Get Chat Rooms by Channel endpoint. The sample code looks to be in some sort of Java that returns the info as JSON data.
My question is how could I achieve this same request with C#?
The API is just HTTP requests. So just google for a HTTP library/module for your language, C# in this case, and send a request with the URL/headers specified in the docs. The result is JSON, so youâll have to parse that into whatever data structure is appropriate.
That works fine, and the response I got back is in the same format as the documentation shows. However, when I modified this to get the room UUID, adding in the Client-ID header, and changing the endpoint string to âhttps://api.twitch.tv/kraken/chat/thatchcastle/roomsâ the response is {"_total":0,âroomsâ:[]}.
I made an extra room while testing this, so I expected to see either one or two rooms in the response, any thoughts on why itâs coming back zero?
The reason itâs showing 0 rooms is because youâre using the Channel Name in the URL when v5 uses channel ID. So your request is working but itâs requesting for a channel that doesnât exist.
If you use your ID instead the URL will be https://api.twitch.tv/kraken/chat/176636611/rooms which correctly shows the room.