DynamicJsonDocument doc(1024);
// Create an array
JsonArray data = doc.createNestedArray("data");
// Create the first object in the array
JsonObject obj1 = data.createNestedObject();
obj1["name"] = "dataName";
obj1["value"] = dataValue;
// Allocate a buffer for the serialized JSON output
char jsonBuffer[1024];
serializeJson(doc, jsonBuffer, sizeof(jsonBuffer));
Particle.publish(eventName, jsonBuffer, PRIVATE);
Which dynamic value do you want at the end of the URL? {{data.0.value}}? You can insert any of the mustache templates that you did in the body into the URL configuration.
Wait so just append {{data.1.value}} at the end of the target url in the Webhook configuration and just pass whatever value I want in the custom JSON request when publishing?
Okay, worked out the triggering issue.
The integration log now shows a failed request with 404 status code.
Is there a way to check that the target url is being set correctly with {{data.1.value}} being appended at the end? I've double checked everything on the payload side and its the correct format.