segment
query
Requires read_customers access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Query segment detail by id
Arguments
Find segment by id
Return
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
The Customer Segment.
Code
query {
segment(id: "gid://shopline/Segment/GROUP6263607983794035520") {
id
name
query
creationDate
lastEditDate
}
}
Response
{
"data": {
"segment": {
"lastEditDate": "2023-12-29T12:31:29.295Z",
"name": "gql-opean-api-New-3",
"query": "{\"conditions\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"37a6365b-67bf-4c3e-86c2-f0b086db63db\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"26ba86d5-9658-4b2b-beed-7c27612eb7af\\\"}\",\"children\":[{\"type\":0,\"blockType\":0,\"metafield\":false,\"key\":\"payOrderCnt\",\"value\":[1],\"operator\":\"LT\"}]}]},\"not\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"8efe7f6f-96d4-457b-bccb-a5418abc200b1\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"53f86c31-aebe-4fab-9f20-b9f6f150322b1\\\"}\",\"children\":[]}]}}",
"creationDate": "2023-12-27T09:10:37.943Z",
"id": "gid://shopline/Segment/GROUP6263607983794035520"
}
}
}
Was this article helpful to you?