MeiroDocs

Attribute Aggregations

Required feature (one of):

Section: Group Attribute Aggregations. Base URL: https://instance_name.meiro.io/api/.

All Attributes' Aggregations [/attributes_aggregations{?limit,offset,order_by,order_dir,only_with_valid_attributes,load_full_structure}]

List All Attribute's Aggregations [GET]

Required feature (one of):

  • settings/insights

  • data/insights

  • segments/insights

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • order_by (string, optional) - Ordered column name
    • order_dir (string, optional) - Ordering direction
    • only_with_valid_attributes (number, optional) - Returns only aggregations with valid attributes
    • load_full_structure (number, optional) - Full data structure return flag
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attribute_aggregations": [
        {
            "id": 100,
            "user_id": 200,
            "attribute_id": 300,
            "sub_attribute_id": null,
            "function": "unique_values",
            "name": "example segment",
            "description": "segment description",
            "settings": {
                "count": 5
            },
            "frontend_settings": {},
            "disabled": 0,
            "order_index": 1000,
            "created": "2017-01-01 15:35:00"
        }
    ],
    "selection_settings": {
        "limit": 20,
        "offset": null,
        "order_by": "id",
        "order_dir": "ASC",
        "only_with_valid_attributes": 1
    }
}

Create an Attribute Aggregation [POST]

Required feature: settings/insights

  • Parameters

    • load_full_structure (number, optional) - Full data structure return flag
  • Attributes

    • name: example segments (string)
    • function: unique_values (string)
    • attribute_id: Attribute ID (string)
    • sub_attribute_id: Sub-attribute ID (string) - optional
    • settings: {"count": 5} (string) - optional (json)
    • frontend_settings: {} (string) - optional (json)
    • description: segment description (string) - optional
    • disabled: 0 (number) - optional
    • order_index: 1000 (number) - optional - set it to the existing entity's order index if you want to change the ordering
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 201 (application/json)

{
    "attribute_aggregation": {
        "id": 100,
        "user_id": 200,
        "attribute_id": 300,
        "sub_attribute_id": null,
        "function": "unique_values",
        "name": "example segment",
        "description": "segment description",
        "settings": {
            "count": 5
        },
        "frontend_settings": {},
        "disabled": 0,
        "order_index": 1000,
        "created": "2017-01-01 15:35:00"
    }
}

Attribute Aggregation [/attributes_aggregations/aggregations/{aggregation_id}{?load_full_structure}]

  • Parameters
    • load_full_structure (number, optional) - Full data structure return flag

Retrieve an Attribute Aggregation [GET]

Required feature (one of):

  • settings/insights

  • data/insights

  • segments/insights

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attribute_aggregation": {
        "id": 100,
        "user_id": 200,
        "attribute_id": 300,
        "sub_attribute_id": null,
        "function": "unique_values",
        "name": "example segment",
        "description": "segment description",
        "settings": {
            "count": 5
        },
        "frontend_settings": {},
        "disabled": 0,
        "order_index": 1000,
        "created": "2017-01-01 15:35:00"
    }
}

Modify an Attribute Aggregation [PATCH]

Required feature: settings/insights

  • Attributes

    • attribute_id: Attribute ID (string)
    • sub_attribute_id: Sub-attribute ID (string) - optional
    • name: example segments (string) - optional
    • function: unique_values (string) - optional
    • settings: {"count": 5} (string) - optional (json)
    • frontend_settings: {} (string) - optional (json)
    • description: segment description (string) - optional
    • disabled: 0 (number) - optional
    • order_index: 1000 (number) - optional - set it to the existing entity's order index if you want to change the ordering
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "attribute_aggregation": {
        "id": 100,
        "user_id": 200,
        "attribute_id": 300,
        "sub_attribute_id": null,
        "function": "unique_values",
        "name": "example segment",
        "description": "segment description",
        "settings": {
            "count": 5
        },
        "frontend_settings": {},
        "disabled": 0,
        "order_index": 1000,
        "created": "2017-01-01 15:35:00"
    }
}

Delete an Attribute Aggregation [DELETE]

Required feature: settings/insights

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "message": "OK"
}

Attribute Aggregation Reorder [/attributes_aggregations/aggregations/{aggregation_id}/reorder]

Change the order of an Attribute Aggregation [PATCH]

Required feature: settings/insights

  • Attributes

    • order_index: 1000 (number) - set it to the existing entity's new order index
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "message": "OK"
}

Attribute Checker [/attributes_checker]

Check an Attribute [POST]

Required feature:

  • settings/cdp_entities

  • Attributes

    • id: some (string)
    • customer_entity_id: 00000000-0000-0000-0000-000000000000 (string)
    • is_unique: false (boolean)
    • dimensions: [
{
    + id: `date` (string)
    + name: `Date` (string)
    + data_type: `datetime` (string)
},
{
    + id: `value` (string)
    + name: `Value` (string)
    + data_type: `string` (string)
}

] (array)

  • type: list (string)

  • filter: `` (string)

  • outer_value: `` (string)

  • sources: [] (array)

  • types: [] (array)

  • value: jsonb_build_array(event_time::text, payload ->> 'value'),

  • versions: [] (array)

  • weight: `` (string)

  • Request

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "data": [
        [
            {
                "cockroach": "2023-08-11T08:44:23",
                "opensearch": "2023-08-11T08:44:23",
                "error": "",
                "dimension": {
                    "id": "date",
                    "name": "Date",
                    "data_type": "datetime"
                }
            },
            {
                "cockroach": "0",
                "opensearch": "0",
                "error": "",
                "dimension": {
                    "id": "value",
                    "name": "Value",
                    "data_type": "string"
                }
            }
        ]
    ],
    "is_compound": true,
    "is_valid": true,
    "execution_time_milli_seconds": 1,
    "errors": null
}

On this page