Arduino Sensor to Bubble API Endpoint

Hi there,

There have been some posts about this in the past, but not a answer.

Has anyone successfully hooked up their arduino to a bubble API endpoint? How did it go? I would like to do this with the ESP8266 Wifi development board.

If so, would you care to share screenshots. If not, would anyone like to work with me on a guide that could benefit the forum?


1 Like

I have worked on this before but with a NucleoBoard to other endpoints not Bubble using the ESP8266.I will give it a try when I get time to see if it will hit successfully and if it does then definately it will with your Arduino Board. Using the ThingsNetwork also woked as an alternative when using LoRa Network

1 Like

@asger.hansen check this one out.

To work.

  1. Make the endpoint public etc image
  2. Select Detect Data for for parameter definition image
    3)Click on “Detect data” and copy URL to the Arduino Code as is in the tutorial link I provided
  3. Initiate Arduino to send data and have bubble capture the data
  4. Use data sent to create a thing etc

This is a rough Idea and I think it should work if the code provided in the link above actually work and hits an endpoint. I will gladly help out if need be but will need collaboration since I do not have an arduino Kit.


1 Like


I managed to make a very basic connection via https to an app. Here is the script i used, which is a generic one from Arduino IDEthat i modified slightly:

    HTTP over TLS (HTTPS) example sketch

    This example demonstrates how to use
    WiFiClientSecure class to access HTTPS API.
    We fetch and display the status of
    esp8266/Arduino project continuous integration

      only RSA certificates
      no support of Perfect Forward Secrecy (PFS)
      TLSv1.2 is supported since version 2.4.0-rc1

    Created by Ivan Grokhotkov, 2015.
    This example is in public domain.

#include <ESP8266WiFi.h>

// force use of AxTLS (BearSSL is now default)
#include <WiFiClientSecureAxTLS.h>
using namespace axTLS;

#ifndef STASSID
#define STASSID ""
#define STAPSK  ""

const char* ssid = STASSID;
const char* password = STAPSK;

const char* host = "";
const int httpsPort = 443;

void setup() {
  Serial.print("connecting to ");
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
  Serial.println("WiFi connected");
  Serial.println("IP address: ");

  // Use WiFiClientSecure class to create TLS connection
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored  "-Wdeprecated-declarations"
  WiFiClientSecure client;
#pragma GCC diagnostic pop
  Serial.print("connecting to ");
  if (!client.connect(host, httpsPort)) {
    Serial.println("connection failed");

  String url = "/version-test/api/1.1/wf/esp8266";
  Serial.print("requesting URL: ");

  client.print(String("POST ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Authorization: Bearer 756490c40b8f6585a297c98b4d7385dd\r\n" +
               "key1: test " + "\r\n" +
               "User-Agent: BuildFailureDetectorESP8266\r\n" +
               "Connection: close\r\n\r\n"
  Serial.println("request sent");
  while (client.connected()) {
    String line = client.readStringUntil('\n');
    if (line == "\r") {
      Serial.println("headers received");
  String line = client.readStringUntil('\n');
  if (line.startsWith("{\"state\":\"success\"")) {
    Serial.println("esp8266/Arduino CI successfull!");
  } else {
    Serial.println("esp8266/Arduino CI has failed");
  Serial.println("reply was:");
  Serial.println("closing connection");

void loop() {

I created an app just for testing, and it actually works. I hooked it up to the endpoint like you said and send an email whenever there is a post request:

here is the API endpoint in bubble:

However, i would like to send data in the POST request as well, but am not sure how to add that in the header?

Another concern i have is adding authorization. I am not good enough at C/C++ yet. But do you maybe know how to?

Here is a picture of my setup right now, powered by a AA battery pack (judge all you want :grinning: :grinning:)


@asger.hansen check this out

Remember for Bubble to capture the body fields you will need to use “detect request data” on parameter definition and then click on button “Detect data” . A pop up will appear with a link to paste to your arduino code.

Make one https request to the server and bubble will capture the data fields

Hey @koechamos51

i tried out the link you sent, but couldnt get the request to work, i am stuck with the code i posted above. According to bubble documentation data needs to be sent in json format:

However, i dont see a description on how to send it when it is for a workflow post request? Should i be like when you create a new thing or the format used to create a bulk upload?

Also, i dont know how to include the data in the post request in the code above in json format.