Overview of available functionality.
The REST API has two base URLs:
|Production environment. Your released extension will only work with this API.|
|Sandbox environment with relaxed authentication and limited data persistence.|
These are completely separate environments that don’t share information and have different levels of security. Sandbox is used for development and testing only, but is inaccessible by production viewers.
Sandbox does not check the authentication of users to allow developers to simulate viewer/broadcaster/admin combinations. Similarly it does not verify transactions or store state for very long.
All endpoints are versioned by path; for example
All calls must provide a valid Client ID. This is a Twitch Extension Client ID that has been registered with Muxy.
User authorization is done by passing a JSON Web Token in the
Authorization header is required for all API requests except:
authtokenendpoint, which you use to obtain a JWT for the
sandboxdevelopment environment. This token is not accepted in the production environment.
pinendpoint. This endpoint is an alternative way to authenticate a user by passing a Client ID and 6-character PIN that has been generated previously. The response includes a JWT to use for subsequent API calls.
The value of the
Authorization header is a space-separated Client ID/JWT pair of the form
Authorization: 12345 eyJhbGciOiJIU...
curl -X GET https://sandbox.api.muxy.io/v1/e/viewer_state \ -H "Authorization: 12345 eyJhbGciOiJIU"
All endpoints below are on the main
/e/<endpoint>service unless noted otherwise.
Data Storage and Retrieval
The REST API allows you to define, store, and retrieve data for general extension configuration and for real-time extension usage.
This data store is available in two scopes, extension-wide and channel-wide.
- Each config store is defined by a single JSON object containing key-value pairs. The keys are developer-defined. Use these endpoints to set, modify, and retrieve configuration keys and values.
- Use a GET request to
all_configto retrieve the current content of all configuration stores.
- The individual config-store endpoints support GET, POST, and PATCH operations.
|Configuration Data Endpoint||Usage|
|Retrieves all configuration data in a single call.|
|Maintains and reports per-extension configuration across channels.|
|Maintains and reports per-channel configuration for all extensions running in a channel.|
This data store is available with four different scopes.
- Each state store is defined by a single JSON object containing key-value pairs. The keys are developer-defined. Use these endpoints to set, modify, and retrieve state keys and values.
- Use a GET request to
all_stateto retrieve the current content of all state stores.
- The individual state-store endpoints support GET, POST, and PATCH operations.
|State Data Endpoint||Usage|
|Retrieves all four state stores in a single call.|
|Maintains and reports per-extension state information.|
|Maintains and reports per-viewer state information.|
|Maintains and reports per-viewer state information for each extension.|
|Maintains and reports per-channel state information for all extensions running in a channel.|
The MEDKit REST API supports a variety of tools and techniques for encouraging viewer interaction and engagement, from simple aggregation of viewer data to support for the creation of interactive events.
- Accumulating data that users provide is the simplest form of aggregation.
- A ranking service collects answers to open-ended questions, and counts matching responses.
- A polling service helps you create and manage viewer polls, collect viewer votes, and work with voting results.
- The trivia and game codes services help you implement a sophisticated voting-and-reward system.
|Collect user input for developer-defined data.|
|Create open-ended questions, collect user answers, and get statistics on popular answers.|
|Create and manage polls, cast and collect users' votes, get voting results and logs.|
Additional endpoints support administrative services, including back-channel and server-to-server communication.
|Broadcast Messaging||Broadcast messages to viewers on a per-channel or per-extension basis.|
This service also enables server-to-server and back-channel communication.