Introduction

This API call is to send real time data to the Warehouse/Statistics Engine. It is accomplished by sending a stream of messages over a long running socket. Pending network problems the connection should remain open for the length of the match.

Connection

There are two different ways to establish a publish connection to the system a HTTP method or a RAW method. These two different ways exists to enable the client to potentially work around any port or proxy problems present at in venue areas. Connections can also be sent over one of two different ports, 80 or 5522

The same data, parameters and format is used in both methods, only the startup of the connection differs.

Note: This call makes use of the streaming API endpoint which differs from the standard API endpoint.

HTTP Request

POST /v2/{sport}/publish

RAW

In the RAW method, a socket is opened to the streaming API endpoint and the request string is sent, followed by two carriage returns (\n\n) or two carriage return line feeds (\r\n\r\n). To initiate RAW mode the nohttp parameter must be present and set in the request string.

/v2/{sport}/publish
  streamKey string(30)

The unique authorisation key that allows the streaming of the match

  timestamp integer

The UNIX timestamp for the current date and time indicating the number of seconds since January 1st 1970 at UTC. The client timestamp must be within 60 seconds of the correct time or else the connection will be refused.

  appVersion string(64)

Application name and version that is sending the data.

nohttp enum

If set to 1 then the connection will operate in RAW mode. If this parameter is not present or not set to the value of 1, then the connection will operate in HTTP mode regardless of what connection string is sent.

0
No (Default)
1
Yes
mode enum

The mode of the connection

master
Master - The data being sent is distributed to any outputs (Default)
backup
Backup - The data being sent is processed but not distributed to any outputs
format enum

The format the data is being sent in.

json
JSON (Default)
xml
XML
sendAcks enum

If set to 1, then each message received will generate an acknowledgement message.

0
No (Default)
1
Yes
Example - HTTP
POST /v2/basketball/publish?streamKey=TESTSTREAMKEY&timestamp=1412987153 HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Example - RAW
/v2/basketball/publish?nohttp=1&streamKey=TESTSTREAMKEY&timestamp=1412987153

Request Body

The body of the request should be a series of messages (defined below). Each message must be delimited by a carriage return/line-feed \r\n series of characters (in hex, 0x0D 0x0A). Consequently this series of characters must not appear in any message content.

Message Compression

The content if each message may be sent in a compressed format to reduce the size of the data being transferred. The message data should be compressed using a gzip/deflate algorithm (http://www.faqs.org/rfcs/rfc1951.html)and then Base64 encoded. Instead of the normal data being the value of the message key, the compressed data should be the value of a compressedMessage key.

Example - Uncompressed
{
  "message": {
    "type": "master",
    "format": "json"
  }
}
Example - Compressed
{
  "compressedMessage": "q1YqqSxIVbJSyk0sLkktUtJRSssvyk0sAYpkFefnKdUCAA=="
}

Connection Timeouts

To maintain the open connection at least one message must be sent every 20 seconds. A keepalive message may be sent if no other message needs to be sent.

The session will be closed automatically if it has been open for more than 4 hours, whether data is being sent or not.

Master/Slave

For redundancy purposes the system supports multiple connections for the same match from different clients. There can only be one connection in master mode, all the others must be in backup mode. If a second connection is made in master mode, or a connection changed to master mode then the first master connection is disconnected.

Connection Latency

To monitor the latency of the entire streaming process as well as the connection between the client and the warehouse the latency of the connection is measured. This process involves the sending of a latencyrequest message from the warehouse to the client. The client should immediately respond with a latencyresponse message containing the information sent by the warehouse.

Message Ids

For messages that require a messageId, the messageId MUST be a unique and sequential integer. Numbers cannot be skipped. If the system detects that a messageId has been skipped then an error will be generated indicating which messageId is missing. The client should interpret this message and resend all messages from (and including) the missing Id. Processing will not be resumed until the missing message is processed.

messageId vs actionNumber It can sometimes be confusing to tell the difference between these two fields. It may be easier to think of them as the primary keys to two database tables. actionNumber is the primary key for the list (table) of actions that occur during the match. An actionNumber uniquely identifies that action, and doesn't change even if details about that action are changed. messageId can be thought of as the primary key of the list (table) of messages that have been sent. A messageId unqiuely identifies a message that has been sent. Any edit of an existing actionNumber would require a new message be sent (a new messageId), but the same actionNumber.

Character Set

All data provided to these API functions is required to be in UTF-8 format.

All responses will be provided as UTF-8 strings.

Player participation tracking

Players are marked as participated if any of these conditions are met

  • Player is marked as starter in teams message
  • Player is mentioned in substitution message

Message Types Received

While the publish call is primarily about streaming data to the warehouse, the connection is bi-directional and messages will also be sent from the warehouse.

This is a list of all the message types that can be sent from the Statistics Engine to the cli ent.

authenticated

The message type is returned from the warehouse on successful authentication. The field lastMessageId contains the id of the last successfully processed message. If the connection is a reconnection then the client should sent all messages with an Id after this one.
type enum

The type of the message

authenticated
lastMessageId integer

The last messageId successfully processed for this match.

Example

{
  "message": {
    "type": "authenticated",
    "lastMessageId": 45
  }
}

error

The message type is returned from the warehouse on any type of error.
type enum

The type of the message

error
error string

A string description of the error

Example

{
  "message": {
    "type": "error",
    "error": "[message.clockRunning] is missing and it is required"
  }
}

latencyrequest

This message type is sent from the warehouse to measure latency for the connection. The client should immediately respond with a lantencyresponse message.
type enum

The type of the message

latencyrequest
number integer

A unique number. This should be immediately returned by the client in a latencyresponse message.

Example

{
    "message": {
        "type": "latencyrequest",
        "number": 1492625489.6728
    }
}

ack

The message type is sent in response to a message from the client. Only sent when the sendAcks parameter is set on connection.
type enum

The type of the message

ack
acktype string

The type of the message being acknowledged.

  messageId integer

The messageId of the message being acknowledged.

actionNumber integer

The actionNumber (if present) of the message being acknowledged.

Example

{
    "message": {
        "type": "ack",
        "acktype": "action",
        "actionNumber": 712,
        "messageId": 925
    }
}
Message Types Sent

This is a list of all the message types that can be sent to the Statistics Engine from the client.

setup

This message type has information about the how the match will be run. This message type must be sent at least once before the beginning of the match.
  type enum

The type of the message

setup
  messageId integer

Unique identifier of the message being sent

inConference enum

Is this an in conference match. If this differs from prematch match data – a notification will be generated for League Manager.

0
No
1
Yes
atNeutralVenue enum

Is this match played at a neutral venue. If this differs from prematch match data – a notification will be generated for League Manager.

0
No
1
Yes
courtType enum

Court type of the match.

1
Default
periods associativearray

number integer

The number of periods in a match, not including any over/extra time

length integer

The length of each period (in minutes)

extraTime enum

Whether a match in this competition can play overtime? 1=Yes, 0=No.

1
Yes
0
No
extraTimeLength integer

The length of each overtime period (in minutes)

timeouts associativearray

timeouts integer

The number of timeouts allowed in regulation time.

timeoutsExtraTime integer

The number of timeouts allowed in extra time.

foulsPersonal integer

The number of personal fouls allowed.

foulsTechnical integer

The number of technical fouls allowed.

foulsBeforeBonus integer

The number of fouls allowed before a bonus is given.

foulsBeforeDoubleBonus integer

The number of fouls allowed before a double bonus is given.

foulsBeforeTechnical integer

The number of fouls allowed before a technical foul is given.

winningScore integer

The score that a team must reach within regulation time to win.

customEfficiencyFormula string

A string giving the formula to calculate a custom efficiency value. The formula can use simple mathematical constructs * + - / () and contain a number of variables. Each variable must be the name of a valid Team Match Statistic. For a complete list of allowed statistic names check the team match statistics.

Example: (sPoints + sAssists + sBlocks + sSteals + sFoulsOn + sReboundsTotal) - (sTurnovers + sBlocksReceived + sFoulsPersonal + sFoulsTechnical + (sTwoPointersAttempted - sTwoPointersMade) + (sOnePointersAttempted - sOnePointersMade))
warmupTime integer

The length of time in minutes alloted before the game to warmup.

Example

{
    "message": {
        "timeouts": {
            "extratime": 1,
            "period4": 2,
            "period3": 2,
            "period2": 2,
            "period1": 2,
            "half2": 3,
            "half1": 2,
            "style": "period"
        },
        "periods": {
            "breakPeriod": 2,
            "breakHalftime": 2,
            "length": 10,
            "overtime": 1,
            "number": 4,
            "lengthOvertime": 5
        },
        "messageId": 1,
        "maxFoulsTechnical": 5,
        "shotClock": 25,
        "type": "setup",
        "customEfficiencyFormula": "",
        "foulsBeforeBonus": 4,
        "maxFoulsPersonal": 5
    }
}

teams

This message type defines the teams and players for the match. It is compulsory to send at least one of these messages.
  type enum

The type of the message

teams
  messageId integer

Unique identifier of the message being sent

teams array

An array of team records

  teamNumber integer

The number of the team in the match, 1 or 2.

competitionStatistics associativearray

sWins integer

Overall wins of the team. Compared with prematch [matchInformation][teams][teams][competitionStatistics][sWins]. If different sends notification to se support system to league manager.

sDraws integer

Overall draws of the team. Compared with prematch [matchInformation][teams][teams][competitionStatistics][sDraws]. If different sends notification to se support system to league manager.

sLosses integer

Overall losses of the team. Compared with prematch [matchInformation][teams][teams][competitionStatistics][sLosses]. If different sends notification to se support system to league manager.

conferenceStatistics associativearray

sWins integer

Conference wins of the team. Compared with prematch [matchInformation][teams][teams][conferenceStatistics][sWins]. If different sends notification to se support system to league manager.

sDraws integer

Overall draws of the team. Compared with prematch [matchInformation][teams][teams][conferenceStatistics][sDraws]. If different sends notification to se support system to league manager.

sLosses integer

Conference losses of the team. Compared with prematch [matchInformation][teams][teams][conferenceStatistics][sLosses]. If different sends notification to se support system to league manager.

detail associativearray

  teamName string(100)

The name of the team

isHomeCompetitor enum

Is this a 'home' match for this competitor.

0
No
1
Yes
  teamId integer

Unique identifier for the team

teamNickname string(50)

A non-offical name of the team

teamCode string(3)

A three letter code for this team

isExhibition enum

Is this competitor playing an exhibition game? Note - exhibition games are always excluded from competition/conference statistics.

0
No (Default)
1
Yes
sportClass string(64)

Total team sport class value used for para-sports.

players array

  pno integer

The number of the player in the match. This is a sequence number not a jersey number.

personId integer

Unique identifier for the person

  familyName string(50)

The family name of the person

  firstName string(50)

The first name of the person

height double

The height of the person, in cms

sportClass string(64)

A value used to describe the Sport Class for para-sports.

shirtNumber string

Player's shirt Number for the match.

playingPosition string(30)

Player's playing position for the match.

starter enum

Is the person a starter?

1
Yes
0
No (Default)
captain enum

Is the person the captain?

1
Yes
0
No (Default)
active enum

Is the person currently active/on the field of play?

1
Yes
0
No (Default)
coach associativearray

DEPRECATED. Use teamOfficials instead.

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

assistcoach1 associativearray

DEPRECATED. Use teamOfficials instead.

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

assistcoach2 associativearray

DEPRECATED. Use teamOfficials instead.

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

teamOfficials array

A list of team officials

personId integer

Unique identifier for the person

firstName string(100)

The first name of the official

familyName string(100)

The family name of the official

shirtNumber string(30)

Shirt number

  officialType enum

CAPTAIN
Captain
VICE_CAPTAIN
Vice Captain
HEAD_COACH
Head Coach
COACH
Coach
ASSISTANT_COACH
Assistant Coach
UMPIRE
Umpire

Example

{
    "message": {
        "messageId": 29,
        "teams": [{
            "players": [{
                "active": 1,
                "pno": 1,
                "firstName": "Brandon",
                "personId": 424206,
                "shirtNumber": "3",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Clark",
                "starter": 1,
                "captain": 0
            }, {
                "active": 1,
                "pno": 2,
                "firstName": "Tyler",
                "personId": 8775,
                "shirtNumber": "4",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Bernardini",
                "starter": 1,
                "captain": 1
            }, {
                "active": 0,
                "pno": 3,
                "firstName": "William",
                "personId": 94332,
                "shirtNumber": "5",
                "playingPosition": "F\/C",
                "height": 0,
                "familyName": "Maynard",
                "starter": 0,
                "captain": 0
            }, {
                "active": 1,
                "pno": 4,
                "firstName": "Shane",
                "personId": 248176,
                "shirtNumber": "7",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Walker",
                "starter": 1,
                "captain": 0
            }, {
                "active": 0,
                "pno": 5,
                "firstName": "Andrew",
                "personId": 6678,
                "shirtNumber": "8",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Sullivan",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 20,
                "firstName": "Sesan",
                "personId": 309075,
                "shirtNumber": "9",
                "playingPosition": "",
                "height": 0,
                "familyName": "Russell",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 6,
                "firstName": "Josh",
                "personId": 562587,
                "shirtNumber": "10",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Ward-Hibbert",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 8,
                "firstName": "Harrison",
                "personId": 8540,
                "shirtNumber": "12",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Gamble",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 9,
                "firstName": "Conner",
                "personId": 6813,
                "shirtNumber": "13",
                "playingPosition": "PG",
                "height": 0,
                "familyName": "Washington",
                "starter": 0,
                "captain": 0
            }, {
                "active": 1,
                "pno": 11,
                "firstName": "Pierre",
                "personId": 54481,
                "shirtNumber": "15",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Hampton",
                "starter": 1,
                "captain": 0
            }, {
                "active": 0,
                "pno": 12,
                "firstName": "Eric",
                "personId": 424208,
                "shirtNumber": "22",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Robertson",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 13,
                "firstName": "Andrew",
                "personId": 6695,
                "shirtNumber": "31",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Thomson",
                "starter": 0,
                "captain": 0
            }, {
                "active": 1,
                "pno": 14,
                "firstName": "Taylor",
                "personId": 40287,
                "shirtNumber": "33",
                "playingPosition": "F",
                "height": 0,
                "familyName": "King",
                "starter": 1,
                "captain": 0
            }],
            "assistcoach2": {
                "firstName": "Mark",
                "personId": 8514,
                "familyName": "Jarram"
            },
            "assistcoach1": {
                "firstName": "Philip",
                "personId": 6756,
                "familyName": "Gleadell"
            },
            "teamNumber": 1,
            "coach": {
                "firstName": "Rob",
                "personId": 6670,
                "familyName": "Paternostro"
            },
            "detail": {
                "teamName": "Leicester Riders",
                "teamCode": "LEI",
                "teamNickname": "Riders",
                "teamId": 1081
            }
        }, {
            "players": [{
                "active": 0,
                "pno": 1,
                "firstName": "Christian",
                "personId": 248173,
                "shirtNumber": "1",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Behrens",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 2,
                "firstName": "Joe",
                "personId": 480493,
                "shirtNumber": "3",
                "playingPosition": "",
                "height": 0,
                "familyName": "Hart",
                "starter": 0,
                "captain": 0
            }, {
                "active": 1,
                "pno": 3,
                "firstName": "Deandre",
                "personId": 424212,
                "shirtNumber": "6",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Parks",
                "starter": 1,
                "captain": 0
            }, {
                "active": 0,
                "pno": 4,
                "firstName": "Danny",
                "personId": 94329,
                "shirtNumber": "8",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Horta-Darrington",
                "starter": 0,
                "captain": 0
            }, {
                "active": 1,
                "pno": 5,
                "firstName": "Darius",
                "personId": 6690,
                "shirtNumber": "13",
                "playingPosition": "C",
                "height": 0,
                "familyName": "Defoe",
                "starter": 1,
                "captain": 0
            }, {
                "active": 1,
                "pno": 6,
                "firstName": "Scott",
                "personId": 8570,
                "shirtNumber": "14",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Martin",
                "starter": 1,
                "captain": 0
            }, {
                "active": 1,
                "pno": 7,
                "firstName": "Fabulous",
                "personId": 6692,
                "shirtNumber": "20",
                "playingPosition": "G",
                "height": 0,
                "familyName": "Flournoy",
                "starter": 1,
                "captain": 0
            }, {
                "active": 0,
                "pno": 8,
                "firstName": "Andrew",
                "personId": 6808,
                "shirtNumber": "21",
                "playingPosition": "SG",
                "height": 0,
                "familyName": "Lasker",
                "starter": 0,
                "captain": 0
            }, {
                "active": 0,
                "pno": 9,
                "firstName": "Orlan",
                "personId": 263652,
                "shirtNumber": "23",
                "playingPosition": "F",
                "height": 0,
                "familyName": "Jackman",
                "starter": 0,
                "captain": 0
            }, {
                "active": 1,
                "pno": 10,
                "firstName": "Rahmon",
                "personId": 8653,
                "shirtNumber": "44",
                "playingPosition": "PG",
                "height": 0,
                "familyName": "Fletcher",
                "starter": 1,
                "captain": 1
            }],
            "assistcoach2": {
                "firstName": "Ian",
                "personId": 8724,
                "familyName": "Macleod"
            },
            "assistcoach1": {
                "firstName": "David",
                "personId": 6759,
                "familyName": "Forrester"
            },
            "teamNumber": 2,
            "coach": {
                "firstName": "Fabulous",
                "personId": 6692,
                "familyName": "Flournoy"
            },
            "detail": {
                "teamName": "Esh Group Eagles Newcastle",
                "teamCode": "NEW",
                "teamNickname": "Eagles",
                "teamId": 1084
            }
        }],
        "type": "teams"
    }
}

officials

This message type contains information about the match officials assigned to the match. This message type is only needed it there is information about match officials that needs to be sent.
  type enum

The type of the message

officials
  messageId integer

Unique identifier of the message being sent

commissioner associativearray

DEPRECATED. Use matchOfficials property instead

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

externalId string(50)

A unique ID for this person set by the owner of this league.

referee1 associativearray

DEPRECATED. Use matchOfficials property instead

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

externalId string(50)

A unique ID for this person set by the owner of this league.

referee2 associativearray

DEPRECATED. Use matchOfficials property instead

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

externalId string(50)

A unique ID for this person set by the owner of this league.

referee3 associativearray

DEPRECATED. Use matchOfficials property instead

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

externalId string(50)

A unique ID for this person set by the owner of this league.

technicaldelegate associativearray

DEPRECATED. Use matchOfficials property instead

personId integer

Unique identifier for the person

familyName string(50)

The family name of the person

firstName string(50)

The first name of the person

externalId string(50)

A unique ID for this person set by the owner of this league.

matchOfficials array

A list of match officials

firstName string(100)

The first name of the official

familyName string(100)

The family name of the official

shirtNumber string(30)

Shirt number

personId integer

Unique id of the person

  officialType enum

Official Type

CAPTAIN
Captain
VICE_CAPTAIN
Vice Captain
HEAD_COACH
Head Coach
COACH
Coach
ASSISTANT_COACH
Assistant Coach
REFEREE
Referee
ASSISTANT_REFEREE
Assistant Referee
RESERVE_REFEREE
Reserve Referee
RESERVE_ASSISTANT_REFEREE
Reserve Assistant Referee
TEAM
Team
MEDICAL_STAFF
Medical Staff
MATCH_OFFICIAL
Match Official
COMMISSIONER
Commissioner
STATISTICIAN
Statistician
SCOREKEEPER
Scorekeeper
ASSISTANT_SCOREKEEPER
Assistant Scorekeeper
TIMEKEEPER
Timekeeper
VIDEO_OPERATOR
Video Operator
UMPIRE
Umpire
CREW_CHIEF
Crew Chief
TECHNICAL_DELEGATE
Technical Delegate
statisticians array

An array of statisticians

firstName string(100)

The first name of the statistician

familyName string(100)

The family name of the statistician

statisticianId integer

The unique id given to this statistician

statisticianType enum

The job the statistician is performing for this match

OPERATOR
The person entering the statistics
CALLER
The person calling the statistics

Example

{
    "message": {
        "messageId": 3,
        "referee2": {
            "firstName": "John",
            "personId": 1244,
            "familyName": "Smith",
            "name": "John Smith"
        },
        "referee1": {
            "firstName": "Mary",
            "personId": 4252,
            "familyName": "Johnson",
            "name": "Mary Johnson"
        },
        "statisticians": [{
            "firstName": "GERALDINE",
            "familyName": "FRENCH",
            "statisticianId": 393492,
            "statisticianType": "OPERATOR"
        }],
        "type": "officials"
    }
}

action

This message type contains an individual game action.

Actions come in two types, adminstrative or sport. A sport type action is related to the sport aspect of the match, eg substitution or foul. An administrative type action is related to the process or publishing the game eg. period confirmed. Only sport type actions are given an actionNumber. The action number is a sequential integer that should uniquely refer to that action. The actionNumber is repeated to indicate an edit or delete on the original action.

  type enum

The type of the message

action
  messageId integer

Unique identifier of the message being sent

actionNumber integer

Unique sequence number for this action

teamNumber integer

The number of the team in the match, 1 or 2.

pno integer

The number of the player in the match. This is a sequence number not a jersey number.

  clock string

The time on the clock when this action occurred.

Format is: MM:SS:CC
shotClock string

The time on the shot clock when this action occurred.

Format is: MM:SS:CC
  timeActual datetime

The date/time when this action occurred in UTC.

Format is: YYYY-MM-DD HH:MM:SS
  period integer

What period of the match is this statistic related to. 0 is valid and represents the value for the total match. Overtime periods should start at 1.

  periodType enum

The type of period

REGULAR
(Default)
OVERTIME
  actionType string(20)

A code representating the action type. See Action Types for the list of options.

success enum

Was this action completed successfully? Generally all actions except scoring actions are successful.

1
Yes (Default)
0
No
subType string(20)

The subordinate type of the action. Used to further define the action. See Action Types for the list of options.

qualifiers array

An array of qualifiers to the action. See Action Types for the list of options. If the qualfier has a value that is being sent, then the qualifier name and value are separated by ':'. eg. ["from:head","freekick","goalmouth:lowleft"]

value string(1000)

A text field. Some action types require a value. This is where that value will be placed. See Action Types for the list of actions that require this field.

previousAction integer

The actionNumber of the base/primary action if this action relates to another action. eg. For a freethrow/freekick, this may be the actionNumber of the original foul.

officialId integer

The unique identifier for the official calling the action

x float

X coordinate on the playing surface where the action occurred. Defined in Playing Surface Definition.

y float

Y coordinate on the playing surface where the action occurred. Defined in Playing Surface Definition.

area string

The area of the playing surface where the action occurred. Defined in Playing Surface Definition.

side enum

Indicates which side of the playing surface the player's/team's goal is.

(blank)
left
Team's goal is to the left
right
Team's goal is to the right
  score1 string

This field represents the current score for team number 1 after the completion of this action. Even if this action is an edit for a previous period, this should be the current score.

  score2 string

This field represents the current score for team number 2 after the completion of this action. Even if this action is an edit for a previous period, this should be the current score.

edited datetime

If the action has been edited (after being initially sent) this field contains the last time it was edited (in UTC). If the action has not been edited, then this field is not present.

Format is: YYYY-MM-DD HH:MM:SS
inserted datetime

If the action has been missed previously and inserted (added out of sequence) later this field contains the time it was inserted (in UTC). If the action has not been inserted or added out of sequence during active workflow then this field is not present.

Format is: YYYY-MM-DD HH:MM:SS
deleted datetime

If the action has been deleted (after being initially sent) this field contains the time it was deleted (in UTC). If the action has not been deleted, then this field is not present.

Format is: YYYY-MM-DD HH:MM:SS
sendDelay float

Optional field. May be added from the capture device to indicate a delay (in seconds) before the message was sent.

completionDelay float

Optional field. May be added from the capture device to indicate the time taken (in seconds) to complete the entering of the action.

system enum

If this value is set to 1 then it indicates that this action was automatically generated by the system and not explicitly performed by the user (value = 0). eg. A start period automatically creating a start clock action.

0
No (Default)
1
Yes
underReview enum

The action is not official as yet, it is being review by match officials or the organisation. This may occur in disputed actions or actions being checked by some kind of video.

0
No (Default)
1
Yes
orderNumber integer

Optional. A unique number identifiying the order of the action in the game. This number may not be sequential but will be unique. Sorting by this number will give the order of actions (and will account for edits and insertions). When assigning this number initially you should leave gaps (eg 100,200,300) to allow you to enter any inserted actions in their correct orderNumber sequence.

possible enum

Optional field. May be added to indicate the action is not confirmed yet and do not affect any statistics. Require permission to retrieve possible actions from Streaming API.

0
No (Default)
1
Yes

Example

{
    "message": {
        "pno": 8,
        "period": 4,
        "actionNumber": 703,
        "sendDelay": 0.084,
        "success": 0,
        "previousAction": 0,
        "messageId": 910,
        "periodType": "REGULAR",
        "score2": "79",
        "score1": "85",
        "y": 9.524,
        "x": 21.494,
        "subType": "",
        "qualifiers": [],
        "timeActual": "2017-04-19 20:16:33",
        "completionDelay": 1.317,
        "shotClock": "00:00:00",
        "edited": "2017-04-19 20:16:35",
        "teamNumber": 2,
        "type": "action",
        "side": "left",
        "clock": "00:15:36",
        "area": "outsideleft",
        "actionType": "3pt",
        "system": 1
    }
}

summary

This message type has information about the how the match was run. Usually it will only be sent once at the end of the match.
  type enum

The type of the message

summary
  messageId integer

Unique identifier of the message being sent

  timeActual datetime

The actual start date/time of the match in the UTC timezone

Format is: YYYY-MM-DD HH:MM:SS
  timeEndActual datetime

The actual end date/time of the match in the UTC timezone

Format is: YYYY-MM-DD HH:MM:SS or Unfinished
duration integer

The duration (in minutes) of the match, excluding any pregame activities

durationActual integer

The actual duration of the match (mins) including timeouts, stoppages and period breaks.

temperature integer

The temperature during the match (degrees Celsius)

hasFlaggedActions enum

Indication if match has game actions that need to be fixed

0
No (Default)
1
Yes
attendance integer

The number of people who attended the match

Example

{
    "durationActual": 97,
    "timeEndActual": "2017-03-05 14:38:01",
    "messageId": 923,
    "timeActual": "2017-03-05 13:01:11",
    "duration": 40,
    "attendance": 250,
    "temperature": 25,
    "hasFlaggedActions": 0,
    "type": "summary"
}

disconnect

The client should send this message to the server to notify it that it is explicitly ending its connection.
  type enum

The type of the message

disconnect
  reason enum

The reason for the disconnection

USER_INITIATED
The user initiated the disconnection (eg. pressing a disconnect button)
MATCH_COMPLETE
The match is complete
NO_HEARTBEAT
There was no heartbeat response from the server
OTHER
Another reason
description string

A description of the reason for the disconnection

Example

{
    "messageId": 923,
    "type": "disconnect",
    "reason": "USER_INITIATED",
    "description" : "User pressed disconnect"
}

Action Types

Sport Action Types

If qualifiers are able to be used for a particular action/subType, then any number of qualifiers may be applied to the action.

If the subType indicates (blank) this means that the action can be used without a subType.

type subType qualifiers  
game      
  start    
  end
  • confirmed
 
period      
  start    
  end
  • confirmed
 
comment     Comment text should be passed in the value field
toss      
  won    
  lost    
1pt   Applies to all 1pt subTypes:
  • 2ndchance
  • fromturnover
  • defensivegoaltending
 
  (blank)    
  dunk    
  layup    
  fadeaway    
  tipin    
  jumpshot    
  alleyoop    
2pt   Applies to all 2pt subTypes:
  • 2ndchance
  • defensivegoaltending
  • fromturnover
 
freethrow   Applies to all freethrow subTypes:
  • 2ndchance
  • fromturnover
 
  1of1    
  1of2    
  2of2    
jumpball      
  (blank)    
  unclearpass    
  lodgedball    
  heldball    
  doubleviolation    
  won    
  lost    
assist      
block      
rebound   Applies to all subTypes:
  • team
 
  defensive    
  offensive    
foul   Applies to all foul subTypes:
  • 1freethrow
  • 2freethrow
 
  offensive Applies to offensive subType:
  • block
  • charge
  • offtheball
 
  personal Applies to all personal foul subType:
  • shooting
  • clearpath
  • looseball
  • blocking
  • offtheball
 
  technical Applies to technical subType:
  • defensive
  • delayofgame
  • double
 
  unsportsmanlike    
  disqualifying    
foulon      
timeout      
  full    
  officials Applies to official subType:
  • bloodrule
  • callreview
 
steal      
turnover   Applies to turnover subTypes:
  • 2ndchance
  • turnover
 
  (blank)    
  offensivegoaltending    
  ballhandling    
  badpass    
  outofbounds    
  travel    
  shotclock    
  offensive    
  3sec    
  5sec    
substitution      
  in    
  out    
bulksubstitution Applies to all subTypes:
  • players
  •  
  • players: send qualifiers as string |players:pno1,pno2,pno3|. ex. "players:3,4,5"
in
out
clock     (At some point in the future the clock messages will be made administrative only)
  start    
  stop    
  adjustment
  • second_plus
  • second_minus
  • minute_plus
  • minute_minus
The number of seconds adjustment should be passed in the value field. Negative values are allowed
participated Applies to all subTypes:
  • players
  •  
  • players: send qualifiers as string |players:pno1,pno2,pno3|. ex. players:3,4,5;

Administrative Action Types

type subType qualifiers  
status     Indicates a change in the status of the match
  delayed   The start time of the match has been changed. The delay in minutes should be passed in the value field. Negative delays are allowed (to indicate early start).
  loaded   The match has been loaded in the software
  ready   The match is ready to proceed in the software and the teams have been loaded
  inprogress   The match is currently in progress
  periodbreak   The match is currently in progress, but in a break between periods
  interrupted
  • equipment
  • venue
  • weather
  • spectator
  • medical
  • prevgame
  • teamlate
  • early
The match has been stopped temporarily and will resume after a delay. The delay in minutes should be passed in the value field. The qualifiers can be used to give a reason for the delay.
  cancelled   The match will not be started
  abandoned   The match has been stopped and will not restart
  rescheduled   The match has been stopped (or has not started) and will not start/restart. It will be played again at another time.
  finished   The match has come to the end
  protested   The match has come to the end, but the result has been protested
  complete   The match is complete, all scores have been confirmed and result is official
periodstatus     Indicates a change in the period status
  pending   Indicates the period is about to start
  started   Indicates the period has started
  ended   Indicates the period has ended
  confirmed   Indicates that scores have been confirmed for the period
shotclock      
  adjustment
  • kickedball
  • foul
The number of seconds adjustment should be passed in the value field. Negative values are allowed
possessionchange      
possessionarrowchange      
capturestatus      
  unreliable   Indicates that the state of the game being sent by the software differs significantly from the actual situation.
  reliable   Indicates that the state of the game being sent by the software now matches the actual situation.
risk (empty)
  • goal
  • cardyellow
  • var
  • cardred
  • penalty
 

Playing Surface Definitions

Coordinates

area, x, y and side are defined based upon the diagram below.

x and y are defined as percentage measurments of the total width and height of the 3x3 basketball court. The origin (0,0) is the bottom left corner of the image meaning the top right point is (100,100).

Example:
A FIBA Standard Basketball Court length is 11m and the 2pt line is at 6.75m
Therefore the x coordinate of the 2pt line = 6.75/11 * 100 = 61.36

Action Areas

area is defined by which of the defined boxes the player was in when the action occurred.

The value of area in reference to the diagram are as follows:

Number on diagram Value
1 underbasket
2 inthepaint
3 insiderightwing
4 insideright
5 insidecenter
6 insideleft
7 insideleftwing
8 outsiderightwing
9 outsideright
10 outsidecenter
11 outsideleft
12 outsideleftwing
13 backcourt