Webhook Bug - Query Parms Not Replaced

Hi,

I found a bug in the Webhooks.

I created a webhook that calls my server with a GET command and passes these Query Parms:

{
“deviceid”: “{{PARTICLE_DEVICE_ID}}”,
“command”: “{{PARTICLE_EVENT_VALUE}}”
}

On my firmware was I calling this:

Particle.publish(“templog”, msg, PRIVATE, NO_ACK);

Nothing special, but on my server side I was getting these values in my GET request:

command: {{PARTICLE_EVENT_VALUE}} deviceid: {{PARTICLE_DEVICE_ID}}

After digging some, I discovered that my data (the msg variable) I was sending to Particle.publish() included a \r\n at the end of the line.

As soon as I rmeoved the \r\n it started replacing the {{PARTICLE_EVENT_VALUE}} and {{PARTICLE_DEVICE_ID}} with actual values:

command: 0203477406000088=27.1 deviceid: XXXXXXXXXXXXXXXXXX

No big deal, but figured I point it out.

Carsten

3 Likes

Thanks for sharing.

Is there any simple way to send multi line text using PARTICLE_EVENT_VALUE?