Retrieve users for a given segment
Request Parameters
The SegmentDataRequest object accepts the following parameters:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
Id of the segment to get data for. |
|
|
String |
No |
Prefix for the external user type. |
|
|
Integer |
No |
Use for pagination. Take the |
|
|
Integer |
No |
Maximum number of users returned. |
|
|
String |
No |
Type of identities to export, |
Response Structure
|
Name |
Type |
Description |
|---|---|---|
|
|
Integer |
Number of |
|
|
String |
Segment identifier. |
|
|
Integer |
If a non-zero value is returned, there are more user objects to retrieve. Use this value in the offset parameter of the subsequent request. |
|
|
Array of Object |
List of user object. See definition below. |
|
|
Array of Object |
List of pages object. See definition below. |
User object:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
External user identifier. |
|
|
String |
User identifier. |
Pages object:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Uniform resource locator. |
Examples
$ python cx.py /segment/data '{"segmentId": "1y2hxcg6ou41g"}'
{
"count": 3,
"segmentId": "1y2hxcg6ou41g",
"nextOffset": 0,
"users":
[
{
"globalId": "cx:34039403994830931:3q0v5rrbqfmeh",
"externalId": ""
},
{
"globalId": "cx:34039403994830937:xqmkj23i4knu",
"externalId": ""
},
{
"globalId": "cx:34039403994830936:o2zzqsw3b5po",
"externalId": ""
}
]
}
$ python cx.py /segment/data '{"segmentId": "1y2hxcg6ou41g", "externalIdType": "ada"}'
{
"count": 1,
"segmentId": "1y2hxmfg9z3pp",
"nextOffset": 0,
"users":
[
{
"userId": "cx:34039403994830932:379ni9gkkxayx",
"externalId": "someExternalUser123"
}
]
}
# Skip the first user
python cx.py /segment/data '{"segmentId": "1y2hxcg6ou41g", "offset": 1}'
{
"count": 2,
"segmentId": "1y2hxcg6ou41g",
"nextOffset": 1,
"users":
[
{
"globalId": "cx:34039403994830937:xqmkj23i4knu",
"externalId": ""
},
{
"globalId": "cx:34039403994830936:o2zzqsw3b5po",
"externalId": ""
}
]
}
# Get middle user
python cx.py /segment/data '{"segmentId": "1y2hxcg6ou41g", "offset": 1, "count": 1}'
{
"count": 1,
"segmentId": "1y2hxcg6ou41g",
"nextOffset": 1,
"users":
[
{
"globalId": "cx:34039403994830937:xqmkj23i4knu",
"externalId": ""
}
]
}
#Get pages
python cx.py /segment/data '{"segmentId": "1y2i4fyz1qvxx", "segmentNamespace": "page"}'
{
"count": 3,
"nextOffset": 0,
"segmentId": "1y2i4fyz1qvxx",
"users": null,
"pages":
[
{
"url": "https://www.piano.io/5"
},
{
"url": "https://www.piano.io/4"
},
{
"url": "https://www.piano.io/7"
}
]
}