Sonolus Wiki

POST /sonolus/rooms/{itemName}

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

URL Parameters

URL ParameterValueDescription
itemNamestringName of room.

Query Parameters

Query ParameterValueDescription
localizationstringSee localization.
Configuration OptionsanySee Options Query Parameters.
Create ParametersanyOptional, see Options Query Parameters.

Request Headers

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

Request Body

type ServerJoinRoomRequest = {
    type: 'authenticateMultiplayer'
    address: string
    room: string
    time: number
    userProfile: ServiceUserProfile
}

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

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.
404 Not Found

Response Headers

HeaderValueDescription
Sonolus-VersionstringOptional, see Sonolus-Version.

Response Body

type ServerJoinRoomResponse = {
    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

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 relay necessary information to multiplayer server.