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 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.
Data Type | Description | Required? | |
---|---|---|---|
audience_details | object | Defines details of the audience selected for export. | Yes |
audience_type | String | Specifies the type of audience to export. Supported values are "segment" or "list". | Yes |
audience_id | Integer | Unique identifier for the audience to be exported. | Yes |
attributes_needed | Array of String | List of attributes of the audience to export. Note: Attribute names should match panel attribute names. | No |
blocklist_type | String | Defines 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_type | String | File format for export. Currently, only "csv" is supported. It defaults to "csv" if it is not specified. | No |
callback_details | Object | It contains a callback configuration to handle export completion notifications. | Yes |
method | String | HTTP method for the callback request. Defaults to "POST". | No |
endpoint | String | HTTPS endpoint URL for the callback. | No |
header | Array of Object | List of header details for the callback request. Each header includes a key-value pair. | Yes |
key | String | Header key for the callback request. | No |
body | Object | Additional parameters for the callback body. If not provided, it defaults to {}. Default body parameters included automatically are:
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 Code | Description |
---|---|
200 | Successful response. Audience export request created successfully |
Updated 18 days ago