Include & Exclude

The "Include & Exclude" params are the simplest way to exclude or include items in your GET all responses. The most common use is when you want a light response, ex. in a struct response.

Params

KeyValue
includestring[]
excludestring[]

Use a list of string (id of parameters) to return or not the item in the response. Looks on right responses example how the initial data change with include & exclude parameter

Response samples for initial "Include & Exclude"
GET
/api/lib/{arke_id}/struct
{
    "content": {
        "count": 10,
        "items": [
            {
                "id": "id",
                "label": "ID",
                ...
            },
            {
                "id": "active",
                "label": "Active",
                ...
            },
            {
                "id": "code",
                "label": "Code",
                ...
            }
        ],
    }
    "messages": []
}

Response samples when change "Include & Exclude"
GET
/api/lib/arke/unit/{unit_id}
include=[id,code]
{
    "content": {
        "count": 10,
        "items": [
            {
                "id": "id",
                "label": "Code",
                ...
            }
            {
                "id": "code",
                "label": "Code",
                ...
            },
        ],
    }
    "messages": []
}

Response samples when change "Include & Exclude"
GET
/api/lib/arke/unit/{unit_id}
exclude=[id,active]
{
    "content": {
        "count": 10,
        "items": [
            {
                "id": "code",
                "label": "Code",
                ...
            }
        ],
    }
    "messages": []
}