The structure of the audience is defined by its fields. In the Connect user interface they are called contact attributes. The maximum number of contact attributes within an audience is 2000.
query {
dataSets(filter: [{ field: "type", eq: "AUDIENCE" }]) {
nodes {
attributes {
name
type
category
identifyAs {
key
channels
}
}
}
}
}
{
"data": {
"dataSets": {
"nodes": [
{
"attributes": [
{
"name": "Unique ID",
"type": "TEXT",
"category": "Contact information",
"identifyAs": {
"key": true,
"channels": null
}
},
{
"name": "Email Address",
"type": "TEXT",
"category": "Contact information",
"identifyAs": {
"key": null,
"channels": [
"EMAIL"
]
}
},
{
"name": "SMS Phone Number",
"type": "TEXT",
"category": "Contact information",
"identifyAs": {
"key": null,
"channels": [
"SMS"
]
}
},
{
"name": "First Name",
"type": "TEXT",
"category": "Contact information",
"identifyAs": null
},
{
"name": "Opt-In Date",
"type": "DATE",
"category": "Demographic",
"identifyAs": null
}
]
}
]
}
}
}
Arguments
Add the filter
argument to your query. It must contain an object with the following fields.
Field | Values | Definition |
---|---|---|
field | String. Valid value: type . | The field to filter |
eq | String. Valid value:AUDIENCE . | The value that the specified field must be equal to. |
⚠️If you omit this filter, the response will contain reference sets in addition to the audience.
Fields
The query returns the fields nested into the nodes
field
Nested field | Values | Definition |
---|---|---|
attributes | Array of objects | There is an object for each contact attribute |
Fields supported by objects within the attributes
field
Nested field - level 1 | Nested field - level 2 | Values | Definition |
---|---|---|---|
name | String! | The name of an attribute | |
type | One of the following values: - TEXT - NUMBER - BOOLEAN - DATE | The data format of an attribute | |
decimalPrecision | Integer from 0 to 14. For non-numeric fields, the value is null . | The number of decimal places displayed. Applies to numeric values only | |
category | String | The category that an attribute belongs to. Query the dataSetAttributeCategories object to get all available attribute categories. | |
identifyAs | key | Boolean - true . The attribute acts as a key value in the dataset.- false . The attribute is marked as addressable.- null . The attribute is neither a key value, nor an addressable. | Lets you check if an attribute acts as a key value in the dataset or is marked as addressable. |
channels | Either of the following values: - EMAIL - SMS Applies to attributes marked as addressable. | Communication channel. Applies to addressable attributes (the key value for them is false ). |