Monitor - Can the bearer {{access_token}} Environment Variable be updated post OAUTH monitor


I use Postman Free, so I can make 1000 API calls free via Monitor.
There is a requirement to automate API calls once a day that work fine if manually run or by individually running them by setting the Environment variables via this helpful link:

The refresh tokens take around a few hours to expire so I set up the OAUTH collection under a monitor (which does work in isolation), however it does not update the new bearer {{access_token}} on each of the 4 jobs, so they cannot authenticate when they run post OAUTH monitor.

These API Calls run fine manually post OAUTH req, but these are required overnight for a data import for analysis. Is there a way I can do this, or is it a limitation on the Monitor?

Thanks in advance, happy to expand if not enough info given…

Hey @data_reporting, this is quite common a use case and can be accomplished easily. All you’ll have to do is include a final request in your collection that uses the Postman API to update your monitor’s environment after the run has completed.

Thanks @kunagpal , ok, I’ve created the E Var {{postman_api_key}} and tested which worked and the API key is linked to the correct environment.

I think I’ve got it set up ok, but until the OAUTH token runs out, I can’t test this on Monitor for a few hours yet

This works, but as a user, it could be a LOT easier. I’d rather have a checkbox like in the runner to have a monitor able to affect its environment simply by writing to it in script.

1 Like