Techdocs
Search…
Querying Segments
You can query all the configured segments using the GraphQL Segments endpoint. You are able to query all the names and identifiers of the segments.
1
curl -0 -v -X POST https://api.nosto.com/v1/graphql \
2
-u ":<token>" \
3
-H 'Content-Type: application/graphql' \
4
-d @- << EOF
5
query {
6
segments{
7
segments{
8
id,
9
name
10
}
11
}
12
}
13
EOF
Copied!

Sample Output

1
{
2
"data": {
3
"segments": {
4
"segments": [
5
{
6
"id": "5a497a000000000000000001",
7
"name": "First-Time Visitors"
8
},
9
{
10
"id": "5b71f1500000000000000006",
11
"name": "Returning Visitors"
12
},
13
{
14
"id": "5a497a000000000000000002",
15
"name": "Prospects"
16
},
17
{
18
"id": "5a497a000000000000000003",
19
"name": "First-Time Customers"
20
},
21
{
22
"id": "5a497a000000000000000004",
23
"name": "Repeat Customers"
24
},
25
{
26
"id": "5a497a000000000000000005",
27
"name": "Loyal Customers"
28
},
29
{
30
"id": "5a497a000000000000000000",
31
"name": "All Customers"
32
}
33
]
34
}
35
}
36
}
Copied!
Last modified 1yr ago
Copy link