HTTP request and response - Wx Beacon - BWS500

Wx Beacon API Reference

Document code
M212639EN
Revision
C
Language
English (United States)
Product
Wx Beacon
BWS500
Document type
User guide

The XML API supports only HTTP GET. There is also a limitation that a user can fetch a maximum of 100 000 measurements with a single request. If more requests are needed, then subsequent requests need to be made.

The following is a cURL example of making a request with GET:

curl https://wxbeacon.vaisala.com/api/xml?d=R1234567&s=WXT536-S1234567&k=752cdd06eb1c412cb26abeb2164b980f&t0=2020-12-29T00:00:00&t1=2020-12-29T00:01:00&c=100
Table 1. Request parameters
Name Value Example Description
d Serial number of gateway R1234567 Serial number of the gateway device.
s Sensor WXT536-S1234567 Sensor attached to gateway device.
k API key 752cdd06ed1c412cb26abeb2164b980f

Device specific API key. Needs to be generated from the Wx Beacon application to be able to use the API.

t0 Start timestamp in UTC time 2020-12-29T00:00:00

Start timestamp in ISO 8601 format.

Time must be UTC time.

t1 Stop timestamp in UTC time 2020-12-29T12:00:00

End timestamp in ISO 8601 format.

Time must be UTC time.

c (optional) Max count 1000

Parameter to restrict the amount of measurements retrieved.

Default value: 100 000.

Example response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<envitemsdata>
    <device>
        <name>Laaksolahti</name>
        <serial>R1234567</serial>
        <description>EGW501 in Laaksolahti</description>
        <location></location>
        <lat xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
        <lon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
        <alt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
    </device>
    <measurements>
        <meas>
            <timestamp>2020-12-29T00:00</timestamp>
            <type>Air temperature</type>
            <value>0.4</value>
        </meas>
        <meas>
            <timestamp>2020-12-29T00:00</timestamp>
            <type>Air humidity</type>
            <value>91.5</value>
        </meas>
        <meas>
            <timestamp>2020-12-29T00:00</timestamp>
            <type>Air pressure</type>
            <value>1004.1</value>
        </meas>
    </measurements>
</envitemsdata>

If authentication fails, the XML API returns the following:

<error>Access denied!</error>