What’s changed?

You now have more choices about how your device communicates with IoT Foundation.  When publishing messages to IoT Foundation you can use:

  • MQTT
  • MQTT over WebSockets
  • HTTPNew!

Why might you want to use it?

MQTT is a great protocol for the Internet of Things and offers reliable and lightweight communication.  But, as a device developer, sometimes you find you’re constrained by the libraries available in a particular environment, or existing code.  Your device might be trapped behind a firewall which only allows communication over port 80.  
The widespread availability of HTTP client support means that almost any device can now easily publish data into the Internet of Things Foundation.

How do I get started?

Get started quickly with our HTTP recipe

If you want to try out this support but haven’t signed up and created an organization then you can use the Quickstart service.  Quickstart supports HTTP without security to allow you to quickly try things out. 

See the full documentation for HTTP/S support.

How is it secured?

HTTP events are secured using TLS and sent over HTTPS.  Unsecured HTTP is only supported for Quickstart.  All communication with registered organizations must be secured.
To send events to registered organizations, the HTTP/S request must have an Authorization header.

Username and password are dealt with in this way:
For Devices:

  • There is only one valid username “use-token-auth” for any device. This username indicates that the password field will contain the authentication token.
  • The password should be the authentication token for the device.

In an HTTP/S request, a Content-Type request header must be provided. Only the following values are currently supported, and mapped to the Internet of Things Foundation event formats.

Content-Type Header Volume IoT Foundation Format
text/plain text
application/json json
application/html xml
application/octet-stream bin

Use HTTP/S POST to this URL:
<target server: org_id.internetofthings.ibmcloud.com>/api/v0002/device/types/{DeviceType}/devices/{DeviceID}/events/{eventID}

Request body = event payload

Join The Discussion

Your email address will not be published. Required fields are marked *