-
Notifications
You must be signed in to change notification settings - Fork 12
HTTP API for bHaptics Player (Windows only)
By enabling the option, you can use HTTP requests which can fetch data from the bHaptics' Player, such as all of the paired devices as well as information about each device, such as the connection status and battery status. You can also make function calls to each device, to pair, unpair, ping, and enable/disable each device.
Some example calls using this interface: to poll for the device information the interface sends a request to http://localhost:15881/v1/api/devices, while to ping a device it calls http://localhost:15881/v1/api/ping?id=273463469948831. We use the localhost for our tests, as we test on the same computer, but by changing to the IP of the connected PCs this call will allow you to get the info from each remote computer directly. For the actions calls, such as ping, pair, and unpair, the id of the device is passed so that the action is applied to that specific device.
An example web user interface we used to test at this link, however the web-ui currently only runs on Google Chrome and isn't supported by other browsers.
- Request
http://localhost:15881/v1/api/devices
- Expected Response
[{"paired":true,"id":"263687056127014","enabled":true,"connected":"Disconnected","name":"Tactot3_V1.1","battery":-1,"positionType":"Vest"}]
- Request
http://localhost:15881/v1/api/pair?id={}
- Request
http://localhost:15881/v1/api/unpair?id={}
- Request
http://localhost:15881/v1/api/ping?id={}
- Request
http://localhost:15881/v1/api/unpairAll
-
Supported from bhaptics player 1.6.0
-
Request
http://localhost:15881/v1/api/audio-to-haptic/configurations
- Response
[
{"id":"c4c44fba-be6d-bc35-7580-ecbf2d1f4355","name":"Pop"},
{"id":"9bc87dec-56c5-f116-f199-aea369040127","name":"Bass"},
{"id":"15e0e6c7-ee75-c52b-7893-249b96186d51","name":"PUBG"},
{"id":"b3feb930-6b3c-f6ee-a892-760c9f915d22","name":"OVERWATCH"},
{"id":"4ea8a539-4dd7-3e14-9f00-7c44c625b0dc","name":"RainbowSix"},
{"id":"f4c36cfc-7386-9107-c6f6-3d13e2fd8353","name":"CounterStrike"},
...]
-
Supported from bhaptics player 1.6.0
-
conf-index is optional parameter and you can select the configuration of audio-to-haptic. If you want to select
Beat Saber
, for example, you can setconf-index=8
-
Request
http://localhost:15881/v1/api/audio-to-haptic/on?conf-index={index-of-conf}
- Response
success
-
Supported from bhaptics player 1.6.0
-
Request
http://localhost:15881/v1/api/audio-to-haptic/off
- Response
success
-
Supported from bhaptics player 1.6.0
-
Request
http://localhost:15881/v1/api/enable?id={}
http://localhost:15881/v1/api/disable?id={}