Ubidots Integration: Getting Data on Dashboard via Webhooks

Hey everyone,

I’ve been trying to set up a connection between my Particle device (Argon and Photon2) and Ubidots dashboard using webhooks, but I’m encountering some issues. Despite following the guides provided by Ubidots, I can’t seem to get any data to show up on my dashboard.

Here’s what I’ve done so far:

  • Created webhooks on Particle integration as per the instructions.
  • Configured the webhook URLs, request type, and JSON data.
  • Verified device setup on Particle and assigned variables correctly.
  • Created a new dashboard on Ubidots with the necessary data sources and variables.
  • Ensured that the Particle device is sending analog values.

However, despite all this, I’m still not seeing any data updates on my Ubidots dashboard. I even tried deleting the demo device and dashboard and starting fresh with a mini dashboard, but no luck. Since I have redo the dashboard I have to wait till ubidots receive data to have a device showned.

Has anyone else experienced similar issues with Particle-Ubidots integration? Any tips or troubleshooting steps you can suggest? I’d appreciate any help or insights you can provide!

Also here is the exemple code :

 // This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>

// This example sends data to a variable to
// Ubidots using Particle Webhooks.

const char *WEBHOOK_NAME = "Ubidots";
Ubidots ubidots("webhook", UBI_PARTICLE);


void setup()
{
    Serial.begin(115200);
    //ubidots.setDebug(true); // Uncomment this line for printing debug messages
}

void loop()
{
    float value1 = analogRead(A0);
 
    ubidots.add("Variable_Name_One", value1); // Change for your variable name
    Particle.publish("Variable_Name_One", String(value1));

    bool bufferSent = false;

    bufferSent = ubidots.send(WEBHOOK_NAME, PUBLIC); // Will use particle webhooks to send data

    if (bufferSent)
    {
        // Do something if values were sent properly
        Particle.publish("Values sent by the device");
    }
    delay(30000);
}
 

Here is a screenshot with the device sending data to ubidots :


As you can see I’m only getting errors.

Also here is the configuration of the webhook :



Thanks in advance.

Hello @Nayel,

I hope this message finds you well.

Thank you for your detailed explanation. I would like to see how is the configuration of the Custom Body you’ve set in Particle.

Additionally, we need here 2 aspects:

  • Is there any way to obtain a HTTP request error directly in the Particle console? This kind of errors would give us more details about why you’re not receiving data in your account.
  • Could you please share with me the email or username of your Ubidots account?

I’ll be attentive to your response.

Alejandro

1 Like

Hi Alejandro,

Thanks for your message and your help.

So Here is what I have in terms of errors :

As for the configuration here is the screenshots :




Ubidots Account Information:

My username is Nacros115 and my email is Nkhouatra2@outlook.fr

Best regards,
Nayel

Hello @Nayel,

Could you kindly clarify where you obtained the X-Auth-Token? I’m verifying your account, and it seems I’m unable to locate that particular token. Upon reviewing your API Tokens, I noticed you have only one, and it differs from the token configured in the Webhook.

Furthermore, it appears this token is not a device token, as you haven’t configured any devices yet.

Hello alejomora7,

The email and username I provided belong to my first account. I attempted the procedure with two accounts, thinking that the issue might be related to the account.(nacros11-nkhouatra4@gmail.com)

Regarding the image you shared, I used the token that you highlighted in red.

As for the device configuration, I’m unable to set it up. According to a Ubidots tutorial, in order for the device to appear, data must be sent via the device. Since I’m encountering an error, it’s expected that no device is currently visible.

Best regards,
Nayel

Hello @Nayel,

Got it, you’re using another account.

Regarding this error, I’m not sure why this message appears, maybe you can delete the headers and add them again, just to discard some errors.

Additionally, is there any way to obtain a Webhook response that gives us more details about the problem?

Hi @alejomora7,

Appreciate your patience. Since this is my first time working with Webhooks, I don’t have a definitive answer yet. I’m exploring various troubleshooting steps and seeking additional information to gain a better understanding of the issue.

For now I might say that’s deleting the header could be possible, but I haven’t try yet and also I don’t really know how to do it.

As for the response webhook, I don’t know what to put in there.

Best regards,
Nayel

Hello @Nayel,

Don’t worry about that. Have you explored this tutorial?

Maybe it could help you.

I’ll be attentive for your response.

Alejandro

Hi @alejomora7,

No I haven’t, I will try this right now, Thank you very much !

Best regards,
Nayel

Perfect @Nayel, I’ll be attentive.

Alejandro

Hi @alejomora7,

I did try the guide that you gave me but I have those errors :

I have use the code for creating a mesh between two particle devices :

// This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>

/****************************************
 * Include Libraries
 ****************************************/

#ifndef UBIDOTS_TOKEN
#define UBIDOTS_TOKEN "BBUS-PHrBOX6Z0ZW96DXVFkd4OfyvoFlfCd" //Put here your Ubidots TOKEN
#endif

Ubidots ubidots(UBIDOTS_TOKEN, UBI_INDUSTRIAL, UBI_MESH);

/****************************************
 * Auxiliar Functions
 ****************************************/

// Put here your auxiliar functions

/****************************************
 * Main Functions
 ****************************************/

void setup() {
  Serial.begin(115200);

  ubidots.setCloudProtocol(UBI_PARTICLE);

  // Uncomment this line for printing debug messages
  // ubidots.setDebug(true);
}

void loop() { 
    ubidots.meshLoop(); 
}

For the UBI_MESH error, I think it’s because I need to replace this name by an variable but I don’t really know.

Do you have an idea of what’s going on and what should I do next?
Thanks,

Best regards,
Nayel

I’m probably not going to offer anything great, but the original way you had it setup in the pictures in your first post look the same as mine. only difference I saw was that I had ‘enforce ssl’ checked off on the bottom. I can’t recall how I did this and was probably pulling stuff off the internet, so I can’t tell you why or how…hopefully it helps?

Call it out in code like this

Then value like you have:

1 Like

If I look at my particle->Intergrations->Edit integration->‘Custom Template’ here is what I have:

{
“name”: “Ubidots for ubidots.com”,
“event”: “Ubidots”,
“url”: “https://industrial.api.ubidots.com/api/v1.6/devices/{{{PARTICLE_DEVICE_ID}}}”,
“requestType”: “POST”,
“noDefaults”: false,
“rejectUnauthorized”: true,
“headers”: {
“X-Auth-Token”: “YourTokenHere”,
“Content-Type”: “application/json”
},
“body”: “{{{PARTICLE_EVENT_VALUE}}}”
}

1 Like

I think you have a ‘space’ in your webhook for Content-Type

I reproduced…

1 Like

Thanks @cwrisley for your great help. That “space” in the text field "Content-Type " is the better description for understanding the problem.

Please @Nayel let me know if it works for you with this change.

1 Like

Hi @alejomora7 and @alejomora7,

I think you’re right, I will try it right now,

Thanks a lot,

Regards,
Nayel

You’re welcome!

1 Like

Hi @alejomora7 and @cwrisley,

It’s working !


Thanks you very much for your help !
Best regards,
Nayel

Great news!

1 Like