This repository has been archived by the owner on Aug 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Command and Response Message Formats
Jas edited this page Jan 31, 2017
·
3 revisions
Command and responses are all received and sent in stringified JSON format (e.g. JSON.stringify(command)
and JSON.parse(response)
).
A command (or request) must take the following format:
{
command: string,
bot_id: number,
bot_request_id: uuid,
arguments: object
}
-
command
: One of the understood commands as listed in the Accepted Commands and Arguments page -
bot_id
: A unique ID for the component connected to the Interface -
bot_request_id
: A UUID for each command to link commands and responses together -
arguments
: The arguments related to the specified command
All responses will take the following format:
{
response_type: string,
response: object,
command: string (OPTIONAL),
bot_id: number array (OPTIONAL),
bot_request_id: uuid array (OPTIONAL)
}
-
response_type
: The type of response as defined in the "Supported Response Types" section below -
response
: The response object
If the response is related to a specific command instruction, the command
, bot_id
and bot_request_id
arguments will also be returned.
Note that the bot_id
and bot_request_id
fields returned are arrays (as opposed to a single element in the command). This is due to the batching of requests performed in the Interface prior to sending to the BuaBook API.
The response types supplied in a response message are as follows. Successful response types:
-
RESPONSE
: The message is a response to a specific command instruction -
UPDATE
: The message is a streaming update message from the BuaBook API -
INITIAL_UPDATE
: The message is a snapshot message sent when a component first connects to the Interface -
REQUEST_SENT
: A notification message informing that the supplied request IDs have been sent to the BuaBook API
Error response types:
-
COMMAND_ERROR
: A command instruction was rejected.response
will supply more detail -
UPDATE_ERROR
: An internal error occurred when trying to process a streaming update from the BuaBook API. Check the Interface logs for more details. If necessary, raise an issue with us to investigate further. -
RESPONSE_ERROR
: A command instruction resulted in an error on the BuaBook API
Copyright (C) Sport Trades Ltd 2017