Command and notification service API¶
The Command service provides an HTTP API for third-party applications, letting your website send commands to the game.
We require a security token for endpoints sending commands directly to the game.
This API also provides an endpoint allowing you to send notifications directly to the web-clients
Notification¶
-
POST
/notifications
¶ Notifications are sent ASAP. They are not synced to the stream. Notifications sent from this endpoint will have a sessionid set to ‘web’.
Request Headers: - secret – Security token required to send requests to the service.
Request JSON Object: - notifications[] (object) – list of notification objects
- notifications[].id (string) – The notification identifier.
- notifications[].data (string) – The payload of the notification encoded in base 64.
Example query:
{ "notifications": [ { "id": "", "data": "" } ] }
Command¶
-
POST
/commands/game
¶ A command is composed of a key-value pair. The game uses the key to identify the type of command. The value is a string that your game can parse.
Request Headers: - secret – Security token required to send requests to the service.
Request JSON Object: - key (string) – The ID the game uses to recognize the type of command.
- value (string) – The value the game parses into a command.
Example query:
{ "key": "", "value": "" }