api monitoring

How do we monitor the API's if they are alive or not even though they are not accessed by the end users and if we want to check the API on an hourly basis is there any tool for that?

0 1 114
1 REPLY 1

@tulasi chitturi

The simplest way to this would be to setup a cronjob on a server that runs every hour and makes a curl call to the API(s) that you want to monitor:

An example crontab expression that would run at 30 minutes past every hour is: https://crontab.guru/#30_*_*_*_* (this site is quite cool because you can play around with the frequency).

Your curl command would need to include any necessary credentials, for example:

curl -s -u $username:$password https://$org-$env.apigee.net/$basepath/$pathsuffix

You could also run this on Google Cloud using a combination of Cloud functions and Cloud Scheduler. For example, the function would run the HTTP request, and the scheduler would kick off the function every hour.

https://cloud.google.com/functions/

https://cloud.google.com/scheduler/

You could then leverage Apigee API Monitoring to send alerts when the API raises errors.