Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Open-AudIT is implementing a JSON Restful API to be used both in the web interface and via JSON requests.. Te format of the request URLs will also be used in the web application (with a few extra pieces, see below re: action).

In short, you can all /devices using the API to retrieve a JSON document containing the devices as per the JSONapi.org spec.

You can also call /devices in the web front end and retrieve the same list which is displayed in the web page and formatted as per the normal application theme.

Filtering, sorting and the other options apply equally to both the web frontend and to the JSON API.

 

NOTE - This API is not ready for a full release as yet and items below are subject to change.As at 1.12.8, this is how it stands.

NOTE - This page is incomplete and is being updated as we work towards a released version of the API.

 

Open-AudIT's API

Open-AudIT is basing it's API on http://jsonapi.org with the intention of providing simple and intuitive access in a manner familiar to developers. In addition to this API, the web interface will use the same request/URI format and supply some additional actions.

 

Options

Format

Using the format option is useful when using a web browser but you wish to see the result in JSON format. Adding format=json achieves this. Normally a web browser will set its accept header to html, so in that case we return the rendered page. Using an API to retrieve JSON you should set the accept header to contain the string "json". That might be "json/application" or whatever you like. You can override this by providing the format option in the URL..

...

When using the API the default action is determined according to the format request method and URL. You can override this by providing the 'action' option in the URL. This is only really required when using the web front end. Normal use of the API does not require you to set 'action'. An example of this is when creating a new item. You would normally use POST to /item but in the case of a web user, you need a web form to be able to fill out the item details. In that case there is no facility for this in a typical JSON restful API. We work around this by providing action=create in a GET request for the URL. IE - http://{server}/open-audit/index.php/networks?action=create

...