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.SchoolSearchResponse? res = await sdk.Schools.SearchAsync(
schoolSearch: new SchoolSearchRequestBody() {
Filter = new SchoolSearchFilter() {
Equals = new SchoolSearchEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new SchoolSearchEqualsMeta() {
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",
},
External = new SchoolSearchEqualsExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitID = "123e4567-e89b-12d3-a456-426614174000",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
NotEquals = new SchoolSearchNotEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new SchoolSearchNotEqualsMeta() {
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",
},
External = new SchoolSearchNotEqualsExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitID = "123e4567-e89b-12d3-a456-426614174000",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
GreaterThan = new SchoolSearchGreaterThan() {
Meta = new SchoolSearchGreaterThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
SmallerThan = new SchoolSearchSmallerThan() {
Meta = new SchoolSearchSmallerThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
GreaterOrEqual = new SchoolSearchGreaterOrEqual() {
Meta = new SchoolSearchGreaterOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
SmallerOrEqual = new SchoolSearchSmallerOrEqual() {
Meta = new SchoolSearchSmallerOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
Contains = new SchoolSearchContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new SchoolSearchContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
External = new SchoolSearchContainsExternal() {
SourceID = new List<string>() {
"example",
},
Source = new List<string>() {
"example",
},
},
Title = new List<string>() {
"example",
},
UnitID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UnitCode = new List<string>() {
"example",
},
CsnSchoolCode = new List<string>() {
"example",
},
MunicipalityCode = new List<string>() {
"example",
},
},
NotContains = new SchoolSearchNotContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new SchoolSearchNotContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
External = new SchoolSearchNotContainsExternal() {
SourceID = new List<string>() {
"example",
},
Source = new List<string>() {
"example",
},
},
Title = new List<string>() {
"example",
},
UnitID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UnitCode = new List<string>() {
"example",
},
CsnSchoolCode = new List<string>() {
"example",
},
MunicipalityCode = new List<string>() {
"example",
},
},
Like = new SchoolSearchLike() {
External = new SchoolSearchLikeExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
NotLike = new SchoolSearchNotLike() {
External = new SchoolSearchNotLikeExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
Null = new SchoolSearchNull() {
Meta = new SchoolSearchNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
External = new SchoolSearchNullExternal() {
SourceID = true,
Source = true,
},
UnitID = true,
UnitCode = true,
CsnSchoolCode = true,
MunicipalityCode = true,
},
NotNull = new SchoolSearchNotNull() {
Meta = new SchoolSearchNotNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
External = new SchoolSearchNotNullExternal() {
SourceID = true,
Source = true,
},
UnitID = true,
UnitCode = true,
CsnSchoolCode = true,
MunicipalityCode = 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.schools.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",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_id": "123e4567-e89b-12d3-a456-426614174000",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"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",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_id": "123e4567-e89b-12d3-a456-426614174000",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": 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"),
},
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": 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"),
},
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"not_like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_id": True,
"unit_code": True,
"csn_school_code": True,
"municipality_code": True,
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_id": True,
"unit_code": True,
"csn_school_code": True,
"municipality_code": 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/school/_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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "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"
]
},
"external": {
"sourceID": [
"example"
],
"source": [
"example"
]
},
"title": [
"example"
],
"unitID": [
"123e4567-e89b-12d3-a456-426614174000"
],
"unitCode": [
"example"
],
"csnSchoolCode": [
"example"
],
"municipalityCode": [
"example"
]
},
"notContains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000"
],
"meta": {
"createdBy": [
"123e4567-e89b-12d3-a456-426614174000"
],
"updatedBy": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"external": {
"sourceID": [
"example"
],
"source": [
"example"
]
},
"title": [
"example"
],
"unitID": [
"123e4567-e89b-12d3-a456-426614174000"
],
"unitCode": [
"example"
],
"csnSchoolCode": [
"example"
],
"municipalityCode": [
"example"
]
},
"like": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"notLike": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": {
"sourceID": true,
"source": true
},
"unitID": true,
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": {
"sourceID": true,
"source": true
},
"unitID": true,
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": 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'
},
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitID: '123e4567-e89b-12d3-a456-426614174000',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
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'
},
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitID: '123e4567-e89b-12d3-a456-426614174000',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
greaterThan: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'}},
smallerThan: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'}},
greaterOrEqual: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'}},
smallerOrEqual: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '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']
},
external: {sourceID: ['example'], source: ['example']},
title: ['example'],
unitID: ['123e4567-e89b-12d3-a456-426614174000'],
unitCode: ['example'],
csnSchoolCode: ['example'],
municipalityCode: ['example']
},
notContains: {
id: ['123e4567-e89b-12d3-a456-426614174000'],
meta: {
createdBy: ['123e4567-e89b-12d3-a456-426614174000'],
updatedBy: ['123e4567-e89b-12d3-a456-426614174000']
},
external: {sourceID: ['example'], source: ['example']},
title: ['example'],
unitID: ['123e4567-e89b-12d3-a456-426614174000'],
unitCode: ['example'],
csnSchoolCode: ['example'],
municipalityCode: ['example']
},
like: {
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
notLike: {
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
null: {
meta: {createdBy: true, updatedAt: true, updatedBy: true},
external: {sourceID: true, source: true},
unitID: true,
unitCode: true,
csnSchoolCode: true,
municipalityCode: true
},
notNull: {
meta: {createdBy: true, updatedAt: true, updatedBy: true},
external: {sourceID: true, source: true},
unitID: true,
unitCode: true,
csnSchoolCode: true,
municipalityCode: true
},
orCondition: true
}
})
};
fetch('https://api.meitner.se/directory/v1/school/_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/school/_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'
],
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitID' => '123e4567-e89b-12d3-a456-426614174000',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'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'
],
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitID' => '123e4567-e89b-12d3-a456-426614174000',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'greaterThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
]
],
'smallerThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
]
],
'greaterOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
]
],
'smallerOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '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'
]
],
'external' => [
'sourceID' => [
'example'
],
'source' => [
'example'
]
],
'title' => [
'example'
],
'unitID' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'unitCode' => [
'example'
],
'csnSchoolCode' => [
'example'
],
'municipalityCode' => [
'example'
]
],
'notContains' => [
'id' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'meta' => [
'createdBy' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'updatedBy' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'external' => [
'sourceID' => [
'example'
],
'source' => [
'example'
]
],
'title' => [
'example'
],
'unitID' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'unitCode' => [
'example'
],
'csnSchoolCode' => [
'example'
],
'municipalityCode' => [
'example'
]
],
'like' => [
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'notLike' => [
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'null' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
],
'external' => [
'sourceID' => true,
'source' => true
],
'unitID' => true,
'unitCode' => true,
'csnSchoolCode' => true,
'municipalityCode' => true
],
'notNull' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
],
'external' => [
'sourceID' => true,
'source' => true
],
'unitID' => true,
'unitCode' => true,
'csnSchoolCode' => true,
'municipalityCode' => 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/school/_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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\n ]\n },\n \"like\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"notLike\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\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/school/_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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\n ]\n },\n \"like\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"notLike\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"orCondition\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meitner.se/directory/v1/school/_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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\n ]\n },\n \"like\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"notLike\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\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"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"title": "Meitner Grundskola",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "12345678",
"csnSchoolCode": "12345",
"municipalityCode": "0184",
"schoolType": "GR"
}
],
"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 School 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"
}
}School
Search Schools
Search for Schools with filtering capabilities.
POST
/
school
/
_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.SchoolSearchResponse? res = await sdk.Schools.SearchAsync(
schoolSearch: new SchoolSearchRequestBody() {
Filter = new SchoolSearchFilter() {
Equals = new SchoolSearchEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new SchoolSearchEqualsMeta() {
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",
},
External = new SchoolSearchEqualsExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitID = "123e4567-e89b-12d3-a456-426614174000",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
NotEquals = new SchoolSearchNotEquals() {
Id = "123e4567-e89b-12d3-a456-426614174000",
Meta = new SchoolSearchNotEqualsMeta() {
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",
},
External = new SchoolSearchNotEqualsExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitID = "123e4567-e89b-12d3-a456-426614174000",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
GreaterThan = new SchoolSearchGreaterThan() {
Meta = new SchoolSearchGreaterThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
SmallerThan = new SchoolSearchSmallerThan() {
Meta = new SchoolSearchSmallerThanMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
GreaterOrEqual = new SchoolSearchGreaterOrEqual() {
Meta = new SchoolSearchGreaterOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
SmallerOrEqual = new SchoolSearchSmallerOrEqual() {
Meta = new SchoolSearchSmallerOrEqualMeta() {
CreatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
UpdatedAt = System.DateTime.Parse("2024-01-15T10:30:00Z").ToUniversalTime(),
},
},
Contains = new SchoolSearchContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new SchoolSearchContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
External = new SchoolSearchContainsExternal() {
SourceID = new List<string>() {
"example",
},
Source = new List<string>() {
"example",
},
},
Title = new List<string>() {
"example",
},
UnitID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UnitCode = new List<string>() {
"example",
},
CsnSchoolCode = new List<string>() {
"example",
},
MunicipalityCode = new List<string>() {
"example",
},
},
NotContains = new SchoolSearchNotContains() {
Id = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
Meta = new SchoolSearchNotContainsMeta() {
CreatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UpdatedBy = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
},
External = new SchoolSearchNotContainsExternal() {
SourceID = new List<string>() {
"example",
},
Source = new List<string>() {
"example",
},
},
Title = new List<string>() {
"example",
},
UnitID = new List<string>() {
"123e4567-e89b-12d3-a456-426614174000",
},
UnitCode = new List<string>() {
"example",
},
CsnSchoolCode = new List<string>() {
"example",
},
MunicipalityCode = new List<string>() {
"example",
},
},
Like = new SchoolSearchLike() {
External = new SchoolSearchLikeExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
NotLike = new SchoolSearchNotLike() {
External = new SchoolSearchNotLikeExternal() {
SourceID = "example",
Source = "example",
},
Title = "example",
UnitCode = "example",
CsnSchoolCode = "example",
MunicipalityCode = "example",
},
Null = new SchoolSearchNull() {
Meta = new SchoolSearchNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
External = new SchoolSearchNullExternal() {
SourceID = true,
Source = true,
},
UnitID = true,
UnitCode = true,
CsnSchoolCode = true,
MunicipalityCode = true,
},
NotNull = new SchoolSearchNotNull() {
Meta = new SchoolSearchNotNullMeta() {
CreatedBy = true,
UpdatedAt = true,
UpdatedBy = true,
},
External = new SchoolSearchNotNullExternal() {
SourceID = true,
Source = true,
},
UnitID = true,
UnitCode = true,
CsnSchoolCode = true,
MunicipalityCode = 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.schools.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",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_id": "123e4567-e89b-12d3-a456-426614174000",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"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",
},
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_id": "123e4567-e89b-12d3-a456-426614174000",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"greater_than": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": 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"),
},
},
"greater_or_equal": {
"meta": {
"created_at": parse_datetime("2024-01-15T10:30:00Z"),
"updated_at": 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"),
},
},
"contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"not_contains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"meta": {
"created_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
"updated_by": [
"123e4567-e89b-12d3-a456-426614174000",
],
},
"external": {
"source_id": [
"example",
],
"source": [
"example",
],
},
"title": [
"example",
],
"unit_id": [
"123e4567-e89b-12d3-a456-426614174000",
],
"unit_code": [
"example",
],
"csn_school_code": [
"example",
],
"municipality_code": [
"example",
],
},
"like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"not_like": {
"external": {
"source_id": "example",
"source": "example",
},
"title": "example",
"unit_code": "example",
"csn_school_code": "example",
"municipality_code": "example",
},
"null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_id": True,
"unit_code": True,
"csn_school_code": True,
"municipality_code": True,
},
"not_null": {
"meta": {
"created_by": True,
"updated_at": True,
"updated_by": True,
},
"external": {
"source_id": True,
"source": True,
},
"unit_id": True,
"unit_code": True,
"csn_school_code": True,
"municipality_code": 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/school/_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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "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"
]
},
"external": {
"sourceID": [
"example"
],
"source": [
"example"
]
},
"title": [
"example"
],
"unitID": [
"123e4567-e89b-12d3-a456-426614174000"
],
"unitCode": [
"example"
],
"csnSchoolCode": [
"example"
],
"municipalityCode": [
"example"
]
},
"notContains": {
"id": [
"123e4567-e89b-12d3-a456-426614174000"
],
"meta": {
"createdBy": [
"123e4567-e89b-12d3-a456-426614174000"
],
"updatedBy": [
"123e4567-e89b-12d3-a456-426614174000"
]
},
"external": {
"sourceID": [
"example"
],
"source": [
"example"
]
},
"title": [
"example"
],
"unitID": [
"123e4567-e89b-12d3-a456-426614174000"
],
"unitCode": [
"example"
],
"csnSchoolCode": [
"example"
],
"municipalityCode": [
"example"
]
},
"like": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"notLike": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": {
"sourceID": true,
"source": true
},
"unitID": true,
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": {
"sourceID": true,
"source": true
},
"unitID": true,
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": 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'
},
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitID: '123e4567-e89b-12d3-a456-426614174000',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
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'
},
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitID: '123e4567-e89b-12d3-a456-426614174000',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
greaterThan: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'}},
smallerThan: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'}},
greaterOrEqual: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-01-15T10:30:00Z'}},
smallerOrEqual: {meta: {createdAt: '2024-01-15T10:30:00Z', updatedAt: '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']
},
external: {sourceID: ['example'], source: ['example']},
title: ['example'],
unitID: ['123e4567-e89b-12d3-a456-426614174000'],
unitCode: ['example'],
csnSchoolCode: ['example'],
municipalityCode: ['example']
},
notContains: {
id: ['123e4567-e89b-12d3-a456-426614174000'],
meta: {
createdBy: ['123e4567-e89b-12d3-a456-426614174000'],
updatedBy: ['123e4567-e89b-12d3-a456-426614174000']
},
external: {sourceID: ['example'], source: ['example']},
title: ['example'],
unitID: ['123e4567-e89b-12d3-a456-426614174000'],
unitCode: ['example'],
csnSchoolCode: ['example'],
municipalityCode: ['example']
},
like: {
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
notLike: {
external: {sourceID: 'example', source: 'example'},
title: 'example',
unitCode: 'example',
csnSchoolCode: 'example',
municipalityCode: 'example'
},
null: {
meta: {createdBy: true, updatedAt: true, updatedBy: true},
external: {sourceID: true, source: true},
unitID: true,
unitCode: true,
csnSchoolCode: true,
municipalityCode: true
},
notNull: {
meta: {createdBy: true, updatedAt: true, updatedBy: true},
external: {sourceID: true, source: true},
unitID: true,
unitCode: true,
csnSchoolCode: true,
municipalityCode: true
},
orCondition: true
}
})
};
fetch('https://api.meitner.se/directory/v1/school/_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/school/_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'
],
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitID' => '123e4567-e89b-12d3-a456-426614174000',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'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'
],
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitID' => '123e4567-e89b-12d3-a456-426614174000',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'greaterThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
]
],
'smallerThan' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
]
],
'greaterOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '2024-01-15T10:30:00Z'
]
],
'smallerOrEqual' => [
'meta' => [
'createdAt' => '2024-01-15T10:30:00Z',
'updatedAt' => '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'
]
],
'external' => [
'sourceID' => [
'example'
],
'source' => [
'example'
]
],
'title' => [
'example'
],
'unitID' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'unitCode' => [
'example'
],
'csnSchoolCode' => [
'example'
],
'municipalityCode' => [
'example'
]
],
'notContains' => [
'id' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'meta' => [
'createdBy' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'updatedBy' => [
'123e4567-e89b-12d3-a456-426614174000'
]
],
'external' => [
'sourceID' => [
'example'
],
'source' => [
'example'
]
],
'title' => [
'example'
],
'unitID' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'unitCode' => [
'example'
],
'csnSchoolCode' => [
'example'
],
'municipalityCode' => [
'example'
]
],
'like' => [
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'notLike' => [
'external' => [
'sourceID' => 'example',
'source' => 'example'
],
'title' => 'example',
'unitCode' => 'example',
'csnSchoolCode' => 'example',
'municipalityCode' => 'example'
],
'null' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
],
'external' => [
'sourceID' => true,
'source' => true
],
'unitID' => true,
'unitCode' => true,
'csnSchoolCode' => true,
'municipalityCode' => true
],
'notNull' => [
'meta' => [
'createdBy' => true,
'updatedAt' => true,
'updatedBy' => true
],
'external' => [
'sourceID' => true,
'source' => true
],
'unitID' => true,
'unitCode' => true,
'csnSchoolCode' => true,
'municipalityCode' => 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/school/_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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\n ]\n },\n \"like\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"notLike\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\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/school/_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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\n ]\n },\n \"like\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"notLike\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"orCondition\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meitner.se/directory/v1/school/_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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\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 \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitID\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"greaterThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerThan\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"greaterOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\n },\n \"smallerOrEqual\": {\n \"meta\": {\n \"createdAt\": \"2024-01-15T10:30:00Z\",\n \"updatedAt\": \"2024-01-15T10:30:00Z\"\n }\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\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 \"external\": {\n \"sourceID\": [\n \"example\"\n ],\n \"source\": [\n \"example\"\n ]\n },\n \"title\": [\n \"example\"\n ],\n \"unitID\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"unitCode\": [\n \"example\"\n ],\n \"csnSchoolCode\": [\n \"example\"\n ],\n \"municipalityCode\": [\n \"example\"\n ]\n },\n \"like\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"notLike\": {\n \"external\": {\n \"sourceID\": \"example\",\n \"source\": \"example\"\n },\n \"title\": \"example\",\n \"unitCode\": \"example\",\n \"csnSchoolCode\": \"example\",\n \"municipalityCode\": \"example\"\n },\n \"null\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\n },\n \"notNull\": {\n \"meta\": {\n \"createdBy\": true,\n \"updatedAt\": true,\n \"updatedBy\": true\n },\n \"external\": {\n \"sourceID\": true,\n \"source\": true\n },\n \"unitID\": true,\n \"unitCode\": true,\n \"csnSchoolCode\": true,\n \"municipalityCode\": true\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"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"title": "Meitner Grundskola",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "12345678",
"csnSchoolCode": "12345",
"municipalityCode": "0184",
"schoolType": "GR"
}
],
"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 School 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 Schools to return (default: 50) when searching Schools
Example:
1
The number of Schools to skip before starting to return results (default: 0) when searching Schools
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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "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"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"title": ["example"],
"unitID": ["123e4567-e89b-12d3-a456-426614174000"],
"unitCode": ["example"],
"csnSchoolCode": ["example"],
"municipalityCode": ["example"]
},
"notContains": {
"id": ["123e4567-e89b-12d3-a456-426614174000"],
"meta": {
"createdBy": ["123e4567-e89b-12d3-a456-426614174000"],
"updatedBy": ["123e4567-e89b-12d3-a456-426614174000"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"title": ["example"],
"unitID": ["123e4567-e89b-12d3-a456-426614174000"],
"unitCode": ["example"],
"csnSchoolCode": ["example"],
"municipalityCode": ["example"]
},
"like": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"notLike": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example",
"unitCode": "example",
"csnSchoolCode": "example",
"municipalityCode": "example"
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"unitID": true,
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"unitID": true,
"unitCode": true,
"csnSchoolCode": true,
"municipalityCode": true
},
"orCondition": true
}
Response
Response for School Search operation - returns filtered School results
Array of School 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"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"title": "Meitner Grundskola",
"unitID": "123e4567-e89b-12d3-a456-426614174000",
"unitCode": "12345678",
"csnSchoolCode": "12345",
"municipalityCode": "0184",
"schoolType": "GR"
}
]
Pagination information
Show child attributes
Show child attributes
Example:
{ "offset": 0, "limit": 1, "total": 100 }
⌘I