HTTP request and response - BWS500 - BWS Cloud Companion

BWS Cloud Companion API Reference

Document code
M212639EN
Revision
E
Language
English
Product
BWS500
BWS Cloud Companion
Document type
User guide

The 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=U1840274&k=99aace683508494f9cf37acad32bdb38&t0=2022-06-09T09:42:50.936&t1=2022-06-10T09:42:50.936&s=WXT530-U1740774
Table 1. Request parameters
Name Value Example Description
d Serial number of gateway U1840274 Serial number of the gateway device.
s Sensor WXT530-U1740774 Sensor attached to gateway device.
k API key 99aace683508494f9cf37acad32bdb38

Device specific API key. Needs to be generated from the BWS Cloud Companion application to be able to use the API.

t0 Start timestamp in UTC time 2022-06-09T09:42:50.936

Start timestamp in ISO 8601 format.

Time must be UTC time.

t1 Stop timestamp in UTC time 2022-06-10T09:42:50.936

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>Keilaranta Marina</name>
        <serial>U1840274</serial>
        <description></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>2022-06-09T09:43</timestamp>
            <type>Relative humidity</type>
            <value>83.7</value>
        </meas>
        <meas>
            <timestamp>2022-06-09T09:43</timestamp>
            <type>Air pressure</type>
            <value>1009.7</value>
        </meas>
        <meas>
            <timestamp>2022-06-09T09:43</timestamp>
            <type>Wind speed</type>
            <value>5.7</value>
        </meas>
    </measurements>
</envitemsdata>

If authentication fails, the API returns the following:

<error>Access denied!</error>