Watcher, multiple web posts

I've looked through the docs and can't really find an answer if this is possible.

I want a watcher job to fire every 5 minutes to hit an API.

First of all it must hit the API to gain an authorization token, then once it has the token it needs to use it in a subsequential api call to get what I need. Is this possible in watcher?

  1. Step one, gain a token
    https://www.arcgis.com/sharing/rest/oauth2/token?grant_type=client_credentials&client_id={{REDACTED}}&client_secret={{REDACTED}}

  2. Some how store the token for step 3.

  3. Fire off the API call

http://wvdep.maps.arcgis.com/sharing/rest/portals/self?culture=en&f=json&token={{ TOKEN }}

I can use zabbix if not, but i'd like to use watcher.

That's pretty advanced for watcher to do, so it's not possible. It's mostly a tool to query Elasticsearch that sends out a request to a few configured options. You'll have to use zabbix for that.

2 Likes

Yeh, I've gone ahead and made it in Zabbix. Thanks for replying

This could indeed be done, using a chained input, retrieving the API key first, then using a transform to properly extract it, and then use it in the next input.

Happy as long as you got it working :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.