Is it possible to build a lookup table into a webhook?
I have a working webhook with the URL:
http://SERVER/api/plugins/telemetry/{{t}}/{{i}}/values/timeseries
If I call this with
Particle.publish("thingsboard-in","{\"t\":\"DEVICE\",\"i\":\"xxxx-device-id-xxxxx\"}",PRIVATE);
This works fine. What would be nice is if I could send a text string for my device ID and do a lookup. That would mean if for some reason the device ID changes, I don’t need to reflash any devices with that encoded in.
In a custom template, I’ve added:
"l": {
"Greenhouse": "xxxx-device-id-xxx"
}
And then call the webhook with:
Particle.publish("thingsboard-in","{\"t\":\"DEVICE\",\"d\":\"Greenhouse\"}",PRIVATE);
However, I can’t find a URL format to lookup this data. I have been trying things along the lines of:
http://SERVER/api/plugins/telemetry/{{t}}/{{l.d}}/values/timeseries
What I’m trying to say is, in the URL substitute the value of l.d, where ‘d’ is a text string reference and the value returned should be a valid device id. Is this possible?