Skip to main content
POST
/
student
/
_search
Python (SDK)
from datetime import date
from meitner import Meitner, models
from meitner.utils import parse_datetime
import os


with Meitner(
    security=models.Security(
        client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
        client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
    ),
) as m_client:

    res = m_client.students.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",
            },
            "identity_number": "example",
            "identity_temporary": True,
            "first_name": "example",
            "last_name": "example",
            "date_of_birth": date.fromisoformat("2024-01-15"),
            "address": {
                "postal_address": "example",
                "postal_code": "example",
                "postal_city": "example",
                "country_code": "example",
                "municipality_code": "example",
            },
            "email_address1": "example",
            "email_address2": "example",
            "phone_number1": "example",
            "phone_number2": "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",
            },
            "identity_number": "example",
            "identity_temporary": True,
            "first_name": "example",
            "last_name": "example",
            "date_of_birth": date.fromisoformat("2024-01-15"),
            "address": {
                "postal_address": "example",
                "postal_code": "example",
                "postal_city": "example",
                "country_code": "example",
                "municipality_code": "example",
            },
            "email_address1": "example",
            "email_address2": "example",
            "phone_number1": "example",
            "phone_number2": "example",
        },
        "greater_than": {
            "meta": {
                "created_at": parse_datetime("2024-01-15T10:30:00Z"),
                "updated_at": parse_datetime("2024-01-15T10:30:00Z"),
            },
            "date_of_birth": date.fromisoformat("2024-01-15"),
        },
        "smaller_than": {
            "meta": {
                "created_at": parse_datetime("2024-01-15T10:30:00Z"),
                "updated_at": parse_datetime("2024-01-15T10:30:00Z"),
            },
            "date_of_birth": date.fromisoformat("2024-01-15"),
        },
        "greater_or_equal": {
            "meta": {
                "created_at": parse_datetime("2024-01-15T10:30:00Z"),
                "updated_at": parse_datetime("2024-01-15T10:30:00Z"),
            },
            "date_of_birth": date.fromisoformat("2024-01-15"),
        },
        "smaller_or_equal": {
            "meta": {
                "created_at": parse_datetime("2024-01-15T10:30:00Z"),
                "updated_at": parse_datetime("2024-01-15T10:30:00Z"),
            },
            "date_of_birth": date.fromisoformat("2024-01-15"),
        },
        "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",
                ],
            },
            "identity_number": [
                "example",
            ],
            "identity_temporary": [
                True,
            ],
            "first_name": [
                "example",
            ],
            "last_name": [
                "example",
            ],
            "date_of_birth": [
                date.fromisoformat("2024-01-15"),
            ],
            "address": {
                "postal_address": [
                    "example",
                ],
                "postal_code": [
                    "example",
                ],
                "postal_city": [
                    "example",
                ],
                "country_code": [
                    "example",
                ],
                "municipality_code": [
                    "example",
                ],
            },
            "email_address1": [
                "example",
            ],
            "email_address2": [
                "example",
            ],
            "phone_number1": [
                "example",
            ],
            "phone_number2": [
                "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",
                ],
            },
            "identity_number": [
                "example",
            ],
            "identity_temporary": [
                True,
            ],
            "first_name": [
                "example",
            ],
            "last_name": [
                "example",
            ],
            "date_of_birth": [
                date.fromisoformat("2024-01-15"),
            ],
            "address": {
                "postal_address": [
                    "example",
                ],
                "postal_code": [
                    "example",
                ],
                "postal_city": [
                    "example",
                ],
                "country_code": [
                    "example",
                ],
                "municipality_code": [
                    "example",
                ],
            },
            "email_address1": [
                "example",
            ],
            "email_address2": [
                "example",
            ],
            "phone_number1": [
                "example",
            ],
            "phone_number2": [
                "example",
            ],
        },
        "like": {
            "external": {
                "source_id": "example",
                "source": "example",
            },
            "identity_number": "example",
            "first_name": "example",
            "last_name": "example",
            "address": {
                "postal_address": "example",
                "postal_code": "example",
                "postal_city": "example",
                "country_code": "example",
                "municipality_code": "example",
            },
            "email_address1": "example",
            "email_address2": "example",
            "phone_number1": "example",
            "phone_number2": "example",
        },
        "not_like": {
            "external": {
                "source_id": "example",
                "source": "example",
            },
            "identity_number": "example",
            "first_name": "example",
            "last_name": "example",
            "address": {
                "postal_address": "example",
                "postal_code": "example",
                "postal_city": "example",
                "country_code": "example",
                "municipality_code": "example",
            },
            "email_address1": "example",
            "email_address2": "example",
            "phone_number1": "example",
            "phone_number2": "example",
        },
        "null": {
            "meta": {
                "created_by": True,
                "updated_at": True,
                "updated_by": True,
            },
            "external": {
                "source_id": True,
                "source": True,
            },
            "gender": True,
            "date_of_birth": True,
            "address": {
                "postal_address": True,
                "postal_code": True,
                "postal_city": True,
                "country_code": True,
                "municipality_code": True,
            },
            "email_address1": True,
            "email_address2": True,
            "phone_number1": True,
            "phone_number2": True,
        },
        "not_null": {
            "meta": {
                "created_by": True,
                "updated_at": True,
                "updated_by": True,
            },
            "external": {
                "source_id": True,
                "source": True,
            },
            "gender": True,
            "date_of_birth": True,
            "address": {
                "postal_address": True,
                "postal_code": True,
                "postal_city": True,
                "country_code": True,
                "municipality_code": True,
            },
            "email_address1": True,
            "email_address2": True,
            "phone_number1": True,
            "phone_number2": True,
        },
        "or_condition": True,
    }, limit=1, offset=0)

    while res is not None:
        # Handle items

        res = res.next()
{
  "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"
      },
      "gender": "Female",
      "identityNumber": "20191216-1234",
      "identityTemporary": true,
      "firstName": "Lise",
      "lastName": "Meitner",
      "dateOfBirth": "2019-12-16",
      "address": {
        "postalAddress": "Dalvägen 14",
        "postalCode": "169 56",
        "postalCity": "Solna",
        "countryCode": "SWE",
        "municipalityCode": "0184"
      },
      "emailAddress1": "[email protected]",
      "emailAddress2": "[email protected]",
      "phoneNumber1": "+46701234567",
      "phoneNumber2": "example"
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 1,
    "total": 100
  }
}

Authorizations

Client-ID
string
header
required
Client-Secret
string
header
required

Query Parameters

limit
integer
default:50

The maximum number of Students to return (default: 50) when searching Students

offset
integer
default:0

The number of Students to skip before starting to return results (default: 0) when searching Students

Body

application/json

Request body

filter
object
required

Filter criteria to search for specific records

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"
},
"identityNumber": "example",
"identityTemporary": true,
"firstName": "example",
"lastName": "example",
"dateOfBirth": "2024-01-15",
"address": {
"postalAddress": "example",
"postalCode": "example",
"postalCity": "example",
"countryCode": "example",
"municipalityCode": "example"
},
"emailAddress1": "example",
"emailAddress2": "example",
"phoneNumber1": "example",
"phoneNumber2": "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"
},
"identityNumber": "example",
"identityTemporary": true,
"firstName": "example",
"lastName": "example",
"dateOfBirth": "2024-01-15",
"address": {
"postalAddress": "example",
"postalCode": "example",
"postalCity": "example",
"countryCode": "example",
"municipalityCode": "example"
},
"emailAddress1": "example",
"emailAddress2": "example",
"phoneNumber1": "example",
"phoneNumber2": "example"
},
"greaterThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"dateOfBirth": "2024-01-15"
},
"smallerThan": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"dateOfBirth": "2024-01-15"
},
"greaterOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"dateOfBirth": "2024-01-15"
},
"smallerOrEqual": {
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"dateOfBirth": "2024-01-15"
},
"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"]
},
"identityNumber": ["example"],
"identityTemporary": [true],
"firstName": ["example"],
"lastName": ["example"],
"dateOfBirth": ["2024-01-15"],
"address": {
"postalAddress": ["example"],
"postalCode": ["example"],
"postalCity": ["example"],
"countryCode": ["example"],
"municipalityCode": ["example"]
},
"emailAddress1": ["example"],
"emailAddress2": ["example"],
"phoneNumber1": ["example"],
"phoneNumber2": ["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"]
},
"identityNumber": ["example"],
"identityTemporary": [true],
"firstName": ["example"],
"lastName": ["example"],
"dateOfBirth": ["2024-01-15"],
"address": {
"postalAddress": ["example"],
"postalCode": ["example"],
"postalCity": ["example"],
"countryCode": ["example"],
"municipalityCode": ["example"]
},
"emailAddress1": ["example"],
"emailAddress2": ["example"],
"phoneNumber1": ["example"],
"phoneNumber2": ["example"]
},
"like": {
"external": {
"sourceID": "example",
"source": "example"
},
"identityNumber": "example",
"firstName": "example",
"lastName": "example",
"address": {
"postalAddress": "example",
"postalCode": "example",
"postalCity": "example",
"countryCode": "example",
"municipalityCode": "example"
},
"emailAddress1": "example",
"emailAddress2": "example",
"phoneNumber1": "example",
"phoneNumber2": "example"
},
"notLike": {
"external": {
"sourceID": "example",
"source": "example"
},
"identityNumber": "example",
"firstName": "example",
"lastName": "example",
"address": {
"postalAddress": "example",
"postalCode": "example",
"postalCity": "example",
"countryCode": "example",
"municipalityCode": "example"
},
"emailAddress1": "example",
"emailAddress2": "example",
"phoneNumber1": "example",
"phoneNumber2": "example"
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"gender": true,
"dateOfBirth": true,
"address": {
"postalAddress": true,
"postalCode": true,
"postalCity": true,
"countryCode": true,
"municipalityCode": true
},
"emailAddress1": true,
"emailAddress2": true,
"phoneNumber1": true,
"phoneNumber2": true
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"gender": true,
"dateOfBirth": true,
"address": {
"postalAddress": true,
"postalCode": true,
"postalCity": true,
"countryCode": true,
"municipalityCode": true
},
"emailAddress1": true,
"emailAddress2": true,
"phoneNumber1": true,
"phoneNumber2": true
},
"orCondition": true
}

Response

Response for Student Search operation - returns filtered Student results

data
object[]

Array of Student objects

pagination
object

Pagination information

Example:
{ "offset": 0, "limit": 1, "total": 100 }