Eventsub

API base url: https://funplace.fun/api/eventsub/

Get Eventsubs list

GET getEventsubs

Get a list of available eventsubs.

Headers

Name
Value

Content-Type

application/json

Create subscription

GET create

scopes: Funplace::eventsub or Funplace::eventsub::create

Create a notification subscription.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <access_token>

FUNPLACE-PROFILE-ID

Query Parameters

Parameter
Required?
Type
Description

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.

type

yes

string

Type eventsub. View Eventsubs list.

version

yes

int

Version eventsub. View Eventsubs list.

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

Response body (If successful)

Parameter
Required?
Type
Description

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.

Connecting to a websocket

GET wss://ws.funplace.fun

Connecting to a previously created websocket subscription via connection ID.

Headers

Name
Value

Content-Type

application/json

Query Parameters

Parameter
Required?
Type
Description

connection_id

yes

string

Subscription ID.

Maintaining a connection using Ping-Pong

-> PING
<- PONG

We 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>}
}

Last updated

Was this helpful?