Using the REST API

Introduction

This is the REST-API that lets you issue commands to op5 Monitor by performing regular HTTP requests. Basically, you 'visit' an URI, which triggers Monitor to do something, and you get a response telling you what happened.

You get help with the formulation of the requests on each object type's help page (look over to your left to find which object types are available). You also get tips on how to perform HTTP requests via the terminal (using cURL) and via scripting languages (using Python or PHP).

Note that it is not recommended at this point to use the REST-API as your primary source for passive checks. The performance will likely not be sufficient for your needs. Expect a throughput of about ten checks per second. You can achieve greater performance by writing to the query handler directly instead of using the HTTP API, if you are inclined to send many passive check results.

Technical information

Authentication

You send along a pair of regular op5 Monitor user credentials in a basic auth header with every request. View any example and you will understand how to do this.

Requests

In a REST-API, there are a couple of important things that make up for a valid request:

Once again, viewing any of the examples helps you get into the REST mindset.

Responses

You need to examine two things in the response: the status code and the body. The status code tells you what Monitor did with your input and the body gives you a detailed response.

Examples of status codes:

These status codes are general for all web traffic and can be found at the List of HTTP status codes