# POST: Extracting an event

<mark style="color:green;">`POST`</mark> `api/v1/export/event`

This is an API that can extract loaded events.

### **Query parameters** <a href="#undefined" id="undefined"></a>

<table><thead><tr><th width="210">Name</th><th>Whether required<select><option value="xBw0HvmJduZN" label="Select" color="blue"></option><option value="VBuJ6ubzjfbi" label="Essential" color="blue"></option></select></th><th>Type</th><th>Explanation</th></tr></thead><tbody><tr><td><code>service_id</code></td><td><span data-option="VBuJ6ubzjfbi">Essential</span></td><td>String</td><td>Service ID</td></tr></tbody></table>

## **Header**

<table><thead><tr><th>Field name</th><th>Whether required<select><option value="3Gw9yCGdnldk" label="Essential" color="blue"></option><option value="mVPQehiUZOei" label="Select" color="blue"></option></select></th><th>Type</th><th>Value</th><th>Explanation</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td><span data-option="3Gw9yCGdnldk">Essential</span></td><td>String</td><td><code>application/json</code></td><td>-</td></tr><tr><td><code>Authorization</code></td><td><span data-option="3Gw9yCGdnldk">Essential</span></td><td>String</td><td><code>Bearer your-auth-token</code></td><td>API Authentication Token</td></tr></tbody></table>

## **Request body**

<table><thead><tr><th>Field name</th><th>Whether required<select><option value="xBw0HvmJduZN" label="Select" color="blue"></option><option value="VBuJ6ubzjfbi" label="Essential" color="blue"></option></select></th><th>Type</th><th>Explanation</th></tr></thead><tbody><tr><td><code>events</code></td><td><span data-option="xBw0HvmJduZN">Select</span></td><td>List of String</td><td>List of event names to filter, if no value exists, extract all events</td></tr><tr><td><code>events_condition_type</code></td><td><span data-option="VBuJ6ubzjfbi">Essential</span></td><td>String</td><td><p>Filtering operator, supports the following values:</p><p><code>all</code>: The whole event,</p><p><code>include</code>: <code>events</code>Includes only events of</p><p><code>exclude</code>: <code>events</code>Excluding events</p></td></tr><tr><td><code>properties</code></td><td><span data-option="xBw0HvmJduZN">Select</span></td><td>List of String</td><td>List of event properties to filter on, if no value exists, extract all event properties</td></tr><tr><td><code>properties_condition_type</code></td><td><span data-option="xBw0HvmJduZN">Select</span></td><td>String</td><td><p><br>Filtering operator, supports the following values:</p><p>If the value does not exist: the entire event property,</p><p><code>all</code>: All event properties,</p><p><code>include</code>: <code>properties</code>Contains only the event properties of</p><p><code>exclude</code>: <code>properties</code>Excluding event properties</p></td></tr><tr><td><code>from_date</code></td><td><span data-option="VBuJ6ubzjfbi">Essential</span></td><td>Date</td><td>Event search start date,<code>yyyy-MM-dd,</code> <code>2024-12-05</code></td></tr><tr><td><code>to_date</code></td><td><span data-option="xBw0HvmJduZN">Select</span></td><td>Date</td><td>Event search end date,<code>yyyy-MM-dd,</code> <code>2024-12-05</code></td></tr></tbody></table>

### **Response** <a href="#undefined-3" id="undefined-3"></a>

The response from the event extraction `,`is in CSV format with a header separated by. The first line is the header, and the extracted data is from the second line. The table below describes the main headers.

For the Unified ID and System Event properties `properties`, `properties_condition_type`they are always included in the response, regardless of.

If no value exists, the default value is empty.

For more information about event properties, see [Designing an Event Taxonomy.](https://github.com/IGAWorksDev/dfn-v2-developer-reference-gitbook/blob/main/user_guide/ko/begin-to-use-dfinery/event-and-property/taxonomy.md)

| Field name                            | Division                             | Explanation                                                                                                                            |
| ------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `df_unified_id`                       | Integrated ID                        | Integrated ID                                                                                                                          |
| `${your-standard-event-property-key}` | Standard event properties            | Standard event properties                                                                                                              |
| `${your-custom-event-property-key}`   | Custom event properties              | Custom event properties                                                                                                                |
| `${your-df-item-property-key}`        | Standard and custom event properties | Event Item (Standard, Custom) Properties                                                                                               |
| `df_api_version`                      | System Event Properties              | Event API Version                                                                                                                      |
| `event_name`                          | System Event Properties              | Event name                                                                                                                             |
| `df_server_datetime`                  | System Event Properties              | Event log server arrival time                                                                                                          |
| `df_correction_datetime`              | System Event Properties              | Event occurrence time                                                                                                                  |
| `df_event_detail_log_id`              | System Event Properties              | <p>Event log ID, if the purchase event contains multiple items,</p><p><code>${df\_event\_log\_id}:${n}</code>It is in the form of.</p> |
| `df_event_log_id`                     | System Event Properties              | Event Log ID                                                                                                                           |

## Example request

```sh
curl -L \
  -X POST \
  -H 'Authorization: Bearer ${your-export-api-token}' \
  -H 'Content-Type: application/json' \
  'https://openapi.dfinery.ai/api/v1/export/event?service_id=${your-service-id}' \
  -d '{
    "events": ["df_purchase"],
    "events_condition_type": "include",
    "properties": ["df_discount", "df_items_df_price"],
    "properties_condition_type": "include",
    "from_date": "2024-08-25",
    "to_date": "2024-08-26"
}' -o results.csv
```

### Example response <a href="#undefined-5" id="undefined-5"></a>

#### Success response <a href="#undefined-6" id="undefined-6"></a>

<pre><code><strong>200 OK
</strong>
<strong>custom_012,custom_event_p_boolean,custom_event_p_datetime,custom_event_p_double,custom_event_p_double_list,custom_event_p_long,custom_event_p_long_list,custom_event_p_string_list,df_api_version,df_correction_datetime,df_delivery_charge,df_discount,df_event_datetime,df_event_detail_log_id,df_event_log_id,df_event_name,df_items_custom_012391239128,df_items_custom_item_boolean,df_items_custom_item_datetime,df_items_custom_item_double,df_items_custom_item_double_list,df_items_custom_item_long,df_items_custom_item_long_list,df_items_custom_item_string,df_items_custom_item_string_list,df_items_df_category1,df_items_df_category2,df_items_df_category3,df_items_df_category4,df_items_df_category5,df_items_df_discount,df_items_df_item_id,df_items_df_item_name,df_items_df_price,df_items_df_quantity,df_keyword,df_order_id,df_payment_method,df_server_datetime,df_service_id,df_sharing_channel,df_sign_channel,df_source_type,df_total_purchase_amount,df_total_refund_amount,df_unified_id,sum
</strong>,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:35,,,2025.1.6 10:35,1736127307268:1736127306623:cd20207c-bb2a-4abf-a4a9-80804334cf15,1736127307268:1736127306623:cd20207c-bb2a-4abf-a4a9-80804334cf15,df_end_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:35,xyroon,,,SDK,,,7jPY23Q,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:35,,,2025.1.6 10:35,1736127307268:1736127306638:19c95a76-868b-49bc-a8a5-68058377342f,1736127307268:1736127306638:19c95a76-868b-49bc-a8a5-68058377342f,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:35,xyroon,,,SDK,,,7jPY23Q,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:38,,,2025.1.6 10:38,1736127490036:30873a05-62d3-4007-b643-f500a151be24,1736127490036:30873a05-62d3-4007-b643-f500a151be24,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025-01-06 10:38:10.036,xyroon,,,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:38,,,2025.1.6 10:38,1736127513890:1d302d2c-e66e-4e7b-ba1d-94299a18c218,1736127513890:1d302d2c-e66e-4e7b-ba1d-94299a18c218,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:38,xyroon,,,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:38,,,2025.1.6 10:38,1736127521375:0ae48e8f-05f5-48aa-acdd-0ce9c1d62631,1736127521375:0ae48e8f-05f5-48aa-acdd-0ce9c1d62631,df_sign_up,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:38,xyroon,,Kakao,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:38,,,2025.1.6 10:38,1736127534688:10ce7ebd-ac54-4bbd-bd75-1e15c3ff92b6,1736127534688:10ce7ebd-ac54-4bbd-bd75-1e15c3ff92b6,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:38,xyroon,,,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:47,,,2025.1.6 10:47,1736128036788:e90f4559-666c-4b04-9f1b-846c55f3b12d,1736128036788:e90f4559-666c-4b04-9f1b-846c55f3b12d,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:47,xyroon,,,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:47,,,2025.1.6 10:47,1736128047673:c62a93ed-4979-4307-b2d5-cbcc3f46578e,1736128047673:c62a93ed-4979-4307-b2d5-cbcc3f46578e,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:47,xyroon,,,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:47,,,2025.1.6 10:47,1736128055767:95d77aa8-0bf2-4967-908b-0ac60987e250,1736128055767:95d77aa8-0bf2-4967-908b-0ac60987e250,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:47,xyroon,,,SDK,,,vft57Yw,
,FALSE,,,null,,null,null,1.0.0,2025.1.6 10:47,,,2025.1.6 10:47,1736128058570:a68f6530-6496-48c1-b6bb-4593d03b140f,1736128058570:a68f6530-6496-48c1-b6bb-4593d03b140f,df_start_session,,FALSE,,,null,,null,,null,,,,,,,,,,,,,,2025.1.6 10:47,xyroon,,,SDK,,,vft57Yw,
</code></pre>

#### Failure response <a href="#undefined-7" id="undefined-7"></a>

Please refer to [the detailed response](https://docs.dfinery.ai/api-guide/en/api/export-api/response) for more details.
