Filter variables

Filters a and sorts all active dataset's variables into a paginated resultset.

{success} This is a public route


Method Uri Auth Permissions
POST /v1/variables/filter none none

Headers

The API requires a header Accept to be submitted with the request:

{
    "Accept": "application/json"
}

Query Params

In case of using different pagination counts than the default (15), add limit to the url parameters.

Param Options
direction asc, desc
order name, label, description, importance, category
limit 0, 1, 10, ...
page 1, 2, 5, ...

Data constraints

{
    "categories": [
        "0171f82c-b5c0-423d-97c3-cad5c9d402fb"
    ],
    "measured_at": [
        "Baseline"
    ],
    "dataset": [
        "Dataset 2 (N=3451)",
        "iPRO (N=900)"
    ],
    "importance": [
        "Most important variables"
    ],
    "query": ["string"],
    "fields": ["in:name,label,description,keywords,category"]
}

Success Responses

Condition : All required data provided is valid and added to the request body.

Code : 200 Okay

Content example : Response will reflect back the entities:

{
    "data": [
        {
            "id": "9d86e2f3-e4c9-41c7-8a9a-53104656ceaf",
            "importance": "Most important variables",
            "name": "AMI rose",
            "description": "Presence of history of acute myocardial infactionb, self-reported in Rose Questionnaire*.->based on syntax Hoorn study dated 3-5-1999.b\u00ac= question B1_VD1_3.31: \u2018Have you ever had a myocardial infarction?\u2019",
            "label": "History of MI, self-reported in Rose Questionnaire",
            "measured_at": [
                "Baseline"
            ],
            "dataset": [
                "Dataset 2 (N=3451)",
                "Dataset 3 (N=7689)",
                "iPRO (N=900)"
            ],
            "categories": [
                {
                    "id": "0171f82c-b5c0-423d-97c3-cad5c9d402fb",
                    "name": "Rose_Questionnaire"
                },
                ...
            ]
        },
        ...
    ],
    "filters": {
        "importance": [
            "Most important variables"
        ],
        "dataset": [
            "Dataset 2 (N=3451)",
            "Dataset 3 (N=7689)",
            "iPRO (N=900)"
        ],
        "measured_at": [
            "Baseline"
        ]
    },
    "links": {
        "first": "http:\/\/dms.test\/v1\/variables\/filter?page=1",
        "last": "http:\/\/dms.test\/v1\/variables\/filter?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "http:\/\/dms.test\/v1\/variables\/filter?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "http:\/\/dms.test\/v1\/variables\/filter",
        "per_page": "5",
        "to": 5,
        "total": 5
    }
}