Audit

An audit object represents an event undertaken by either a user or api user on your felloh account.

An example of an audit Object

{
"id": "e4bd9203-cb8a-4a67-87f5-7ae10bc35744",
"type": "booking:create",
"entity_id": "7c189f42-415e-4c33-8f00-aa76084692cf",
"created_at": "2022-08-01T09:04:56.312Z",
"user":{
"id": "de25f60e-e796-4e65-a451-442680e66da6"
},
"organisation": {
"id": "Z4321",
"name": "Felloh"
}
}

idstring

Unique identifier for the object.

typestring

The event that was undertaken.

typestring

The entity id that event is related to.

created_atdatetime

The datetime at which the event occurred

userobject

A compact organisation object representing the organisation owner of the beneficiary.

organisationobject

A compact user object representing the user that undertook the action.


Fetch all

POST/audit

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/audit',
data: {
organisation: 'X9876',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function auditRequest($token) {
$client = new Client();
$response = $client->post('https://api.felloh.com/audit', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
'json' => [
'organisation' => 'X9876',
'skip' => 10,
'take' => 20,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$response = auditRequest($token);
import requests
import json
def post_audit_data(organisation, skip, take, access_token):
api_url = 'https://api.felloh.com/audit'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': organisation,
'skip': skip,
'take': take
}
response = requests.post(api_url, headers=headers, data=json.dumps(data))
response.raise_for_status()
return response.text
response_data = post_audit_data('X9876', 10, 20, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PostAuditData("X9876", 10, 20, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostAuditData(string organisation, int skip, int take, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/audit";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
skip = skip,
take = take
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

JSON RESPONSE

{
"data": [
{
"id": "e4bd9203-cb8a-4a67-87f5-7ae10bc35744",
"type": "booking:create",
"entity_id": "7c189f42-415e-4c33-8f00-aa76084692cf",
"created_at": "2022-08-01T09:04:56.312Z",
"user":{
"id": "de25f60e-e796-4e65-a451-442680e66da6"
},
"organisation": {
"id": "Z4321",
"name": "Felloh"
}
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

This endpoint retrieves all audit events. Audit events are sorted by creation date, with the most recent events coming first.

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/audit

SANDBOXhttps://sandbox.felloh.com/audit

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch audit events for. You can find the organisation that you have access to by using the List all organisations method.
skipfalseIntegerSee pagination section for details
takefalseIntegerSee pagination section for details

Response

Returns an array of Beneficiary Objects