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.

Request Headers

Authentication details are required to access the API. Ensure you include the necessary tokens or credentials in your request headers.

Header NameTypeDescriptionExampleRequired?
api-keyStringAPI key for authentication41a1de35948f915f64907ced9eed4f00Yes
AcceptStringJSON format for the responses.application/jsonNo
Content-Type StringJSON format for the request payload.application/jsonNo

Request Body

All necessary parameters should be passed in the request body in JSON format.

Body ParameterData TypeDescriptionRequired?
audience_typeStringSpecifies the type of audience, such as 'segment' or 'list'.Yes
page_detailsobjectUse 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_noIntegerPage number to retrieve. The default value is 1.No
page_sizeIntegerNumber of records per page. The default value is 10.No
sorting_criteriaObjectDefines the sort order. The parameters are sort_by and sort_order.No
sort_byStringDefines 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_orderStringThe order of sorting is either 'asc'(ascending) or 'desc' (descending).No
filtering_criteriaObjectSpecifies filters for audience selection. The parameters are audience_ids,last_updated_date_range, and last_refreshed_date_range.No
audience_idsArray of IntegerLists of specific audience IDs to include.No
last_updated_date_rangeObjectFilter based on the last updated date. This applies to the audience type 'list' or 'segment'.No
conditionStringThe 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
valueStringDate to compareNo
lower_bound_valueStringStart date for range.No
upper_bound_valueStringEnd date for range.No
last_refreshed_date_rangeObjectFilter based on the last refreshed date. This applies to the audience type 'list' or 'segment'.No
conditionStringIf 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_valueStringStart date range.No
upper_bound_valueStringEnd 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 CodeDescription
200Successful response. The campaign has been created.