playbackSession > joinSession

Use the joinSession command in the playbackSession namespace to join an existing session in the group. To successfully join the session your app will have to provide the same appId and appContext that was used when creating the session.


Endpoint

POST


Request Parameters

This command requires a groupId to determine the target of the command. See the Control documentation for details.

See the table below for descriptions of parameters in the body.

Parameter Type Value
appId string Identifies your app. This should be a reverse DNS name of the form “com.companyname.appname” or similar. It is used together with appContext to determine if a session can be joined or not. As a best practice, user-identifiable data should be hashed or encoded so that it is only useful to your app.

The sum total length of appId and appContext must be less than 255 bytes. Otherwise, the player will return an error.

appContext string Instance data for your app, an opaque string that you can use to identify a particular user account, for example. It is used together with appId to determine if a session can be joined or not. As a best practice, user-identifiable data should be hashed or encoded so that it is only useful to your app.

The sum total length of appId and appContext must be less than 255 bytes. Otherwise, the player will return an error.


Response

Upon completion, returns a sessionStatus object type.

In the event of a failure, returns a sessionError or a globalError.

For example, if the parameters do not match or if there is no current session, the player returns an ERROR_SESSION_JOIN_FAILED. See sessionError for details.


Example

Request

Response

If your appId and appContext match an existing session, the player joins your app to the session. Here is the response: