Repository navigation
Backend API
- API endpoints depend on the user type. Endpoints available for experimenters are listed in the Experimenter section, endpoints for participants in Participant. Endpoints in All Users are exempt from this and available to all users.
- The following endpoints refer to the API provided over the WebRTC data channels.
- All requests are made using Message JSONs.
- Besides the responses listed bellow, all endpoint responses also include:
type
ERROR, data: Error JSON.
Send a echo request / ping message. Server will respond with a pong message including the original data from the ping as well as a server timestamp.
| Type | Data |
|---|---|
PING |
{ ...optional arbitrary data } |
| Type | Data |
|---|---|
PONG |
Pong JSON |
Get all data for a requested filter (match filter name, channel and id) for all participants or only a specific (if request is made from Participant side). Server will respond with a message that contains all data of a filter.
If you want to receive data from a filter, the filter itself needs to implement the get_filter_data method.
BE CAUTIOUS: call from participant does not work (look at issue 154)
| Type | Data |
|---|---|
GET_FILTERS_DATA |
GetFiltersDataRequest JSON |
| Type | Data |
|---|---|
FILTERS_DATA |
dict of [str, FiltersData] JSON |
Get all sessions saved on the server.
| Type | Data |
|---|---|
GET_SESSION_LIST |
{} |
| Type | Data |
|---|---|
SESSION_LIST |
List of Session JSONs |
Save a session JSON on the server. Can be a new session (without any ID's) or an updated session (with session_id).
| Type | Data |
|---|---|
SAVE_SESSION |
Session JSON |
A SAVED_SESSION message is send to the caller and SESSION_CHANGE to all other experimenters connected to the hub.
| Type | Data |
|---|---|
SAVED_SESSION |
Session JSON |
SESSION_CHANGE |
Session JSON |
Permanently delete a session on the server.
| Type | Data |
|---|---|
DELETE_SESSION |
SessionIdRequest JSON |
The response contains the id of the deleted session and is broadcasted to all experimenters.
| Type | Data |
|---|---|
DELETED_SESSION |
SessionIdRequest JSON |
Create an experiment based on a session stored in the backend. The experiment will be in waiting state and participants can join.
If successful, a EXPERIMENT_CREATED message will be send to all experimenters connected to the hub.
| Type | Data |
|---|---|
CREATE_EXPERIMENT |
SessionIdRequest JSON |
If successful, the backend sends a EXPERIMENT_CREATED message to all experimenters and a JOIN_EXPERIMENT to the caller.
| Type | Data |
|---|---|
JOIN_EXPERIMENT |
Success JSON |
EXPERIMENT_CREATED |
SessionIdRequest JSON |
Join an existing experiment. Required for other API calls, that interact with an experiment. E.g. START_EXPERIMENT and STOP_EXPERIMENT.
| Type | Data |
|---|---|
JOIN_EXPERIMENT |
SessionIdRequest JSON |
| Type | Data |
|---|---|
JOIN_EXPERIMENT |
Success JSON |
Leave the experiment the experimenter is currently connected to. Returns an error if not connected to an experiment.
| Type | Data |
|---|---|
LEAVE_EXPERIMENT |
{} |
| Type | Data |
|---|---|
LEAVE_EXPERIMENT |
Success JSON |
Start the experiment the experimenter is currently connected to. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
If successful, a EXPERIMENT_STARTED message will be send to all experimenters connected to the experiment.
| Type | Data |
|---|---|
START_EXPERIMENT |
{} |
| Type | Data |
|---|---|
START_EXPERIMENT |
Success JSON |
Stop the experiment the experimenter is currently connected to. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
If successful, a EXPERIMENT_ENDED message will be send to all experimenters connected to the experiment.
| Type | Data |
|---|---|
STOP_EXPERIMENT |
{} |
| Type | Data |
|---|---|
STOP_EXPERIMENT |
Success JSON |
Add a note to the experiment the experimenter is currently connected to. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
| Type | Data |
|---|---|
ADD_NOTE |
Note JSON |
| Type | Data |
|---|---|
ADD_NOTE |
Success JSON |
Send a chat message to all or a single participant in the experiment the experimenter is currently connected to. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
| Type | Data |
|---|---|
CHAT |
ChatMessage JSON |
-
authormust beexperimenter
| Type | Data |
|---|---|
CHAT |
Success JSON |
Kick a participant in the current experiment. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
| Type | Data |
|---|---|
KICK_PARTICIPANT |
KickRequest JSON |
| Type | Data |
|---|---|
KICK_PARTICIPANT |
Success JSON |
Ban a participant in the current experiment. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
| Type | Data |
|---|---|
BAN_PARTICIPANT |
KickRequest JSON |
| Type | Data |
|---|---|
BAN_PARTICIPANT |
Success JSON |
Set the muted state for a participant in the current experiment. Use CREATE_EXPERIMENT or JOIN_EXPERIMENT to connect to an experiment.
| Type | Data |
|---|---|
MUTE |
MuteRequest JSON |
| Type | Data |
|---|---|
MUTE |
Success JSON |
Modify the filters for a participant in the current experiment. See SetFiltersRequest for details about the request contents.
A SUCCESS message is send to the caller and SESSION_CHANGE to all experimenters connected to the hub.
| Type | Data |
|---|---|
SET_FILTERS |
SetFiltersRequest JSON |
| Type | Data |
|---|---|
SET_FILTERS |
Success JSON |
SESSION_CHANGE |
Session JSON |
Modify the group filters for the experiment. See SetGroupFiltersRequest for details about the request contents.
A SUCCESS message is send to the caller and SESSION_CHANGE to all experimenters connected to the hub.
| Type | Data |
|---|---|
SET_GROUP_FILTERS |
SetGroupFiltersRequest JSON |
| Type | Data |
|---|---|
SET_GROUP_FILTERS |
Success JSON |
SESSION_CHANGE |
Session JSON |
Sends a message to the participants or only a specific participant. The server collects all statuses for the requested filter (match filter name, channel and id)
If you want to receive data from a filter, the filter itself needs to implement the get_filter_data method.
| Type | Data |
|---|---|
GET_FILTERS_DATA_SEND_TO_PARTICIPANT |
GetFiltersDataSendToParticipantRequest JSON |
| Type | Data |
|---|---|
FILTERS_DATA |
dict of [str, FiltersData] JSON |
This API call gets all the filters configurations which means how dynamic filters are implemented in frontend. It retuns an object of Filter arrays
| Type | Data |
|---|---|
GET_FILTERS_CONFIG |
{} |
| Type | Data |
|---|---|
FILTERS_CONFIG |
FilterConfigDict |
Send a chat message to the experimenters connected to the experiment the participant is part of.
| Type | Data |
|---|---|
CHAT |
ChatMessage JSON |
-
targetmust beexperimenter -
authormust be the participant ID
| Type | Data |
|---|---|
CHAT |
Success JSON |