The MEDKit REST API gives your game or other Twitch extension direct access to GameLink services through a persistent bidirectional connection to the Muxy Cloud that supports the WebSocket Protocol .
The REST API has two base URLs:
Debugging endpoints for the development environment.
These are completely separate environments that don’t share information and have different levels of security. Sandbox is used for testing only and can be easily used by developers, but it inaccessible by production viewers.
All endpoints are versioned by path; for example
Authorization header is required for almost all API requests.
authtokenendpoint, which you use to obtain a token for the
sandboxdevelopment environment. This token is not accepted in the production environment.
pinendpoint, which is authorized only by a Twitch Client ID, and is used to obtain credentials for subsequent calls to the MedKit REST API.
The value of the Authorization header is a space-separated Extension ID/JWT pair of the form
Authorization: 12345 eyJhbGciOiJIU...
curl -X POST https://sandbox.api.muxy.io/v1/e/viewer_state \ -H "Authorization: 12345 eyJhbGciOiJIU"
Detailed API doc under construction
Available only on
In an unauthorized POST call, a broadcaster exchanges a Twitch Client ID for credentials to use in subsequent calls to the MedKit REST API.
GET returns basic information about the current authorized extension.
Muxy maintains and reports developer-defined configuration data with 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.
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.
Muxy maintains and reports developer-defined state data 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.
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 techniques for aggregating viewer data.
- 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.
- A trivia quiz service helps you implement a sophisticated voting-and-reward system with multiple-choice questions. An admin creates and manages the poll and users submit choices. The service collects user responses and provides statistical data.
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.
Create sets of multiple-choice questions, collect user choices, get statistics on user choices.
Additional endpoints support administrative services, including back-channel and server-to-server communication.
Broadcast messages to viewers on a per-channel or per-extension basis.
This service also enables server-to-server and back-channel communication.
Handle purchases of products that you offer through the Twitch Extension Bits Monetization API.