Return a [paginated](http://developer.apiture.com/docs/concepts/pagination) [sortable](http://developer.apiture.com/docs/concepts/sorting) collection of audit records which satisfy the filtering query parameters. By default, this returns records for the past 24 hours, in reverse chronological order. This result list of records is sorted in _reverse chronological order_ unless `?startAt=` is specified. The [links](http://developer.apiture.com/docs/concepts/links) in the response include pagination links as described in the `records` schema.
curl -X GET -H "API-Key: [[apiKey]]" "http:///audit/records?type=&category=&user=&host=&startAt=&endAt=&period=&uri=&start=&limit=&sortBy="
import { AuditRecordApi } from "@apiture/audit-client-sdk";
const auditRecordApi = new AuditRecordApi(configuration);
// Configure OAuth2 access token for authorization: accessToken
var accessToken = "YOUR ACCESS TOKEN";
auditRecordApi.setAccessToken(accessToken)
// Configure API key authorization: apiKey
var apiKey = "YOUR API KEY";
auditRecordApi.setApiKey(apiKey);
var api = new Audit.AuditRecordApi.getAuditRecords()
var opts = {
'type': type_example, // {String} Restrict audit records to those matching this record type. Multiple types may be specified, separated by `|`.
'category': category_example, // {String} Restrict audit records to those matching this record type category. Multiple categories may be specified, separated by `|`.
'user': user_example, // {String} Restrict audit records to those where either the `customerId` or `onBehalfOf` fields match this value.
'host': host_example, // {String} Restrict audit records to those matching this client host IP address.
'startAt': 2013-10-20, // {date} The start date or date-time of the time-bounded query. May be combined with `endAt` _or_ `period` but not both. This may be either a date or date-time in [RFC 3339](https://tools.ietf.org/html/rfc3339) *UTC* format (`YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ss.sssZ`). If only a date is passed, the time of day is `00:00:00`. The default `startAt` date-time is 24 hours before the current instant. Using `startAt` will change the sort order from reverse to forward chronological order.
'endAt': 2013-10-20, // {date} The end date of the time-bounded query. May be combined with `startAt` _or_ `period` but not both. This may be either a date or date-time in [RFC 3339](https://tools.ietf.org/html/rfc3339) *UTC* format (`YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ss.sssZ`). If only a date is passed, the time of day is `24:00:00`. The default `endAt` is the current instant.
'period': period_example, // {String} The time period for the date-time range, looking backwards from `endAt` (or today, if `endAt` is omitted), or forward from `startAt`. The `period` is a [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). For example, to list audit records for the last 6 days, use `?period=P6D`. The default is `P1D` indicating one day of data. Examples of `period` values: `P1M` (one month), `P2W` (two weeks), `P5D` (five days), `PT12H` (twelve hours), `PT30M` (30 minutes) and `PT30S` (30 seconds).
'uri': uri_example, // {String} Restrict audit records to where `primaryUri` or `secondaryUri` match this URI parameter value. This string is a _relative_ URI only, without the absolute `https://host` URL prefix. Example: `?uri=/accounts/account/b6512168-20fc-4a8c-80dd-8670f76ea356`
'start': start_example, // {String} Represents the first record of the page of results. This is supplied by the service when paginating items: the `next` link includes a `?start=` query parameter which refers to beginning of the next page of items.
'limit': 56, // {Integer} The maximum number of audit record representations to return in this page.
'sortBy': sortBy_example // {String} Optional sort criteria. See [sort criteria format](http://developer.apiture.com/docs/concepts/sorting), such as `?sortBy=field1,-field2`.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
auditRecordApi.getAuditRecords(opts, callback);
Name |
Description |
type |
String
Restrict audit records to those matching this record type. Multiple types may be specified, separated by `|`.
|
category |
String
Restrict audit records to those matching this record type category. Multiple categories may be specified, separated by `|`.
|
user |
String
Restrict audit records to those where either the `customerId` or `onBehalfOf` fields match this value.
|
host |
String
Restrict audit records to those matching this client host IP address.
|
startAt |
date
(date)
The start date or date-time of the time-bounded query. May be combined with `endAt` _or_ `period` but not both. This may be either a date or date-time in [RFC 3339](https://tools.ietf.org/html/rfc3339) *UTC* format (`YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ss.sssZ`). If only a date is passed, the time of day is `00:00:00`. The default `startAt` date-time is 24 hours before the current instant. Using `startAt` will change the sort order from reverse to forward chronological order.
|
endAt |
date
(date)
The end date of the time-bounded query. May be combined with `startAt` _or_ `period` but not both. This may be either a date or date-time in [RFC 3339](https://tools.ietf.org/html/rfc3339) *UTC* format (`YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ss.sssZ`). If only a date is passed, the time of day is `24:00:00`. The default `endAt` is the current instant.
|
period |
String
(period)
The time period for the date-time range, looking backwards from `endAt` (or today, if `endAt` is omitted), or forward from `startAt`. The `period` is a [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). For example, to list audit records for the last 6 days, use `?period=P6D`. The default is `P1D` indicating one day of data. Examples of `period` values: `P1M` (one month), `P2W` (two weeks), `P5D` (five days), `PT12H` (twelve hours), `PT30M` (30 minutes) and `PT30S` (30 seconds).
|
uri |
String
(uri)
Restrict audit records to where `primaryUri` or `secondaryUri` match this URI parameter value. This string is a _relative_ URI only, without the absolute `https://host` URL prefix. Example: `?uri=/accounts/account/b6512168-20fc-4a8c-80dd-8670f76ea356`
|
start |
String
Represents the first record of the page of results. This is supplied by the service when paginating items: the `next` link includes a `?start=` query parameter which refers to beginning of the next page of items.
|
limit |
Integer
(int32)
The maximum number of audit record representations to return in this page.
|
sortBy |
String
Optional sort criteria. See [sort criteria format](http://developer.apiture.com/docs/concepts/sorting), such as `?sortBy=field1,-field2`.
|