Links

HTTP API

Introduction

The HTTP API is the most suitable method for sending data to a W3bstream project when the data publisher is a server, mobile client, or smart device as these are typically always connected and not constrained in terms of data volume or bandwidth.

Authentication

Please refer to the Client Authentication Patterns section.

Finding your Project's HTTP route

Before sending data to a specific project in W3bstream using the HTTP API, you will need to obtain the HTTP route of the project. You can find this information in W3bstream Studio on the Project's 'Events' page.

Data API

Sending from an individual publisher

post
https://devnet-prod-api.w3bstream.com/event/
<PROJECT_NAME>
Send Data to a W3bstream Project
Example Request
URL
Header
{ Authentication: Bearer w3b_MV8 ... I8Jg}
Body
{
Temperature: 24.3,
Latitude: 118.65789
Longitude: 94.223321
}
Response
{
"channel": "eth_0x2c37a2cbcfaccdd0625b4e3151d6260149ee866b_energy_sharing",
"publisherID": "1038110072263586821",
"publisherKey": "001",
"eventID": "31fed038-8f10-48d5-958e-f9131754c85b_w3b",
"timestamp": 1695401468899,
"results": [
{
"appletName": "299519632338498561",
"instanceID": "299519632338509832",
"handler": "start",
"returnValue": null,
"code": 0
}
]
}

Sending on behalf of publishers

post
https://devnet-prod-api.w3bstream.com/event/
<PROJECT_NAME>
Send Data to a W3bstream Project
Example Request
URL
Header
{ Authentication: Bearer w3b_MV8 ... I8Jg}
Body
[
{
Temperature: 24.3,
Latitude: 118.65789
Longitude: 94.223321
},
{
Temperature: 21.3,
Latitude: 102.12345
Longitude: 94.223321
},
]
Response
{
"channel": "eth_0x2c37a2cbcfaccdd0625b4e3151d6260149ee866b_energy_sharing",
"publisherID": "1038110072263586821",
"publisherKey": "001",
"eventID": "31fed038-8f10-48d5-958e-f9131754c85b_w3b",
"timestamp": 1695401468899,
"results": [
{
"appletName": "299519632338498561",
"instanceID": "299519632338509832",
"handler": "start",
"returnValue": null,
"code": 0
}
]
}