# Tutorial And Examples

This section will step you through a simple method of testing the API and provide example values to the various parameters.

# Setup

Go to the website https://webhook.site (opens new window). This is a free webhook tester that provides visualization for the uplink and downlink messages. Click on the “New URL” button and then “Create”. This creates a unique URL that can be used to post uplink messages. An example URL might look something like this:

Webhook setup

Go back to the Radio Bridge Console and click on the API tab. In the Uplink URL field, enter the URL generated in the last section. In the authorization field, enter any value your application will use for authorization. In this case, simply enter “1234” and click Update.

Send a message from a Radio Bridge sensor and observe the data arriving at the webhook tester as shown below:

Uplink Webhook Tester

The sample data received in this example is shown in the following table.

Table 13: Uplink Example Parameters

Parameter Description
deviceId 3E5FBB
deviceName Steve’s dual push button
deviceType Wireless Dual Push Button - RBS104-2
sensorSeqNumber 1
eventType PUSH_BUTTON
eventDescription Button 2 Pressed
eventTime {“date”:”2018-12-06 18:20:07.000000”, “timezone_type”:”3”,”timezone”:”UTC”}
snr 6
rssi -113
rawBytes 11060200

We will send a downlink message: 0600040000000000 which indicates it is a dual push button device (06) with a hold time of 1 second (04) on button 1. Note that there must always be 8 bytes in a downlink message so we add zeros to the end of the message if no parameters are defined for those bytes.

Go to https://apitester.com (opens new window), select POST, and enter the request string with the device EUI and downlink payload as shown in the example below:

API Tester Request

Scroll down to Response Body and you should see the following JSON response:

{
  "status": true,
  "message": "Event has been added in queue, device will be configured when that wakes up."
}

Back in the Radio Bridge Console, navigate to the Device EUI and the following will be shown under the configuration section:

API Tester Response

The downlink payload is queued and will be sent to the sensor.