From e182fb5660da47dd1923133bc887504f9dabd783 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 5 Nov 2024 00:18:12 +0530 Subject: [PATCH] Fix the delete/blocklist by SQL query example in docs. --- docs/docs/content/apis/subscribers.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/docs/content/apis/subscribers.md b/docs/docs/content/apis/subscribers.md index 1129d752..d62dd409 100644 --- a/docs/docs/content/apis/subscribers.md +++ b/docs/docs/content/apis/subscribers.md @@ -495,11 +495,19 @@ Blocklist subscribers based on SQL expression. > Refer to the [querying and segmentation](../querying-and-segmentation.md#querying-and-segmenting-subscribers) section for more information on how to query subscribers with SQL expressions. +##### Parameters + +| Name | Type | Required | Description | +|:---------|:---------|:---------|:--------------------------------------------| +| query | string | Yes | SQL expression to filter subscribers with. | +| list_ids | []number | No | Optional list IDs to limit the filtering to.| + ##### Example Request ```shell -curl -u curl -u 'api_username:access_token' -X PUT 'http://localhost:9000/api/subscribers/query/blocklist' \ ---data-raw '"query=subscribers.name LIKE '\''John Doe'\'' AND subscribers.attribs->>'\''city'\'' = '\''Bengaluru'\''"' +curl -u curl -u 'api_username:access_token' -X POST 'http://localhost:9000/api/subscribers/query/blocklist' \ +-H 'Content-Type: application/json' \ +--data-raw '{"query":"subscribers.name LIKE '\''John Doe'\'' AND subscribers.attribs->>'\''city'\'' = '\''Bengaluru'\''"}' ``` ##### Example Response @@ -594,11 +602,20 @@ ______________________________________________________________________ Delete subscribers based on SQL expression. +##### Parameters + +| Name | Type | Required | Description | +|:---------|:---------|:---------|:--------------------------------------------| +| query | string | Yes | SQL expression to filter subscribers with. | +| list_ids | []number | No | Optional list IDs to limit the filtering to.| + + ##### Example Request ```shell curl -u curl -u 'api_username:access_token' -X POST 'http://localhost:9000/api/subscribers/query/delete' \ ---data-raw '"query=subscribers.name LIKE '\''John Doe'\'' AND subscribers.attribs->>'\''city'\'' = '\''Bengaluru'\''"' +-H 'Content-Type: application/json' \ +--data-raw '{"query":"subscribers.name LIKE '\''John Doe'\'' AND subscribers.attribs->>'\''city'\'' = '\''Bengaluru'\''"}' ``` ##### Example Response