How to make REST API request to xMatters from Integration Agent

Not Yet Reviewed

I have my integration agent all set up and running on a company server. I am able to confirm that it is receiving data from xMatters via the outbound integration with the trigger being the submission of a form.

My intent for this project is to run requests within the JS Service file on the Integration Agent back to xMatters for data.

In this specific case, I would like to retrieve a list of all users with embedded roles, compile them (in the IA) into a CSV and save that file locally. However, moving forward I can see a need for having to also make edits to existing data on the xMatters service using other request types (POST, PUT, DELETE etc...).

I was already able to build out the needed functions/requests to perform the above stated function inside of the Integration Builder with the exception being the saving of the CSV file, hence the need to put it on a server for local storage. My goal is to now move this code to the IA.

So far I am unable to make the request to xMatters in the way I do in the Integration Builders using the standard format of http.request({ endpoint, path, method }). Do you guys have any advice here? Maybe I need to import some kind of library as it seems the IA doesn't understand what these functions are when run.



Date Votes

Please sign in to leave a comment.

  • Hey Michael,

    There is a library that is available called XMIO.js that you can include in your Integration Service.  Using XMIO you can POST, GET, etc. using HTTP (both to your xMatters instance and to other full URLs).

    You can see an example of it in the sample-plan Integration Service that came with the Integration Agent installation.  You'll see that in sample-plan.js there is a line like this:


    The event.js include will load XMIO.js.  But, if you are writing a custom Integration Service from scratch, you can load XMIO.js directly as well.

    The other option is to wait a few weeks for our Centipedes release, as in that release the newer xMatters Agent will begin supporting Inbound Integration requests! Which means you can code the inbound request naturally in your xMatters On-Demand instance via the Integration Builder, and then deploy them to your xMatters Agent for initiation behind the firewall.  (woot woot!). :-D

    Hope that helps,


  • Yep, I did find that shortly before you replied but thanks for the detailed response Jordan. Much appreciated!

    For anyone else, looks like it's going to the following

    lib/integrationservices/javascript/event.js  #apia_response
  • Hey Adam!

       Hopefully it isn't too late, but if you are just doing outbound integration stuff and writing to a file and especially if you are already pretty familiar with the Integration Builder, I'd like to introduce you to the xAgent. This is the new iteration of the integration agent and is actually a fork of the integration builder coded to run as a standalone service. It has all of the advantages of the IB, and none of the headaches of the IA. 

    Brief write up here, and more docs here.

    If you've got your stuff working already, then carry on, but I wanted to point this out as the way of the future. :D

    Happy Friday!
        --- Travis


Didn't find what you were looking for?

New post