Eventsub
API base url: https://funplace.fun/api/eventsub/
Get Eventsubs list
GET getEventsubs
Get a list of available eventsubs.
Headers
Content-Type
application/json
Create subscription
GET create
scopes: Funplace::eventsub or Funplace::eventsub::create
Create a notification subscription.
Headers
Query Parameters
transport[method]
yes
string
Method for receiving notifications. Supports the following values: webhook, websocket
transport[callback]
if (transport[method] = webhook)
URI
Specify to use webhooks. This is the link where notifications will be sent.
condition
no
Array
Conditions for this subscription. Specify values for the selected conditions. Only conditions provided by this version of this eventsub type are available.
Response
{
"success": "ok",
"data": {
"connection_id": "1-1-1753098006:96-6b03ffe8d24336b7",
"you_can_connect_within": 120,
"transport": {"method": "websocket"},
"condition": null,
"type": "alerts.notifications",
"version": "1",
"created_at": 1753098006
}
}{
"error": "bad request",
"error_data": "err"
}{
"error": "unauthorized",
"error_data": {},
}Response body (If successful)
success
yes
string
Always have the value ok.
data
yes
array
An array with information about the change.
data[connection_id]
yes
string
Subscription ID.
data[transport]
yes
Array
Information on how to receive notifications.
data[condition]
yes
Array
Conditions for this subscription. Specify values for the selected conditions. Only conditions provided by this version of this eventsub type are available.
data[type]
yes
string
Type eventsub.
data[version]
yes
int
Version eventsub.
data[created_at]
yes
int
UNIX Timestamp of the moment the subscription was created.
success
yes
string
Always have the value ok.
data
yes
array
An array with information about the change.
data[connection_id]
yes
string
Subscription ID.
data[transport]
yes
Array
Information on how to receive notifications.
data[condition]
yes
Array
Conditions for this subscription. Specify values for the selected conditions. Only conditions provided by this version of this eventsub type are available.
data[type]
yes
string
Type eventsub.
data[version]
yes
int
Version eventsub.
data[created_at]
yes
int
UNIX Timestamp of the moment the subscription was created.
data[you_can_connect_within]
yes
int
The period in seconds after creation that the websocket is open for connection.
Connecting to a websocket
GET wss://ws.funplace.fun
Connecting to a previously created websocket subscription via connection ID.
Headers
Content-Type
application/json
Query Parameters
connection_id
yes
string
Subscription ID.
Maintaining a connection using Ping-Pong
-> PING
<- PONGWe recommend using this at least once a minute.
Response
You can get acquainted with the notification body for any subscription type by getting the list of eventsub.
{
"type": "message",
"subscription": {<Subscription data. Same as the response from creating a subscription.>},
"data": {<notification body>}
}{
"type": "disconnect",
"data": {
"msg": "<some error text>",
}
}Last updated
Was this helpful?