Publish a message to a channel.
Required Form Variables:
Optional Form Variables:
Returns json:
[ success (boolean) , details (object) ]Example:
Client Requests URL:
/web/publish?security_token=yo&channel_name=testing&payload=[1, 2, "foo"]&originator=dictatorServer Replies:
[ true, {} ]And the following frame is published to channel ‘testing’:
{ "user": dictator, "payload": [1, 2, "foo"] }Add a user to a channel.
Required Form Variables:
Returns json:
[ success (boolean) , details (object) ]Example:
Client Requests URL:
/web/subscribe?security_token=yo&channel_name=testing&user=mcarterServer Replies:
[ true, {} ]And the user “mcarter” is subscribed to the channel “testing”.
Remove a user from a channel.
Required Form Variables:
Returns json:
[ success (boolean) , details (object) ]Example:
Client Requests URL:
/web/unsubscribe?security_token=yo&channel_name=testing&user=mcarterServer Replies:
[ true, {} ]And the user “mcarter” is unsubscribed from the channel “testing”.
Publish a message to a user.
Required Form Variables:
Returns json:
[ success (boolean) , details (object) ]Example:
Client Requests URL:
/web/message?security_token=yo&sender_name=bob&recipient_name=joe&payload=[1, 2, "foo"]Server Replies:
[ true, {} ]And the following message frame is sent to user ‘joe’:
{ "sender": "bob", "recipient": "joe", "payload": [1, 2, "foo"] }Returns all settings and attributes of a channel.
Required Form Variables:
Returns json:
[ success (boolean) , details (object) ]
Example:
Client Requests URL:
/web/get_channel_info?security_token=yo&channel_name=testingServer Replies:
[
true,
{
"name": "testing",
"options": {
"anonymous": false,
"history": [
[
"SUBSCRIBE",
{
"user": "mcarter"
}
],
[
"PUBLISH",
{
"payload": "good day",
"user": "mcarter"
}
],
[
"PUBLISH",
{
"payload": "was gibt es?",
"user": "mcarter"
}
]
],
"history_size": 5,
"moderated": false,
"moderated_publish": true,
"moderated_subscribe": true,
"moderated_unsubscribe": true,
"polling": {
"form": {},
"interval": 5,
"mode": "",
"originator": "",
"url": ""
},
"presenceful": true,
"reflective": true
},
"subscribers": [
"mcarter"
]
}
]Set the options on a channel.
Required Form Variables:
Optional Form Variables:
Example:
Client Requests URL:
/web/set_channel_options?security_token=yo&channel_name=testing&history_size=2&presenceful=trueServer Replies:
[ true, {} ]The history_size of the channel is now 2, and presenceful is false.
TODO
TODO
Sets a key in a channel’s state object. If the key already exists it is replaced, and if not it is created.
Required Form Variables:
Optional Form Variables:
Example:
Client Requests URL:
/web/state_set_key?security_token=yo&channel_name=testing&key=score&val={ "mcarter": 5, "desmaj": 11 }Server Replies:
[ true, {} ]The state of the channel now contains the key “testing” with the value { “mcarter”: 5, “desmaj”: 11 }. An onState javascript callback will be issued to all subscribers; They will be able to access subscription.state.score.mcarter and will see the value 5.
Removes a key from the state of a channel. If the key doesn’t exist then nothing happens.
Required Form Variables:
Optional Form Variables:
Example:
Client Requests URL:
/web/state_delete_key?security_token=yo&channel_name=testing&key=scoreServer Replies:
[ true, {} ]The state of the channel no longer contains the key “score”. An onState callback will be issued to all subscribers.
Update certain configuration parameters (mostly webhook related options) immediately without restarting hookbox.
Required Form variables:
Optional Form Variables:
Example:
Client Requests URL:
/web/state_delete_key?security_token=yo&cbhost="1.2.3.4&cbport=80Server Replies:
[ true, {} ]The callback host is now set to 1.2.3.4 and the port is now 80.
Returns all settings and attributes of a user.
Required Form Variables:
Returns json:
[ success (boolean) , details (object) ]
Example:
Client Requests URL:
/web/get_user_info?security_token=yo&user_name=mcarterServer Replies:
[
true,
{
"channels": [
"testing"
],
"connections": [
"467412414c294f1a9d1759ace01455d9"
],
"name": "mcarter",
"options": {
"reflective": true,
"moderated_message": true
}
}
]Set the options on a user.
Required Form Variables:
Optional Form Variables:
Example:
Client Requests URL:
/web/set_user_options?security_token=yo&user_name=mcarter&reflective=falseServer Replies:
[ true, {} ]The reflective of the user is now false.