It looks like the responseTopic field in a webhook does not respond to template variables. Here is a simplified example:
WebHook:
{
"event": "test-hook",
"responseTopic": "{{myVar}}_loginToken",
"noDefaults": true,
"mydevices": true,
"requestType": "POST",
"url": "http://www.xxxxx.net/users/login",
"json":{"email":"xxx@yyy.com","info":"{{myVar}}"}
}
Here is the code:
#include "application.h"
void setup(){
String dataString = "{\"myVar\":\"test\"}";
Particle.publish("test-hook",dataString,60,PRIVATE);
}
void loop(){
delay(60000);
}
The text, “test” is properly appended to the json portion of the post via {{myVar}}, but the responseTopic always appends a null for {{myVar}}.
- Is this expected behavior or a bug?
- Should I expect to be able to use a template variable in the
responseTopic field?