Publish data to Platform
We will use a simple tool Postman app as a simulated device to publish data to West Connectivity
Prerequisite
- Go through Provision the device and Define the data format to create a device and resource
- Install the Postman app
- Add a collection and add a request using Postman app
Publish data
On Connector page, copy the connector URL by click link icon.
The data publish API of HTTP is /api:v1/stack/alias
The full request URL should be <connector URL>//api:v1/stack/alias
,
(ex: https://u1iak1nbjna000000.m2.iot.westpharma.com/api:v1/stack/alias).
Fill in the request URL on Postman app and choose request method "POST".
Add a header with value Authorization: Token <device-credential>
Note
The device-credential
is the credential you got following Provision the device
Add a x-www-form-urlencoded argument named "temperature" with value "33" in Body.
Click Send
button, you would receive a response code 204 representing the data has been published on platform.
You also can check the data on device page.
Next: You can Review and retrieve the data