I have been trying to find a guide or examples on using invoke-webrequest in powershell to do some simple data gathering. I was unable to find any documentation regarding this. Is there some examples or some documentation on using powershell with sophos central API?
I am quite new to API calls in general.
I started with the example invoke-webrequest on the basic API help page, but I am not sure where to go past that.
yes. Its in the documentation at developer.sophos.com
in general, I would suggest using Postman. It's an easier solution to use for web API calls because it know how to properly format the request headers.
Program Manager, Support Readiness | CISSP | Sophos Technical SupportSupport Videos | Product Documentation | @SophosSupport | Sign up for SMS AlertsIf a post solves your question use the 'Verify Answer' link.
I have downloaded postman. Is there a guide on how to use it with sophos central API keys and start making the calls?
I see. I was able to follow along with the authentication through the postman API collection, but then I got stuck. Is postman supposed to save the access token/refresh token as variables somewhere for the rest of this API stack to use?
you can do that or you can manually add them as variables to the call you want to make.
On the collection - click on the collection name then click on the three dots [...] and then in the variable space you can see the variable declares. Then in each request you can see the variables needed in the headers.