xMatters API, AppScript, and Google DataStudio

Nick Young
2 min readNov 16, 2020

--

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.

  1. Create an xMatters user that has permissions to use the REST API
  2. Create a Google Sheet to house the data (sheets.new)
  3. Create an appscript project (script.google.com)
  4. 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
  5. 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.

Last Login shown over time, filtered by names & supervisors

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

--

--

Nick Young
Nick Young

Written by Nick Young

Cloud stuff, data, analytics; Google, Internet2 Advisory Boards & working groups. Higher Ed IT since 2002. @techupover and @usaussie on twitter

No responses yet