Csharp (SDK)
using Meitner;
using Meitner.Models.Components;
using System;
using System.Collections.Generic;
var sdk = new MeitnerSDK(security: new Security() {
Option1 = new SecurityOption1() {
ClientCredentials = "<YOUR_API_KEY_HERE>",
ClientSecret = "<YOUR_API_KEY_HERE>",
},
});
Models.Requests.AuditEventSearchResponse? res = await sdk.AuditEvents.SearchAsync(
auditEventSearch: new AuditEventSearchRequestBody() {
Filter = new AuditEventSearchFilter() {
Equals = new AuditEventSearchEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new AuditEventSearchEqualsMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
CreatedBy = "123e4567-e89b-12d3-a456-426614174000",
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedBy = "123e4567-e89b-12d3-a456-426614174000",
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
ResourceID = "123e4567-e89b-12d3-a456-426614174000",
},
NotEquals = new AuditEventSearchNotEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new AuditEventSearchNotEqualsMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
CreatedBy = "123e4567-e89b-12d3-a456-426614174000",
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedBy = "123e4567-e89b-12d3-a456-426614174000",
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
ResourceID = "123e4567-e89b-12d3-a456-426614174000",
},
GreaterThan = new AuditEventSearchGreaterThan() {
Meta = new AuditEventSearchGreaterThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
SmallerThan = new AuditEventSearchSmallerThan() {
Meta = new AuditEventSearchSmallerThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
GreaterOrEqual = new AuditEventSearchGreaterOrEqual() {
Meta = new AuditEventSearchGreaterOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
SmallerOrEqual = new AuditEventSearchSmallerOrEqual() {
Meta = new AuditEventSearchSmallerOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Contains = new AuditEventSearchContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new AuditEventSearchContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
ResourceID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
NotContains = new AuditEventSearchNotContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new AuditEventSearchNotContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
ResourceID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
Null = new AuditEventSearchNull() {
Meta = new AuditEventSearchNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
},
NotNull = new AuditEventSearchNotNull() {
Meta = new AuditEventSearchNotNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
},
OrCondition = true,
},
},
limit: 1,
offset: 0
);
while(res != null)
{
// handle items
res = await res.Next!();
}from meitner import Meitner, models
from meitner.utils import parse_datetime
import os
with Meitner(
security=models.Security(
option1=models.SecurityOption1(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
),
) as m_client:
res = m_client.audit_events.search(filter_={
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"not_equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"or_condition": True,
}, limit=1, offset=0)
while res is not None:
# Handle items
res = res.next()curl --request POST \
--url https://api.meitner.se/directory/v1/audit-event/_search \
--header 'Client-ID: <api-key>' \
--header 'Client-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"notEquals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000"
],
"meta": {
"createdBy": [
"123e4567-e89b-12d3-a456-426614174000"
],
"updatedBy": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"resourceID": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"notContains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000"
],
"meta": {
"createdBy": [
"123e4567-e89b-12d3-a456-426614174000"
],
"updatedBy": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"resourceID": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"orCondition": true
}
}
'const options = {
method: 'POST',
headers: {
'Client-ID': '<api-key>',
'Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filter: {
equals: {
id: '123e4567-e89b-12d3-a456-426614174000',
meta: {
createdAt: '2024-01-15T10:30:00Z',
createdBy: '123e4567-e89b-12d3-a456-426614174000',
updatedAt: '2024-01-15T10:30:00Z',
updatedBy: '123e4567-e89b-12d3-a456-426614174000'
},
timestamp: '2024-01-15T10:30:00Z',
resourceID: '123e4567-e89b-12d3-a456-426614174000'
},
notEquals: {
id: '123e4567-e89b-12d3-a456-426614174000',
meta: {
createdAt: '2024-01-15T10:30:00Z',
createdBy: '123e4567-e89b-12d3-a456-426614174000',
updatedAt: '2024-01-15T10:30:00Z',
updatedBy: '123e4567-e89b-12d3-a456-426614174000'
},
timestamp: '2024-01-15T10:30:00Z',
resourceID: '123e4567-e89b-12d3-a456-426614174000'
},
greaterThan: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
smallerThan: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
greaterOrEqual: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
smallerOrEqual: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
contains: {
id: ['123e4567-e89b-12d3-a456-426614174000'],
meta: {
createdBy: ['123e4567-e89b-12d3-a456-426614174000'],
updatedBy: ['123e4567-e89b-12d3-a456-426614174000']
},
resourceID: ['123e4567-e89b-12d3-a456-426614174000']
},
notContains: {
id: ['123e4567-e89b-12d3-a456-426614174000'],
meta: {
createdBy: ['123e4567-e89b-12d3-a456-426614174000'],
updatedBy: ['123e4567-e89b-12d3-a456-426614174000']
},
resourceID: ['123e4567-e89b-12d3-a456-426614174000']
},
null: {meta: {createdBy: true, updatedAt: true, updatedBy: true}},
notNull: {meta: {createdBy: true, updatedAt: true, updatedBy: true}},
orCondition: true
}
})
};
fetch('https://api.meitner.se/directory/v1/audit-event/_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meitner.se/directory/v1/audit-event/_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'equals' => [
'id' => '123e4567-e89b-12d3-a456-426614174000',
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'createdBy' => '123e4567-e89b-12d3-a456-426614174000',
'updatedAt' => '2024-01-15T10:30:00Z',
'updatedBy' => '123e4567-e89b-12d3-a456-426614174000'
],
'timestamp' => '2024-01-15T10:30:00Z',
'resourceID' => '123e4567-e89b-12d3-a456-426614174000'
],
'notEquals' => [
'id' => '123e4567-e89b-12d3-a456-426614174000',
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'createdBy' => '123e4567-e89b-12d3-a456-426614174000',
'updatedAt' => '2024-01-15T10:30:00Z',
'updatedBy' => '123e4567-e89b-12d3-a456-426614174000'
],
'timestamp' => '2024-01-15T10:30:00Z',
'resourceID' => '123e4567-e89b-12d3-a456-426614174000'
],
'greaterThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'smallerThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'greaterOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'smallerOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'contains' => [
'id' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'meta' => [
'createdBy' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'updatedBy' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'resourceID' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'notContains' => [
'id' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'meta' => [
'createdBy' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'updatedBy' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'resourceID' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'null' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
]
],
'notNull' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
]
],
'orCondition' => true
]
]),
CURLOPT_HTTPHEADER => [
"Client-ID: <api-key>",
"Client-Secret: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meitner.se/directory/v1/audit-event/_search"
payload := strings.NewReader("{\n \"filter\": {\n \"equals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"notEquals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"contains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"notContains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"orCondition\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-ID", "<api-key>")
req.Header.Add("Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meitner.se/directory/v1/audit-event/_search")
.header("Client-ID", "<api-key>")
.header("Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"equals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"notEquals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"contains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"notContains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"orCondition\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meitner.se/directory/v1/audit-event/_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-ID"] = '<api-key>'
request["Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"equals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"notEquals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"contains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"notContains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"orCondition\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"timestamp": "2024-08-01T00:00:00Z",
"resource": "Student",
"resourceID": "123e4567-e89b-12d3-a456-426614174000",
"type": "Delete"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 100
}
}{
"error": {
"code": "BadRequest",
"message": "The request contains invalid parameters or malformed data",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Unauthorized",
"message": "Authentication credentials are missing or invalid",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Forbidden",
"message": "You do not have permission to perform this operation",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NotFound",
"message": "The requested resource could not be found",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Conflict",
"message": "The request conflicts with the current state of the resource",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UnprocessableEntity",
"message": "Validation failed for AuditEvent Search endpoint",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests - rate limit exceeded",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Internal",
"message": "An unexpected server error occurred",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}AuditEvent
Search AuditEvents
Search for AuditEvents with filtering capabilities.
POST
/
audit-event
/
_search
Csharp (SDK)
using Meitner;
using Meitner.Models.Components;
using System;
using System.Collections.Generic;
var sdk = new MeitnerSDK(security: new Security() {
Option1 = new SecurityOption1() {
ClientCredentials = "<YOUR_API_KEY_HERE>",
ClientSecret = "<YOUR_API_KEY_HERE>",
},
});
Models.Requests.AuditEventSearchResponse? res = await sdk.AuditEvents.SearchAsync(
auditEventSearch: new AuditEventSearchRequestBody() {
Filter = new AuditEventSearchFilter() {
Equals = new AuditEventSearchEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new AuditEventSearchEqualsMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
CreatedBy = "123e4567-e89b-12d3-a456-426614174000",
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedBy = "123e4567-e89b-12d3-a456-426614174000",
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
ResourceID = "123e4567-e89b-12d3-a456-426614174000",
},
NotEquals = new AuditEventSearchNotEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new AuditEventSearchNotEqualsMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
CreatedBy = "123e4567-e89b-12d3-a456-426614174000",
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedBy = "123e4567-e89b-12d3-a456-426614174000",
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
ResourceID = "123e4567-e89b-12d3-a456-426614174000",
},
GreaterThan = new AuditEventSearchGreaterThan() {
Meta = new AuditEventSearchGreaterThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
SmallerThan = new AuditEventSearchSmallerThan() {
Meta = new AuditEventSearchSmallerThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
GreaterOrEqual = new AuditEventSearchGreaterOrEqual() {
Meta = new AuditEventSearchGreaterOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
SmallerOrEqual = new AuditEventSearchSmallerOrEqual() {
Meta = new AuditEventSearchSmallerOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Timestamp = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
Contains = new AuditEventSearchContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new AuditEventSearchContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
ResourceID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
NotContains = new AuditEventSearchNotContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new AuditEventSearchNotContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
ResourceID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
Null = new AuditEventSearchNull() {
Meta = new AuditEventSearchNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
},
NotNull = new AuditEventSearchNotNull() {
Meta = new AuditEventSearchNotNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
},
OrCondition = true,
},
},
limit: 1,
offset: 0
);
while(res != null)
{
// handle items
res = await res.Next!();
}from meitner import Meitner, models
from meitner.utils import parse_datetime
import os
with Meitner(
security=models.Security(
option1=models.SecurityOption1(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
),
) as m_client:
res = m_client.audit_events.search(filter_={
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"not_equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
"resource_id": "123e4567-e89b-12d3-a456-426614174000",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"smaller_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": parse_datetime("2024-01-15T10:30:00Z"),
},
"timestamp": parse_datetime("2024-01-15T10:30:00Z"),
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"resource_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
},
"or_condition": True,
}, limit=1, offset=0)
while res is not None:
# Handle items
res = res.next()curl --request POST \
--url https://api.meitner.se/directory/v1/audit-event/_search \
--header 'Client-ID: <api-key>' \
--header 'Client-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"notEquals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000"
],
"meta": {
"createdBy": [
"123e4567-e89b-12d3-a456-426614174000"
],
"updatedBy": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"resourceID": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"notContains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000"
],
"meta": {
"createdBy": [
"123e4567-e89b-12d3-a456-426614174000"
],
"updatedBy": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"resourceID": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"orCondition": true
}
}
'const options = {
method: 'POST',
headers: {
'Client-ID': '<api-key>',
'Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filter: {
equals: {
id: '123e4567-e89b-12d3-a456-426614174000',
meta: {
createdAt: '2024-01-15T10:30:00Z',
createdBy: '123e4567-e89b-12d3-a456-426614174000',
updatedAt: '2024-01-15T10:30:00Z',
updatedBy: '123e4567-e89b-12d3-a456-426614174000'
},
timestamp: '2024-01-15T10:30:00Z',
resourceID: '123e4567-e89b-12d3-a456-426614174000'
},
notEquals: {
id: '123e4567-e89b-12d3-a456-426614174000',
meta: {
createdAt: '2024-01-15T10:30:00Z',
createdBy: '123e4567-e89b-12d3-a456-426614174000',
updatedAt: '2024-01-15T10:30:00Z',
updatedBy: '123e4567-e89b-12d3-a456-426614174000'
},
timestamp: '2024-01-15T10:30:00Z',
resourceID: '123e4567-e89b-12d3-a456-426614174000'
},
greaterThan: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
smallerThan: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
greaterOrEqual: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
smallerOrEqual: {
meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'},
timestamp: '2024-01-15T10:30:00Z'
},
contains: {
id: ['123e4567-e89b-12d3-a456-426614174000'],
meta: {
createdBy: ['123e4567-e89b-12d3-a456-426614174000'],
updatedBy: ['123e4567-e89b-12d3-a456-426614174000']
},
resourceID: ['123e4567-e89b-12d3-a456-426614174000']
},
notContains: {
id: ['123e4567-e89b-12d3-a456-426614174000'],
meta: {
createdBy: ['123e4567-e89b-12d3-a456-426614174000'],
updatedBy: ['123e4567-e89b-12d3-a456-426614174000']
},
resourceID: ['123e4567-e89b-12d3-a456-426614174000']
},
null: {meta: {createdBy: true, updatedAt: true, updatedBy: true}},
notNull: {meta: {createdBy: true, updatedAt: true, updatedBy: true}},
orCondition: true
}
})
};
fetch('https://api.meitner.se/directory/v1/audit-event/_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meitner.se/directory/v1/audit-event/_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'equals' => [
'id' => '123e4567-e89b-12d3-a456-426614174000',
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'createdBy' => '123e4567-e89b-12d3-a456-426614174000',
'updatedAt' => '2024-01-15T10:30:00Z',
'updatedBy' => '123e4567-e89b-12d3-a456-426614174000'
],
'timestamp' => '2024-01-15T10:30:00Z',
'resourceID' => '123e4567-e89b-12d3-a456-426614174000'
],
'notEquals' => [
'id' => '123e4567-e89b-12d3-a456-426614174000',
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'createdBy' => '123e4567-e89b-12d3-a456-426614174000',
'updatedAt' => '2024-01-15T10:30:00Z',
'updatedBy' => '123e4567-e89b-12d3-a456-426614174000'
],
'timestamp' => '2024-01-15T10:30:00Z',
'resourceID' => '123e4567-e89b-12d3-a456-426614174000'
],
'greaterThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'smallerThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'greaterOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'smallerOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
],
'timestamp' => '2024-01-15T10:30:00Z'
],
'contains' => [
'id' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'meta' => [
'createdBy' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'updatedBy' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'resourceID' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'notContains' => [
'id' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'meta' => [
'createdBy' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'updatedBy' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'resourceID' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'null' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
]
],
'notNull' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
]
],
'orCondition' => true
]
]),
CURLOPT_HTTPHEADER => [
"Client-ID: <api-key>",
"Client-Secret: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meitner.se/directory/v1/audit-event/_search"
payload := strings.NewReader("{\n \"filter\": {\n \"equals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"notEquals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"contains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"notContains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"orCondition\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-ID", "<api-key>")
req.Header.Add("Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meitner.se/directory/v1/audit-event/_search")
.header("Client-ID", "<api-key>")
.header("Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"equals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"notEquals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"contains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"notContains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"orCondition\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meitner.se/directory/v1/audit-event/_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-ID"] = '<api-key>'
request["Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"equals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"notEquals\": {\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"createdBy\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\",\n \"updatedBy\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"resourceID\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n },\n \"timestamp\": \"2024-01-15T10:30:00Z\"\n },\n \"contains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"notContains\": {\n \"id\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"meta\": {\n \"createdBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"updatedBy\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"resourceID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n }\n },\n \"orCondition\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"timestamp": "2024-08-01T00:00:00Z",
"resource": "Student",
"resourceID": "123e4567-e89b-12d3-a456-426614174000",
"type": "Delete"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 100
}
}{
"error": {
"code": "BadRequest",
"message": "The request contains invalid parameters or malformed data",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Unauthorized",
"message": "Authentication credentials are missing or invalid",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Forbidden",
"message": "You do not have permission to perform this operation",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NotFound",
"message": "The requested resource could not be found",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Conflict",
"message": "The request conflicts with the current state of the resource",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UnprocessableEntity",
"message": "Validation failed for AuditEvent Search endpoint",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests - rate limit exceeded",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Internal",
"message": "An unexpected server error occurred",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}Authorizations
ClientCredentials & ClientSecretOAuth2
Query Parameters
The maximum number of AuditEvents to return (default: 50) when searching AuditEvents
Example:
1
The number of AuditEvents to skip before starting to return results (default: 0) when searching AuditEvents
Example:
0
Body
application/json
Request body
Filter criteria to search for specific records
Show child attributes
Show child attributes
Example:
{
"equals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"notEquals": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-15T10:30:00Z",
"updatedBy": "123e4567-e89b-12d3-a456-426614174000"
},
"timestamp": "2024-01-15T10:30:00Z",
"resourceID": "123e4567-e89b-12d3-a456-426614174000"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z"
},
"contains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"resourceID": ["123e4567-e89b-12d3-a456-426614174000"]
},
"notContains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"resourceID": ["123e4567-e89b-12d3-a456-426614174000"]
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
}
},
"orCondition": true
}
Response
Response for AuditEvent Search operation - returns filtered AuditEvent results
Array of AuditEvent objects
Show child attributes
Show child attributes
Example:
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"timestamp": "2024-08-01T00:00:00Z",
"resource": "Student",
"resourceID": "123e4567-e89b-12d3-a456-426614174000",
"type": "Delete"
}
]
Pagination information
Show child attributes
Show child attributes
Example:
{ "offset": 0, "limit": 1, "total": 100 }
⌘I