Skip to content

Search Relationship Types

knutsenm edited this page Sep 25, 2014 · 3 revisions

Request

Method Endpoint
GET /relationship_types

Parameters

Any individual filter parameter is optional, but at least one is required to narrow the search results.

Name Type Description
filters[between] UUID,UUID The two Entity Types (comma separated) that must appear in the relationship, in either order
filters[involving] UUID The [[Entity Type
filters[:relationship_type_field] array Any top-level field of a Relationship Type can be the subject of a filter. For example, filters[relationship1]=husband

Response

GET /relationship_types?filters[involving]=2c627ffe-346a-11e4-a7ae-dfc13d6ed2d2

In this example, results are filtered to show only Relationship Types involving a ministry

{
    "relationship_types": [
        {
            "fields": [],
            "id": "2c7fac5a-346a-11e4-a7bf-6ffe51d55f13",
            "relationship1": {
                "entity_type": "person",
                "relationship_name": "person"
            },
            "relationship2": {
                "entity_type": "ministry",
                "relationship_name": "ministry"
            },
            "relationship_entity_type_id": "2c7f1010-346a-11e4-a7be-3b1fd9c1ee85"
        }
    ],
    "meta": {
        "from": 1,
        "page": 1,
        "to": 1,
        "total": 1,
        "total_pages": 1
    }
}
Clone this wiki locally