2XX - Server management

200 - News list

Returns the news list. The results are paginated, so a number page (data.page) and a number of elements per page (data.pageSize) should be specified.

In

{"type":200,"data":{"pageSize":10,"page":1}}

Out

{"type":200,"data":{"pages":1,"news":[{"title":"New Title","image":"https://images.com/new1.png","content":"Hello world!"}]}}

201 - News creation

Inserts or (in case another one with the exact same title) updates a piece of news. Requires data.title, data.image (leave it as empty string if you don't want to use one) and data.description. Requires administration privileges.

In

{"type":201,"data":{"title":"New Title","image":"http://images.com/new1.png","content":"Hello world!"}}

Out

{"type":201,"data":{"status":"OK"}}

210 - Private key/value storage query

Queries the provided data.key from the private key/value storage (anyone can read from it) and returns its value.

In

{"type":210,"data":{"key":"key"}}

Out

{"type":210,"data":{"key":"key","value":"value"}}

211 - Private key/value storage upsert

Makes an upsert (insert or update) into the private key/value storage (anyone can read from it, but only an administrator can upsert). Requires administration privileges.

In

{"type":211,"data":{"key":"key","value":"value"}}

Out

{"type":211,"data":{"status":"OK"}}

220 - Live Events

Sends a Live Event with the message data.data to all clients connected to the channel data.channel. Send it to data.channel "-1" to make a broadcast to all existing channels. Requires administration privileges.

In

{"type":220,"data":{"channel":"0","data":"hello"}}

Out

{"type":220,"data":{"status":"OK"}}

and then, every user on channel 0 (the sender included if applies) will receive

{"type":220,"data":{"channel":"0","data":"hello"}}

Last updated