Child pages
  • BRP Websocket
Skip to end of metadata
Go to start of metadata

Requirement

  • Tomcat-7.0.52+ and Tomcat-8.0.1.1+
  • Java 7 and later

Protocol

  • We use STOMP v1.1 (STOMP specification v1.1) for sending data through websocket.
  • If you have trouble finding a suitable library that speaks STOMP over a websocket it is fairly easy to implement relevant parts of STOMP "by hand"
  • Keep in mind that every stomp frame has to be terminated by two newlines and a null character U+0000 denoted \n\n^@

Authentication

At the moment no authentication is required.

Connection

Connect websocket to BRPGOG_BASE_URL/stomp/websocket or and send:

 

Connect
CONNECT\n\n^@

 

Messages to subscribe to

WorkOut message

WorkOut message is sent each time a person is registered for a work out.

Subscribe
SUBSCRIBE
id:any_client_id
destination:/topic/workout/record\n\n^@ 
Message
MESSAGE 
content-type:application/json;charset=UTF-8 
subscription:any_client_id 
destination:/topic/workout/record 
 
{
  "workout": {
    "id" : 4711,
    "person_id": 1234,
    "activity_id" : null,
    "product_id" : null,
    "product_name" : null,
    "businessunit_id" : 160,
    "businessunit_name": "Our training center",
    "date" : "2016-02-18T07:44:56.151Z"
  }
}
 
\n\n^@ 

Value

Format

Description

id

Number

Id of WorkOut

person_id

Number

Id of Person

activity_id

Number or Null

Id of Activity. Will only be set if the WorkOut is connected to a GroupActivity booking.

product_id

Number or Null

Id of Product. Will only be set if the WorkOut is connected to a GroupActivity booking.

product_name

String or Null

Name of Product. Will only be set if the WorkOut is connected to a GroupActivity booking.

businessunit_idNumberId of business unit
businessunit_nameStringName of business unit

date

YYYY-MM-DDThh:mm:ss.sssZ

Date and time of the WorkOut. In UTC time zone.

Booked From Waitinglist message

The BookedFromWaitinglist message is sent when a customer is moved from the waiting list of a group activity and gets properly booked.

Subscribe
SUBSCRIBE
id:any_client_id
destination:/topic/bookedfromwaitinglist\n\n^@
Message
MESSAGE 
content-type:application/json;charset=UTF-8 
subscription:any_client_id 
destination:/topic/bookedfromwaitinglist
 
{
  "groupactivitybooking": {
    "id" : 4711,
    "start" : "2016-02-18T07:44:56.151Z",
    "caption" : "Zumba",
    "activity_id" : 325,
    "person_id": 1234,
    "businessunit_id" : 160,
    "businessunit_name": "Our training center"
  }
}\n\n^@ 

Value

Format

Description

id

Number

Id of GroupActivityBooking (The customers booking at the group activity)

person_id

Number

Id of Person

activity_id

Number or Null

Id of the group activity instance

caption

String

Name of Product. .

businessunit_idNumberId of business unit
businessunit_nameStringName of business unit

start

YYYY-MM-DDThh:mm:ss.sssZ

Date and time of the group activity. In UTC time zone.

  • No labels