More events in one Webhook (SOLVED)

Ok, I was able to get a Photon posting to a dynamic webhook URL (this particular example is for posting to a Slack channel):

Code:

Spark.publish("log_info", "{\"my-log\": \"Yo!\", \"my-url\":\"a/b/c\"}", 60);

Webhook definition:

{
    "eventName": "log_",
    "url": "https://hooks.slack.com/services/{{my-url}}",
    "requestType": "POST",
    "json": {
    	"username": "{{SPARK_CORE_ID}}",
        "text": "{{my-log}}"
    }
}

Hope that works for you, too!

3 Likes