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
1 |
/groups/{groupId}/playbackSession/join |
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 |
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 |
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
1 2 3 4 |
{ "appId": "com.example.yourAppId", "appContext": "1a2b3c" } |
Response
If your appId
and appContext
match an existing session, the player joins your app to the session. Here is the response:
1 2 3 4 5 6 |
{ "sessionState": "SESSION_STATE_CONNECTED", "sessionId": "abcdef123456", "sessionCreated": false, "customData": "playlistid:12345" } |