HTTP Data Converter

HTTP Data Converter provides an endpoint that devices can use to send HTTP requests with any method, headers, and body. A user-defined script determines the authentication method (using either the device’s Blynk Auth Token or a metadata value). It can then update its datastreams, log events, and access existing datastream values. The script may also return a custom HTTP response that is passed back to the device.

Each HTTP Data Converter receives its own unique endpoint, identified by a token in the URL path. An example endpoint would look like:

https://blynk.cloud/converter/ic1B-u8eoux39BLoKfIap1LTj62uqZQv

This token is used to identify which converter should handle the request. Devices can send requests to this endpoint using any HTTP method, include arbitrary query parameters or URL fragments, and may use either HTTPS or plain HTTP. The converter script will receive the request and can parse all parts of the URL, headers, and body as needed.

Examples

Using Blynk Auth Token Authentication

Using Metadata Authentication

Parsing JSON body and updating DataStream values

Logging an Event

Handling Authentication and Incorrect Method Errors

Return a binary body

TypeScript declaration

Last updated

Was this helpful?