I am attempting to send webhooks to tago.io with location data. Tago is receiving the raw data but the format is not valid for what they are expecting.
Particle is sending
{
"location": "{'lat':45.913062,'lng':-121.014963}",
"value": "Wildwood",
"variable": "location"
}
Tago.io is expecting
{
"location": {"lat":45.913062,"lng":-121.014975},
"value": "Wildwood",
"variable": "location"
}
The difference is only the location and format of the quotes. I have not been able to figure out how to adjust these quotes in Particle. Everything I attempt gives me syntax errors.
the code in question:
snprintf(pubbuf, sizeof(pubbuf), "{'lat':%f,'lng':%f}", gps.location.lat(), gps.location.lng());