xMatters API, AppScript, and Google DataStudio
As is typical lately, i got curious about whether i could get AppScript to play nice with a non-Google external REST API to pull in some information to Google Sheets. So…i started playing with the xMatters API (https://help.xmatters.com/xmapi/index.html#xmatters-rest-api)
WHY?
Well….sometimes you want to pull information out for ad-hoc reporting, or long-term storage of certain info…rather than being dependent on a vendor’s retention schedule. Other times, you need to provide information outside the product itself to non-licensed users. Or maybe you need to display the data a little bit differently than it is shown in the platform itself. Or what about merging the data with another data source to enrich the story you’re trying to tell. Of course…sometimes you may want to just do it because you want to see if it’s possible too.
HOW?
The repo has all the details, but the process is quite simple.
- Create an xMatters user that has permissions to use the REST API
- Create a Google Sheet to house the data (sheets.new)
- Create an appscript project (script.google.com)
- Run the functions manually, or set them to run on a schedule. As of writing, the script pulls people/users and their supervisors, groups, and group rosters
- Once you have the data, report on it in Google Sheets, or maybe in Data Studio
The data can be merged on the targetName or webLogin info to combine things like roster & people info….but you can experiment depending on your needs. Of course, in Data Studio you can filter as needed using the data controls.
That’s pretty much it. Feel free to take the repo and adjust to your needs….add in calls to the other xMatters API endpoints etc.
GIT Repo: https://github.com/usaussie/xmatters_api_appscript