I’m currently testing some indicator/strategy and would like to automate things.
I configure somes webhook with alerts with JSON formated strings like :
alert("{'heyyy':'oohhhh!'}", freq = alert.freq_all)
but when the alert is triggered, webhook sended and i reveive the call on my server (node.js), the body is empty : {}
i setup the alert on "every alert() call"
i also try with alertcondition
but the result is the same : empty body.
Thanks
2
Answers
I figure how to do that, there were a few issues
1 - We must use simple quote as wrapper and double quotes for properties in stringify JSON
2 - server side (node JS) my body parser is now setup to receive plan text too
Note, if your JSON string is setup with the wrong quotes , the
JSON.parse()
won't workTry log.info to test you alert mesage
your string looks good
It doesn’t seem like a pinescript problem