Could i run code in webhook?

alerting

(Yunfei Yang) #1

I wanna send a HTTP request with a token.
But the token need to be gotten from another request, because it will change after some time.

So,Could I run some code in webhook?
like:
"params" : { "token" : "{{JSON.parse(Net::HTTP.get('a.com','/cgi-bin/token?xxx'))['token']}}" }


(Steve Kearns) #2

A watch supports multiple inputs, using the chained input type. This would allow your watch to run the ES query, and reach out to an external system to retrieve the current token. Then you can just template in the token in the webook.


(system) #3