Skip to main content
POST
/
group
/
_search
Python (SDK)
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.groups.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",
            },
            "school_id": "123e4567-e89b-12d3-a456-426614174000",
            "title": "example",
            "moderator_i_ds": "123e4567-e89b-12d3-a456-426614174000",
            "member_i_ds": "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",
            },
            "external": {
                "source_id": "example",
                "source": "example",
            },
            "school_id": "123e4567-e89b-12d3-a456-426614174000",
            "title": "example",
            "moderator_i_ds": "123e4567-e89b-12d3-a456-426614174000",
            "member_i_ds": "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"),
            },
        },
        "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",
                ],
            },
            "school_id": [
                "123e4567-e89b-12d3-a456-426614174000",
            ],
            "title": [
                "example",
            ],
            "moderator_i_ds": [
                "123e4567-e89b-12d3-a456-426614174000",
            ],
            "member_i_ds": [
                "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",
                ],
            },
            "external": {
                "source_id": [
                    "example",
                ],
                "source": [
                    "example",
                ],
            },
            "school_id": [
                "123e4567-e89b-12d3-a456-426614174000",
            ],
            "title": [
                "example",
            ],
            "moderator_i_ds": [
                "123e4567-e89b-12d3-a456-426614174000",
            ],
            "member_i_ds": [
                "123e4567-e89b-12d3-a456-426614174000",
            ],
        },
        "like": {
            "external": {
                "source_id": "example",
                "source": "example",
            },
            "title": "example",
        },
        "not_like": {
            "external": {
                "source_id": "example",
                "source": "example",
            },
            "title": "example",
        },
        "null": {
            "meta": {
                "created_by": True,
                "updated_at": True,
                "updated_by": True,
            },
            "external": {
                "source_id": True,
                "source": True,
            },
            "types": True,
            "moderator_i_ds": True,
            "member_i_ds": True,
        },
        "not_null": {
            "meta": {
                "created_by": True,
                "updated_at": True,
                "updated_by": True,
            },
            "external": {
                "source_id": True,
                "source": True,
            },
            "types": True,
            "moderator_i_ds": True,
            "member_i_ds": 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"
      },
      "schoolID": "123e4567-e89b-12d3-a456-426614174000",
      "category": "Education",
      "title": "1A",
      "types": [
        "Class"
      ],
      "moderatorIDs": [
        "123e4567-e89b-12d3-a456-426614174000"
      ],
      "memberIDs": [
        "123e4567-e89b-12d3-a456-426614174000"
      ]
    }
  ],
  "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 Groups to return (default: 50) when searching Groups

offset
integer
default:0

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

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"
},
"schoolID": "123e4567-e89b-12d3-a456-426614174000",
"title": "example",
"moderatorIDs": "123e4567-e89b-12d3-a456-426614174000",
"memberIDs": "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"
},
"external": {
"sourceID": "example",
"source": "example"
},
"schoolID": "123e4567-e89b-12d3-a456-426614174000",
"title": "example",
"moderatorIDs": "123e4567-e89b-12d3-a456-426614174000",
"memberIDs": "123e4567-e89b-12d3-a456-426614174000"
},
"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"]
},
"schoolID": ["123e4567-e89b-12d3-a456-426614174000"],
"title": ["example"],
"moderatorIDs": ["123e4567-e89b-12d3-a456-426614174000"],
"memberIDs": ["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"]
},
"external": {
"sourceID": ["example"],
"source": ["example"]
},
"schoolID": ["123e4567-e89b-12d3-a456-426614174000"],
"title": ["example"],
"moderatorIDs": ["123e4567-e89b-12d3-a456-426614174000"],
"memberIDs": ["123e4567-e89b-12d3-a456-426614174000"]
},
"like": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example"
},
"notLike": {
"external": {
"sourceID": "example",
"source": "example"
},
"title": "example"
},
"null": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"types": true,
"moderatorIDs": true,
"memberIDs": true
},
"notNull": {
"meta": {
"createdBy": true,
"updatedAt": true,
"updatedBy": true
},
"external": { "sourceID": true, "source": true },
"types": true,
"moderatorIDs": true,
"memberIDs": true
},
"orCondition": true
}

Response

Response for Group Search operation - returns filtered Group results

data
object[]

Array of Group objects

pagination
object

Pagination information

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