-
Notifications
You must be signed in to change notification settings - Fork 0
API docs
All endpoints are visible in the ./api
directory, so if you run tree api
you'll see them all there:
api
├── clear
│ └── index.go
├── info
│ └── index.go
├── join
│ └── index.go
├── leave
│ └── index.go
├── next
│ └── index.go
└── position
└── index.go
6 directories, 6 files
All endpoints are GET
endpoints for simplicity. Endpoints will be documented in alphabetical order.
All documentation will use my host queuerrr.vercel.app
but you'll need to replace this with your own.
This will clear the queue.
Recommended for use only by broadcasters and moderators since this mutates the current queue, deleting everyone from it.
Recommended Twitch chat command mapping: !queue clear
curl --request GET \
--url https://queuerrr.vercel.app/api/clear \
--header 'Authorization: Bearer someGeneratedTokenABC123'
{
"status": "successfully cleared the queue"
}
Information about the queue.
curl --request GET \
--url https://queuerrr.vercel.app/api/info \
--header 'Authorization: Bearer someGeneratedTokenABC123'
Recommended Twitch chat command mapping: !queue info
which could output either the link to the website, or the first X number of users in the queue (or all users if you don't anticipate having many users).
{
"total": 2,
"users": [
{
"created_at": "2024-07-08T02:52:16.028782Z",
"twitch_username": "techydrrroid",
"twitch_user_id": "717321974",
"notes": "Room code is ABC123"
},
{
"created_at": "2024-07-08T02:52:22.313001Z",
"twitch_username": "techygrrrl",
"twitch_user_id": "176082690",
"notes": ""
}
]
}
Allows a user to join the queue.
Query params:
-
username
: viewer's username or display name -
user_id
: viewer's immutable user identifier -
notes
: viewer can supply notes, e.g. a room code for the match or their username on the gaming platform so you can look them up
Recommended Twitch chat command mapping: !queue join
and an alias !join
for simplicity.
They should also be able to provide notes to help expedite the process, e.g. !join the room code is ABC123
or you can do a channel point redemption and allow the user to enter text.
curl --request GET \
--url 'https://queuerrr.vercel.app/api/join?user_id=176082690&username=techygrrrl¬es=Room%20code%20is%20ABC123' \
--header 'Authorization: Bearer someGeneratedTokenABC123'
{
"created_at": "2024-07-08T02:52:22.313001Z",
"twitch_username": "techygrrrl",
"twitch_user_id": "176082690",
"notes": "Room code is ABC123 and my gamer tag is techygrrrl"
}
Allows a user to leave the queue.
Query params:
-
user_id
: viewer's immutable user identifier
Recommended Twitch chat command mapping: !queue leave
and an alias !leave
for simplicity.
curl --request GET \
--url 'https://queuerrr.vercel.app/api/leave?user_id=176082690' \
--header 'Authorization: Bearer someGeneratedTokenABC123'
{
"status": "successfully left queue"
}
Recommended for use only by broadcasters and moderators since this mutates the current queue, popping the first person in line off.
Recommended Twitch chat command mapping: !queue next
and an alias !next
for simplicity.
curl --request GET \
--url 'https://queuerrr.vercel.app/api/next' \
--header 'Authorization: Bearer someGeneratedTokenABC123'
{
"created_at": "2024-07-08T02:52:22.313001Z",
"twitch_username": "techygrrrl",
"twitch_user_id": "176082690",
"notes": "Room code is ABC123 and my gamer tag is techygrrrl"
}
Get the current position of a user.
Recommended Twitch chat command mapping: !position
and an alias !position
for simplicity.
Query params:
-
user_id
: viewer's immutable user identifier
curl --request GET \
--url 'https://queuerrr.vercel.app//api/position?user_id=176082690' \
--header 'Authorization: Bearer someGeneratedTokenABC123'
Returns -1 if the user is not in the queue, otherwise the position. Position count starts at 1.
{
"position": 2
}