Sonolus Wiki

POST /sonolus/rooms/{name}

/sonolus/rooms/{name} allows Sonolus app to join a room.

Query Parameters

Query ParameterValueDescription
Create ParametersanyOptional, see Options Query Parameters.

Request Headers

HeaderValueDescription
Sonolus-SignaturestringSee Sonolus-Signature.
Sonolus-Room-KeystringOptional, see POST /sonolus/rooms/create.

Request Body

type JoinRoomRequest = {
    type: 'authenticateMultiplayer'
    address: string
    room: string
    time: number
    userProfile: UserProfile
}

type

Server should verify that type equals to 'authenticateMultiplayer'.

address

Server should verify that address matches server address.

time

Server should verify that time is recent.

Response Code

CodeDescription
200 OK
401 UnauthorizedAuthentication required or expired.

Response Headers

HeaderValueDescription
Sonolus-VersionstringOptional, see Sonolus-Version.

Response Body

type JoinRoomResponse = {
    url: string
    type: 'round'
    session: string
}

url

Url of multiplayer server.

type

Type of multiplayer room.

Currently only 'round' is supported.

session

Server defined session information.

Examples

{
    "url": "wss://...",
    "type": "round",
    "session": "..."
}

Remarks

Server should verify that request body is authentic using Sonolus-Signature request header.

If a room is being created, create query parameters and Sonolus-Room-key header will be available.

If successful, client will join the multiplayer server with Sonolus-Room-Session header containing the value of session. Server can use it to replay necessary information to multiplayer server.