title | language_tabs | language_clients | toc_footers | includes | search | highlight_theme | headingLevel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Audit Service v1.0.0 |
|
|
false |
darkula |
2 |
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
A microservice for audit logging
Base URLs:
- HTTP Authentication, scheme: bearer
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /audit-logs/count
Name | In | Type | Required | Description |
---|---|---|---|---|
where | query | object | false | none |
Example responses
200 Response
{
"count": 0
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | AuditLog model count | loopback.Count |
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /audit-logs/{id}
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
filter | query | audit_logs.Filter | false | none |
Example responses
200 Response
{
"id": "string",
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | AuditLog model instance | AuditLogWithRelations |
Code samples
const inputBody = '{
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /audit-logs
Body parameter
{
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NewAuditLog | false | none |
Example responses
200 Response
{
"id": "string",
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | AuditLog model instance | AuditLog |
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/audit-logs',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /audit-logs
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | audit_logs.Filter1 | false | none |
Example responses
200 Response
[
{
"id": "string",
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Array of AuditLog model instances | Inline |
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [AuditLogWithRelations] | false | none | [(tsType: AuditLogWithRelations, schemaOptions: { includeRelations: true })] |
» AuditLogWithRelations | AuditLogWithRelations | false | none | (tsType: AuditLogWithRelations, schemaOptions: { includeRelations: true }) |
»» id | string | false | none | none |
»» action | string | true | none | none |
»» actedAt | string(date-time) | true | none | none |
»» actedOn | string | false | none | none |
»» actionKey | string | true | none | none |
»» entityId | string | true | none | none |
»» actor | string | true | none | none |
»» before | object | false | none | none |
»» after | object | false | none | none |
»» actionGroup | string | false | none | none |
{
"id": "string",
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
AuditLog
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | none |
action | string | true | none | none |
actedAt | string(date-time) | true | none | none |
actedOn | string | false | none | none |
actionKey | string | true | none | none |
entityId | string | true | none | none |
actor | string | true | none | none |
before | object | false | none | none |
after | object | false | none | none |
actionGroup | string | false | none | none |
{
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
NewAuditLog
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
action | string | true | none | none |
actedAt | string(date-time) | true | none | none |
actedOn | string | false | none | none |
actionKey | string | true | none | none |
entityId | string | true | none | none |
actor | string | true | none | none |
before | object | false | none | none |
after | object | false | none | none |
actionGroup | string | false | none | none |
{
"id": "string",
"action": "string",
"actedAt": "2019-08-24T14:15:22Z",
"actedOn": "string",
"actionKey": "string",
"entityId": "string",
"actor": "string",
"before": {},
"after": {},
"actionGroup": "string"
}
AuditLogWithRelations
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | none |
action | string | true | none | none |
actedAt | string(date-time) | true | none | none |
actedOn | string | false | none | none |
actionKey | string | true | none | none |
entityId | string | true | none | none |
actor | string | true | none | none |
before | object | false | none | none |
after | object | false | none | none |
actionGroup | string | false | none | none |
{
"count": 0
}
loopback.Count
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
count | number | false | none | none |
{
"offset": 0,
"limit": 100,
"skip": 0,
"order": "string",
"fields": {
"id": true,
"action": true,
"actedAt": true,
"actedOn": true,
"actionKey": true,
"entityId": true,
"actor": true,
"before": true,
"after": true,
"actionGroup": true
}
}
audit_logs.Filter
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
offset | integer | false | none | none |
limit | integer | false | none | none |
skip | integer | false | none | none |
order | any | false | none | none |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | string | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
fields | any | false | none | none |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | object | false | none | none |
»» id | boolean | false | none | none |
»» action | boolean | false | none | none |
»» actedAt | boolean | false | none | none |
»» actedOn | boolean | false | none | none |
»» actionKey | boolean | false | none | none |
»» entityId | boolean | false | none | none |
»» actor | boolean | false | none | none |
»» before | boolean | false | none | none |
»» after | boolean | false | none | none |
»» actionGroup | boolean | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | [string] | false | none | none |
{
"offset": 0,
"limit": 100,
"skip": 0,
"order": "string",
"where": {},
"fields": {
"id": true,
"action": true,
"actedAt": true,
"actedOn": true,
"actionKey": true,
"entityId": true,
"actor": true,
"before": true,
"after": true,
"actionGroup": true
}
}
audit_logs.Filter
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
offset | integer | false | none | none |
limit | integer | false | none | none |
skip | integer | false | none | none |
order | any | false | none | none |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | string | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
where | object | false | none | none |
fields | any | false | none | none |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | object | false | none | none |
»» id | boolean | false | none | none |
»» action | boolean | false | none | none |
»» actedAt | boolean | false | none | none |
»» actedOn | boolean | false | none | none |
»» actionKey | boolean | false | none | none |
»» entityId | boolean | false | none | none |
»» actor | boolean | false | none | none |
»» before | boolean | false | none | none |
»» after | boolean | false | none | none |
»» actionGroup | boolean | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | [string] | false | none | none |