List & Segment API
Learn to fetch, segment, and filter audience lists.
HTTP Method
This API uses the POST method to fetch, segment, and filter audience lists.
API Endpoint
The base URLs for List Audience API are below.
Region | Base URL |
---|---|
India | https://apiind.netcoresmartech.com/v4/audience/list |
Europe | https://jsonapi.eu-north-1.eu.netcoresmartech.com/v4/list |
United States | https://api.netcoresmartech.com/v4/list |
Request Headers
Authentication details are required to access the API. Ensure you include the necessary tokens or credentials in your request headers.
Header Name | Type | Description | Example | Required? |
---|---|---|---|---|
api-key | String | API key for authentication | 41a1de35948f915f64907ced9eed4f00 | Yes |
Accept | String | JSON format for the responses. | application/json | No |
Content-Type | String | JSON format for the request payload. | application/json | No |
Request Body
All necessary parameters should be passed in the request body in JSON format.
Body Parameter | Data Type | Description | Required? |
---|---|---|---|
audience_type | String | Specifies the type of audience, such as 'segment' or 'list'. | Yes |
page_details | object | Use this to specify page size and page number to limit the number of Segment or List details exported in a paginated manner with parameters. The parameters are page_no and page_size . | No |
page_no | Integer | Page number to retrieve. The default value is 1. | No |
page_size | Integer | Number of records per page. The default value is 10. | No |
sorting_criteria | Object | Defines the sort order. The parameters are sort_by and sort_order . | No |
sort_by | String | Defines the sort by. The possible values "ids" or "updated_date"(applicable only for the audience type 'list'). The 'last_refreshed_date' applies only to the audience type 'segment'. | No |
sort_order | String | The order of sorting is either 'asc'(ascending) or 'desc' (descending). | No |
filtering_criteria | Object | Specifies filters for audience selection. The parameters are audience_ids ,last_updated_date_range , and last_refreshed_date_range . | No |
audience_ids | Array of Integer | Lists of specific audience IDs to include. | No |
last_updated_date_range | Object | Filter based on the last updated date. This applies to the audience type 'list' or 'segment'. | No |
condition | String | The condition key is required if the 'last_updated_date_range' is provided. Possible values are "gt" (greater than), "lt" (less than), "eq" (equal), and "bt" (between). | No |
value | String | Date to compare | No |
lower_bound_value | String | Start date for range. | No |
upper_bound_value | String | End date for range. | No |
last_refreshed_date_range | Object | Filter based on the last refreshed date. This applies to the audience type 'list' or 'segment'. | No |
condition | String | If the 'last_refershed_date_range' is provided, the condition key is required. Possible values: "gt" (greater than), "lt" (less than), "eq" (equal), and "bt" (between). | Yes |
lower_bound_value | String | Start date range. | No |
upper_bound_value | String | End date range. | No |
Example Request Body
curl --request POST \
--url https://apiind.netcoresmartech.com/v4/audience/list \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'api-key: ' \
--data '{
"page_details": {
"page_no": 1,
"page_size": 10
},
"audience_type": "segment",
"sorting_criteria": {
"sort_by": "updated_date",
"sort_order": "desc"
},
"filtering_criteria": {
"audience_ids": [
12,
23,
43,
45,
100,
213,
232,
413,
213,
132
],
"last_updated_date_range": {
"value": "2023-01-16T12:30:45Z",
"condition": "gt"
},
"last_refreshed_date_range": {
"condition": "bt",
"lower_bound_value": "2023-01-10T12:30:45Z",
"upper_bound_value": "2023-01-16T12:30:45Z"
}
}
}'
Example Response
{
"data": {
"page_details": {
"page_no": 1,
"page_max": 19,
"page_size": 5
},
"audience_type": "list",
"audience_details": [
{
"audience_id": 1,
"audience_name": "test--",
"last_updated_time": "2023-11-08T11:08:52Z"
},
{
"audience_id": 2,
"audience_name": "Shubham List 2",
"last_updated_time": "2023-02-17T05:36:39Z"
},
{
"audience_id": 5,
"audience_name": "failedtest",
"last_updated_time": "2023-03-30T08:18:15Z"
},
{
"audience_id": 6,
"audience_name": "listfail",
"last_updated_time": "2023-03-30T08:18:16Z"
},
{
"audience_id": 7,
"audience_name": "exclude_list",
"last_updated_time": "2023-04-02T11:11:34Z"
},
{
"audience_id": 8,
"audience_name": "Test Than List",
"last_updated_time": "2023-04-03T05:54:48Z"
},
{
"audience_id": 9,
"audience_name": "exclude_list2",
"last_updated_time": "2023-04-04T13:45:04Z"
}
]
},
"message": "sucess",
"statusCode": 200
}
Error Codes
Error Code | Description |
---|---|
200 | Successful response. The campaign has been created. |
Updated 23 days ago