Export API

This API enables the export of user data along with their associated attributes for respective lists or segments.

📘

Note

  • Export Limit: The API allows exporting user data with up to 100 attributes per export request.
  • Long Text Attributes: Exporting long text type attributes is not currently supported through this API.

HTTP Method

This API uses the POST method to fetch, segment, and filter audience lists.

API Endpoint

The base URLs for Export 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.

Data TypeDescriptionRequired?
audience_detailsobjectDefines details of the audience selected for export.Yes
audience_typeStringSpecifies the type of audience to export. Supported values are "segment" or "list".Yes
audience_idIntegerUnique identifier for the audience to be exported.Yes
attributes_neededArray of StringList of attributes of the audience to export. Note: Attribute names should match panel attribute names.No
blocklist_typeStringDefines the blocklist filter type, specifying users who have opted out of targeting based on their ID (e.g., email, or mobile). The allowed values are 'email' or 'mobile'.
Example: If set to email, the export will exclude email IDs of users who opted out of email targeting.
No
file_typeStringFile format for export. Currently, only "csv" is supported. It defaults to "csv" if it is not specified.No
callback_detailsObjectIt contains a callback configuration to handle export completion notifications.Yes
methodStringHTTP method for the callback request. Defaults to "POST".No
endpointStringHTTPS endpoint URL for the callback.No
headerArray of ObjectList of header details for the callback request. Each header includes a key-value pair.Yes
keyStringHeader key for the callback request.No
bodyObjectAdditional parameters for the callback body. If not provided, it defaults to {}. Default body parameters included automatically are:
  • file_path: Path to the exported file.
  • file_type: File extension.
  • request_id: ID of the export request.
  • audience_type: Audience type, either "segment" or "list".
  • audience_id: ID of the exported audience.

All specified additional parameters are sent under the "callbackBody" key (refer to Callback Response section).
No

Example Request Body

curl --request POST \
  --url https://api.netcoresmartech.com/v4/audience/export \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'api-key: ' \
  --data '{
  "audience_details": {
    "audience_type": "list/segment",
    "audience_id": 20,
    "attributes_needed": [
      "email",
      "phone",
      "attr1",
      "attr2"
    ],
    "blocklist_type": "email | phone"
  },
  "file_type": "csv",
  "notify_email": "[email protected]",
  "callback_details": {
    "method": "GET or POST",
    "endpoint": "Webhook Endpoint",
    "header": [
      {
        "key1": "value"
      },
      {
        "key2": "value"
      }
    ],
    "body": {
      "key": "value"
    }
  }
}

Example Response

{
  "data": {
    "status": "success",
    "description": "Audience Export Request Created Successfully.",
    "request_id": "f2844332-f1e6-5050-edfa-1a8e0e437518"
  },
  "message": "Audience Export Request Created Successfully.",
  "statusCode": 200
}

Error Codes

Error CodeDescription
200Successful response. Audience export request created successfully