Instead of requiring fetching an authkey from a web endpoint, authorization should take place within the websocket's initial HTTP request via usual methods such as OAuth or cookie verification.
If the channel id does not exist an error should be returned in the reply.
If a join method has already succeeded for the channel id on the connection an error should be returned in the reply
// Client:
{
"type": "method",
"method": "join",
"arguments": _channel_id_,
"id": _method_id_
}
// Server:
{
"type": "reply",
"error": null,
"data": {
"authenticated": true,
"roles": ["Owner"]
},
"id", _method_id_
}
If the channel id does not exist an error should be returned in the reply.
If the channel is not joined for the connection an error should be returned in the reply.
// Client
{
"type": "method",
"method": "leave",
"arguments": [_channel_id_],
"id": _method_id_
}
// server
{
"type": "reply",
"error": null,
"data": null,
"id": _method_id_
}
Once a channel has been joined, all other methods' first argument* is the channel id inwhich to interact with.
If the channel id does not exist an error should be returned in the reply.
If the channel id has not previously been joined for the connection an error should be returned.
{"type": "method", "method": "msg", "arguments": [_channel_id_, "Hello world :)"], "id": _method_id_}
{"type": "method", "method": "vote", "arguments": [_channel_id_, 0], "id": _method_id_}
All events are required to contain a channel
property identifying which channel the event took place on*
{
"channel": _channel_id_,
"id": _event_id_,
"user_name": "Username",
"user_id": 12345,
"user_roles": [
"User"
],
"message": {
"message": [{
"type": "text",
"data": "Hello! ",
"text": "Hello! "
}],
"meta": {}
}
}
*: Potentially, this could not be required for whispers as its been stated that beam would like to de-couple whispers from a specific channel's scopes