灵活数据交换
简介
Flexible data exchange is the recommended HTTP integration method when it is not possible to modify the data format sent by the device.
Flexible data exchange supports only Uplink messages. Uplink messages are all those sent from devices to the platform. The platform must be able to process uplink messages to store the relevant information and process it. This is achieved using scripting to interpret message content and store the information on the platform.
It is not possible to send Downlink messages (i.e., from the platform to the device) using flexible HTTP data exchange.
步骤 to Follow
Configuring the Data Upload URL
For the platform to receive device data, you need to configure the device to POST HTTP messages to the following URL:
https://gear.cloud.studio/api/v2/uplink/{DeviceAddress}W此处:
- DeviceAddress is the device address, as 输入ed when creating the device on the platform.
For example, if the device address is 06A022B39C14, then the device should be configured to POST to the following URL:
https://gear.cloud.studio/api/v2/uplink/06A022B39C14Configuring the 访问令牌
The 访问令牌 must also be sent as part of the header, using an Authorization header, as shown 下方:
Authorization: Bearer e54e0911-ece3-4b7a-b84d-afc01dfa81f1Alternatively, when it is not possible to send the token through the Authorization header, the 访问令牌 can be sent as part of the URL via the "accessToken" parameter, as in the following example:
https://gear.cloud.studio/api/v2/uplink/06A022B39C14?accessToken=e54e0911-ece3-4b7a-b84d-afc01dfa81f1Once these steps are completed, the platform will begin receiving and processing device information. If the device uses a model not natively supported by the platform, you will also need to define the data processing scripts, as described in this section.
HTTP
简介 本节 describes integration with the Gear Studio platform using HTTP. This functionality is designed to allow integration with devices from a variety of manufacturers, as well as custom-built devices with Arduino, nodeMCU, Raspberry Pi, and any other platform that supports HTTP communication.
HTTP API
简介 HTTP API: The HTTP API allows devices to communicate with the platform using a specific message format, documented in the following sections, which enables...