Muxy Logo
  • API Documentation
  • MEDKit REST API

    • Introduction
    • Authorization Header
    • Viewer State
    • Channel State
    • Extension State
    • Extension Viewer State
    • All State
    • Voting
    • Broadcast
      • Send Channel Broadcast
      • Send Extension Broadcast
      • Whisper Self
    • Transaction Validation
    • Accumulation
    • Game Code / Key Distribution
    • Game-initiated PIN authorization

# Broadcast

The broadcast API family allows a broadcaster or admin authorized client to make broadcasts to viewers. Depending on the body and the authorization level, the broadcast endpoint family can send an arbitrary json object to a single viewer, a subset of viewers on a channel, all viewers on that channel, or all viewers that are currently using the extension.

Broadcasts are sandboxed by the Muxy JS SDK by stage - broadcasts sent to one API stage (production, sandbox) by this endpoint will not trigger listens on other API stages.

JSON objects sent by Broadcast should be under 6kb in size. If the JSON object is larger than 4k, it will be automatically compressed, then base64d by the backend. If the resulting base64 string is longer than 4kb, then the broadcast will fail. This means that the effective maximum size of the JSON object sent by broadcast is not well defined, but 6kb is a safe size. Automatically compressed JSON data will be decoded and decompressed by the Muxy JS SDK transparently.


# Send Channel Broadcast

The broadcast endpoint is the most generic of broadcast endpoints. It allows a backend or admin role authorized user to send a message to any channel. When broadcast is used as the target, the message will be sent to all viewers. If a targeted message is required, the target should be set to the string whisper-${user_id}, where user_id is the twitch user id of the viewer in question.

An application can only send 100 messages per five minute interval per channel.

# Endpoint

GET /v1/e/broadcast

# Authorization

Requires Authorization Header.

Must be backend or admin role.

# Request

{
    "target": string,
    "event": string,
    "user_id": string,
    "data": object
}
Name Type Description
target string Should be either broadcast or whisper-${user-id}.
event string Arbitrary event string. The frontend should listen for this string.
user_id string The channel to broadcast to.
data object Arbitrary data object to broadcast. Should be under roughly 6kb of text data.

# Response

{}

# Send Extension Broadcast

This endpoint will send an arbitrary json object to all viewers on all channels with the extension loaded.

# Endpoint

GET /v1/e/extension_broadcast

# Authorization

Requires Authorization Header

Must be backend or admin role. This authorization header must identify either the owner or an administrator of the extension

# Request

{
    "target": string,
    "event": string,
    "data": object
}
Name Type Description
event string Arbitrary event string. The frontend should listen for this string.
data object Arbitrary data object to broadcast. Should be under roughly 6kb of text data.

# Response

{}

# Whisper Self

This endpoint will send an arbitrary json object to the current viewer in the same channel that this request was made from. Generally, this endpoint is useful to send privileged events to the broadcaster configuration page when the broadcaster is interacting with the viewer extension.

# Endpoint

GET /v1/e/whisper_self

# Authorization

Requires Authorization Header

# Request

{
    "event": string,
    "data": object
}
Name Type Description
event string Arbitrary event string. The frontend should listen for this string.
data object Arbitrary data object to broadcast. Should be under roughly 6kb of text data.

# Response

{}

← Voting Transaction Validation →

Muxy is a venture backed software developer in Austin, TX.

We provide live video interaction solutions for developers and custom engagement software for game studios, esports, event productions and special events.

  • API Docs
  • Examples
  • Quick Start
  • Contact Us
  • Privacy Policy
  • Terms of Service
© 2020 Muxy, Inc.
support@muxy.io