Skip to content

WebSockets Documentation

Dmitry Dergunov edited this page Dec 26, 2020 · 1 revision

Music10 WebSocket API 1.0.0 documentation

WebSocket Music10 API

Table of Contents

Servers

URL Protocol Description
ws.api.music.dergunov.net wss
URL Variables
Name Default value Possible values Description

Channels

Channel Parameters

subscribe game/setPlaylist

Message

Payload
Name Type Description Accepted values
Message Payload integer

Playlist id for game

Any
Example of payload (generated)
""

Channel Parameters

publish game/playlist

Message

Payload
Name Type Description Accepted values
id integer Any
name string Any
Example of payload (generated)
{
  "id": 1,
  "name": "Русский рэп"
}

Channel Parameters

subscribe game/next

Message

Payload
Name Type Description Accepted values
Message Payload object Any
Example of payload (generated)
{}

Channel Parameters

publish game/nextTracks

Message

Payload
Name Type Description Accepted values
tracks array(object)

Array with displayed files

Any
tracks.id integer Any
tracks.author string Any
tracks.name string Any
mp3 string

URL of mp3 file

Any
Example of payload (generated)
{
  "tracks": [
    {
      "id": 0,
      "author": "string",
      "name": "string"
    },
    {
      "id": 0,
      "author": "string",
      "name": "string"
    },
    {
      "id": 0,
      "author": "string",
      "name": "string"
    },
    {
      "id": 0,
      "author": "string",
      "name": "string"
    }
  ],
  "mp3": "string"
}

Channel Parameters

subscribe game/choose

Message

Payload
Name Type Description Accepted values
Message Payload integer

Playlist id of user choose

Any
Example of payload (generated)
""

Channel Parameters

publish game/chooseResult

Message

Payload
Name Type Description Accepted values
correct integer

Right Track ID

Any
result object Any
result.progress array(boolean)

Boolean array of game progress

Any
result.isEnd boolean

Game ending flag

Any
Example of payload (generated)
{
  "correct": 0,
  "result": {
    "progress": [
      true
    ],
    "isEnd": true
  }
}