GrandMA 2 Websockets API 3.7.0

The GrandMA 2 Websockets API is the API used by the web remote.

Servers

{deskIp}/?ma=1 ws

The GrandMA 2 console software

deskIp: The IP of the desk we want to control.
DEFAULT: 192.168.0.1

Operations

Pub /

Accepts one of the following messages:

#1 session

Unsure

Payload
object
session
required
integer
>= 0

Additional properties are NOT allowed.

#2 dataRequest

Payload
object
requestType
required
string
Enum: "getdata"
data
required
string

The data fields to query from the desk. Looks like MA is not following standards here, because this is not an array with data field keys but a concatenated string like "set,clear,solo,high".

maxRequests
required
integer
>= 1

Unsure

session
required
integer
>= 0

Additional properties are NOT allowed.

#3 loginRequest

Payload
object
requestType
required
string
Enum: "login"
username
required
string
password
required
string
must match ^[0-9a-zA-Z]{32}$

MD5 hash of user's password.

session
required
integer
>= 0
maxRequests
required
integer
>= 1

Additional properties are NOT allowed.

#4 closeConnection

Tells the desk that the WebSocket should be closed

Payload
object
requestType
required
string
Enum: "close"
session
required
integer
>= 0
maxRequests
required
integer
>= 1

Unsure

Additional properties are NOT allowed.

Examples

{
  "session": 0
}
This example has been generated automatically.
{
  "requestType": "getdata",
  "data": "string",
  "maxRequests": 1,
  "session": 0
}
This example has been generated automatically.
{
  "requestType": "login",
  "username": "string",
  "password": "string",
  "session": 0,
  "maxRequests": 1
}
This example has been generated automatically.
{
  "requestType": "close",
  "session": 0,
  "maxRequests": 1
}
This example has been generated automatically.

Sub /

Accepts one of the following messages:

#1 serverStatus

Payload
object
status
required
string
Enum: "server ready"
appType
required
string
Enum: "gma2"

Additional properties are NOT allowed.

#2 sessionInformation

Unsure

Payload
object
realtime
required
boolean
session
required
integer
>= 0
forceLogin
required
boolean
worldIndex
required
integer
>= 0

Additional properties are NOT allowed.

#3 dataResponse

The desk responding to dataRequest

Payload
object
realtime
required
boolean
responseType
required
string
Enum: "getdata"
data
required
array<object>

Items:

0
object

Property keys follow along to the requested data field keys.

Additional properties are NOT allowed.

Additional items are allowed.

worldIndex
required
integer
>= 0
prompt
string

The prompt used by the desk shell.

Default: "[Channel]>"
promptcolor
string
Default: "#808080"

Additional properties are NOT allowed.

#4 loginResponse

The desk responding to loginRequest

Payload
object
realtime
required
boolean
responseType
required
string
Enum: "login"
result
required
boolean
worldIndex
required
integer
>= 0

Additional properties are NOT allowed.

Examples

{
  "status": "server ready",
  "appType": "gma2"
}
This example has been generated automatically.
{
  "realtime": true,
  "session": 0,
  "forceLogin": true,
  "worldIndex": 0
}
This example has been generated automatically.
{
  "realtime": true,
  "responseType": "getdata",
  "data": [
    {}
  ],
  "worldIndex": 0,
  "prompt": "[Channel]>",
  "promptcolor": "#808080"
}
This example has been generated automatically.
{
  "realtime": true,
  "responseType": "login",
  "result": true,
  "worldIndex": 0
}
This example has been generated automatically.