[SOLVED] Webhook, no pretty text, doesnt go through (GPS data Ubidots)

Hello Particle forms.

I am observing sometimes my webhooks do not go through, and it becomes clear when viewing on Particle Console.

Here is the correct webhook, this is going to Ubidots correctly. It looks great.


And here is the Version that does not go through… The main difference is the addition of GPS data.
I also don’t see the “pretty” formatting, this is connected to it not sending to Ubidots.
What in the GPS data is causing the webhook to not render properly? It is not being received on Ubidots.

not_pretty

Hey @Adam_B, the context key-value pairs that you are using are valid for TCP, not HTTP. Please reference below a valid pair:

"context": {"lat": 37.562260, "lng": -122.316437}

I have also mailed you an updated example.

All the best

1 Like

Hi Adam, Here’s the text from a webhook with context that posts to Ubidots successfully for me. I am just posting the raw JSON as the payload instead of letting the particle interface build it. Maybe it will be helpful. Cheers

{
“name”: “DIRTdot/int”,
“data”: “{“GPS”:{“value”: 1, “context”:{“lat”:xx.598698, “lng”:-xxx.370201}},“batt”:{“value”: 0.04},“wm1”:{“value”: 151.34}}”,
“ttl”: 60,
“published_at”: “2018-10-28T11:01:00.168Z”,
“coreid”: “xxxxxxxxxxxxxxxxxxxxxxxxxx”
}

1 Like

Thanks all!

I updated my formatting of the GPS context:

  char szInfo[64];
  float lat, lon;
  char ubidots_string[150];

  sprintf(szInfo, "%.6f,%.6f", (lat = GPS_GetLatDeg()) , (lon = GPS_GetLongDeg()));
  sprintf(ubidots_string,"\"lat\":%.6f,\"lng\":%.6f",lat,lon);