Events

Subscriptions

Subscribe a live Socket.IO session to Blaze events by using the socket session id with a user access token or app access token.

Get Events Subscriptions

GEThttps://api.blaze.stream/v1/events/{sessionId}/subscriptions

Lists active event subscriptions for a socket session.

Authorizations

User access tokens and app access tokens are allowed. Some subscription types only accept user access tokens.

Path parameters

sessionIdstringrequired

Identifies the socket session whose active subscriptions should be listed.

Responses

  • 200OKapplication/json
  • 400Bad Requestapplication/json
  • 401Unauthorizedapplication/json
  • 403Forbiddenapplication/json
  • 500Internal Server Errorapplication/json
GET/v1/events/{sessionId}/subscriptions
GET /v1/events/{sessionId}/subscriptions HTTP/1.1
Host: api.blaze.stream
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
200OK
{
  "success": true,
  "message": "success",
  "data": [
    {
      "type": "channel.follow",
      "version": "1",
      "condition": {
        "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90"
      }
    }
  ]
}

Post Events Subscriptions

POSThttps://api.blaze.stream/v1/events/subscriptions

Subscribes the socket session to a supported event stream.

Authorizations

Accepted auth type depends on the subscription type. channel.follow requires a user access token.

Scopes

users.read

Request body

typestringrequired

Event type to subscribe to.

versionstringoptional

Subscription version. Defaults to 1 when omitted.

sessionIdstringrequired

Socket session id that should join the subscription room.

condition.channelIdstringrequired

Channel UUID used to build the channel.follow event room.

Responses

  • 200OKapplication/json
  • 400Bad Requestapplication/json
  • 401Unauthorizedapplication/json
  • 403Forbiddenapplication/json
  • 500Internal Server Errorapplication/json
POST/v1/events/subscriptions
POST /v1/events/subscriptions HTTP/1.1
Host: api.blaze.stream
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
content-type: application/json

{
  "type": "channel.follow",
  "version": "1",
  "sessionId": "SOCKET_SESSION_ID",
  "condition": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90"
  }
}
200OK
{
  "success": true,
  "message": "success"
}

Delete Events Subscriptions

DELETEhttps://api.blaze.stream/v1/events/subscriptions

Removes an event subscription from the socket session.

Authorizations

Use an access token accepted by the subscription type you want to remove.

Request body

typestringrequired

Event type to unsubscribe from.

versionstringoptional

Subscription version. Defaults to 1 when omitted.

sessionIdstringrequired

Socket session id that should leave the subscription room.

condition.channelIdstringrequired

Channel UUID used to build the channel.follow event room.

Responses

  • 200OKapplication/json
  • 400Bad Requestapplication/json
  • 401Unauthorizedapplication/json
  • 403Forbiddenapplication/json
  • 500Internal Server Errorapplication/json
DELETE/v1/events/subscriptions
DELETE /v1/events/subscriptions HTTP/1.1
Host: api.blaze.stream
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
content-type: application/json

{
  "type": "channel.follow",
  "version": "1",
  "sessionId": "SOCKET_SESSION_ID",
  "condition": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90"
  }
}
200OK
{
  "success": true,
  "message": "success"
}