Get Free Trial
API reference
Table of contents

/members request

[starting from version: 2.8]

A request for all members of the field.

Request

{
    "type": "members",   
    "index": string,
    "field": FieldObject, 
    "filter": FilterObject | FilterGroupObject, 
    "page": number
}

The request has the following parameters:

  • type — String. The type of the request. In this case, it is "members".
  • index – String. The dataset identifier.
  • fieldFieldObject. The field whose members should be sent in the response.
  • filterFilterObject | FilterGroupObject. Filters that should be applied to members. filter is present in the request when multilevel hierarchies are configured in Flexmonster Pivot.
    The filter can be:
  • page – Number. The page number. It can be used to load members by parts. If the response contains pageTotal parameter, additional requests will be performed to load the remaining pages. Starts from 0.

Response

{
    "members"[]: {
        "value": string | number,
        "id": string
    },
    "sorted": boolean,
    "page": number,
    "pageTotal": number
}

The response has the following parameters:

  • members – Array of objects. It contains all the members. Each member has the following properties:
    • value – String|Number. The member’s value. In the case of a number field, it should be of type number. In the case of a date field, the members should be passed to Flexmonster as Unix timestamps in milliseconds, then dates are recognized correctly. For example, "2016-02-07" is 1454803200000 when converted to a Unix timestamp in milliseconds.
    • id optional – String. The member’s id. Supported only for string fields. If defined, it is used in queries and in responses to identify the member.
  • sorted optional – Boolean. If true, the members’ order from the response will be used as AZ order on the UI.
  • page optional – Number. The current page number. Starts from 0.
  • pageTotal optional – Number. The total number of pages. It can be used to load members by parts.

Examples

  1. Example with a string field
    Request:
    {
        "index": "data-set-123",
        "type": "members",
        "field": {
           "uniqueName": "city"
        },
        "page": 0
    }
    Response:
    {
        "members": [
            { "value": "Toronto" }, 
            { "value": "Montreal" }, 
            { "value": "New York" }
        ]
    }
  2. Example with a number field
    Request:
    {
        "index": "data-set-123",
        "type": "members",
        "field": {
           "uniqueName": "price"
        },
        "page": 0
    }
    Response:
    {
        "members": [
            { "value": 10 }, 
            { "value": 28 }, 
            { "value": 30 }
        ]
    }
  3. Example with a date field
    Request:
    {
        "index": "data-set-123",
        "type": "members",
        "field": {
           "uniqueName": "order_date"
        },
        "page": 0
    }
    Response:
    {
        "members": [
            { "value": 1562889600000 }, 
            { "value": 1564617600000 }, 
            { "value": 1564963200000 }
        ]
    }

See also

/handshake request
/fields request
/select request for pivot table
/select request for flat table
/select request for drill-through view