# Get CSV File of Export

Returns a single .csv.gz file for corresponding Export.

Attention

Please note that the file is available for Download Only! It can not be read as in previous versions due to .csv file
being Archived as .gz format archive for compression of space.

To receive the export file, a query should be sent to /v3/exports/{filename}.csv.gz, and the {filename} can be obtained
from the response of [Get Exports](get-exports.html#get-exports-v35) URL attribute or [Get
Export](get-export.html#get-export-v35) following by export ID.

## Exported File Format

The exported file contains call detail records (CDRs) or SMS records in CSV format,
depending on the `export_type` of the Export. The first line of the file contains the
column names listed below, in the listed order.

The columns below are those of an Export created with this API version. The file of an Export
created with an earlier API version keeps the columns of that version.

### Inbound CDRs

Columns of a `cdr_in` Export.

[`Inbound CDR sample`](../../../_downloads/4652acaa8351c4dd7c4109f2482caa56/inbound_cdr_sample.csv)

| Column | Type | Description |
| --- | --- | --- |
| Date/Time Start (UTC) | `string` | Call start timestamp in UTC. |
| Date/Time Connect (UTC) | `string` | Call answer timestamp in UTC. |
| Date/Time End (UTC) | `string` | Call end timestamp in UTC. |
| Status | `string` | Call status. |
| Source Number | `string` | Caller number, as it reached DIDWW. |
| Source Number Out | `string` | Caller number, as delivered to the trunk. |
| Source Name | `string` | Caller name. |
| Source Country | `string` | Country of the caller number. |
| Source Network | `string` | Network of the caller number. |
| Destination DID | `string` | Destination DID number. |
| Duration (sec) | `integer` | Call duration in seconds. |
| Attempt | `integer` | Call attempt number. |
| Disconnect Code | `string` | Disconnect code. |
| Response | `string` | SIP response or system response. |
| Disconnect Initiator | `string` | Entity that initiated call termination. |
| Voice IN Trunk | `string` | Inbound trunk identifier or name. |
| Destination | `string` | Destination number. |
| Trunk Group | `string` | Associated trunk group. |
| Capacity Group | `string` | Associated capacity group. |
| Toll-free (USD) | `string` | Toll-free cost in USD. |
| PSTN (USD) | `string` | PSTN cost in USD. |
| Metered (USD) | `string` | Metered cost in USD. |
| CNAM IN (USD) | `string` | CNAM lookup cost in USD. |
| Total (USD) | `string` | Total cost in USD. |
| Call ID | `string` | Unique call identifier. |

### Outbound CDRs

Columns of a `cdr_out` Export.

[`Outbound CDR sample`](../../../_downloads/0bea9a528910b513d916461cc4681704/outbound_cdr_sample.csv)

| Column | Type | Description |
| --- | --- | --- |
| Date/Time Start (UTC) | `string` | Call start timestamp in UTC. |
| Date/Time Connect (UTC) | `string` | Call answer timestamp in UTC. |
| Date/Time End (UTC) | `string` | Call end timestamp in UTC. |
| Status | `string` | Call status. |
| Source | `string` | Source number. |
| CLI | `string` | Calling Line Identification. |
| Destination Number | `string` | Destination number. |
| Call Duration (sec) | `integer` | Call duration in seconds. |
| Billing Duration (sec) | `integer` | Billed duration in seconds. |
| Disconnect Code | `string` | Disconnect code. |
| Disconnect Reason | `string` | Disconnect reason description. |
| Voice OUT Trunk | `string` | Outbound trunk identifier or name. |
| Destination Country | `string` | Destination country. |
| Network | `string` | Destination network. |
| Call Type | `string` | Call type classification. |
| Rate (USD) | `string` | Rate per unit in USD. |
| Charged (USD) | `string` | Charged amount in USD. |
| P-Charge-Info | `string` | Charging information header. |
| Call ID | `string` | Unique call identifier. |

### Inbound SMS

Columns of an `sms_in` Export.

[`Inbound SMS sample`](../../../_downloads/f489a07312b7b53633b97f8a72b55029/sms_in_sample.csv)

| Column | Type | Description |
| --- | --- | --- |
| Time Received (UTC) | `string` | Time when DIDWW received the message, in UTC. |
| Time Sent (UTC) | `string` | Time when the message was sent to the SMS trunk, in UTC. |
| Status | `string` | Delivery status: `Success`, `Failed`, or `Queued`. |
| Error Code | `string` | Error code of a failed delivery. |
| Reason | `string` | Reason of a failed delivery. |
| Source Address | `string` | Sender address. |
| Destination Address | `string` | Recipient address, the DID number that received the message. |
| SMS Trunk | `string` | Name of the SMS trunk the message was delivered to. |
| Type | `string` | Type of the SMS trunk: `SMPP SMSC`, `SMPP ESME`, `Email`, or `HTTP IN`. |
| Destination | `string` | Final destination of the SMS trunk, for example an email address for an Email trunk. |
| Fragments | `integer` | Number of message fragments. |
| SMS ID | `string` | Unique message identifier. |
| Billed Fragments | `integer` | Number of billed message fragments. |
| Charged (USD) | `string` | Charged amount in USD. |

### Outbound SMS

Columns of an `sms_out` Export.

[`Outbound SMS sample`](../../../_downloads/05293a264483b963040505322aab70f7/sms_out_sample.csv)

| Column | Type | Description |
| --- | --- | --- |
| Date/Time (UTC) | `string` | Time when the message was sent, in UTC. |
| Status | `string` | Delivery status: `Routing Error`, `In Progress`, `Queued`, `Failed`, or `Success`. |
| Reason | `string` | Reason of a failed delivery. |
| Source Address | `string` | Sender address. |
| Destination Address | `string` | Recipient address. |
| Trunk | `string` | Name of the SMS trunk the message was sent through. |
| Sender ID Verification | `string` | Name of the sender ID verification the message was sent under. Present only for accounts with A2P messaging enabled. |
| SMS ID | `string` | Unique message identifier. |
| Billed Fragments | `integer` | Number of billed message fragments. |
| Charged (USD) | `string` | Charged amount in USD. |

Note

The `Sender ID Verification` column is included only for accounts with A2P messaging
enabled. For other accounts, `SMS ID` follows `Trunk`. The sample file shows the
columns without `Sender ID Verification`.

## Request

HTTP Method: `GET`

URI Path: `/v3/exports/{filename}.csv.gz`

Authenticate the request with an access token in the `Authorization` header, as for other
requests. This download also accepts an API key in the `Api-Key` header. See
[Authentication](../authentication.html#authentication-v35).

### URI Parameters

| Name | Type | Is Required? | Description |
| --- | --- | --- | --- |
| filename | `string` | Yes | Unique filename of a completed Export, taken from its `url` attribute. It is not the Export ID. |

## Examples

Access tokenAPI key

[[DIDWW-API-EXAMPLE-START]]

http

```
1GET /v3/exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv.gz HTTP/1.1
2Host: api.didww.com
3Authorization: Bearer [access token]
```

curl

```
1curl -i -X GET https://api.didww.com/v3/exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv.gz -H "Authorization: Bearer [access token]"
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
1GET /v3/exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv.gz HTTP/1.1
2Host: api.didww.com
3Api-Key: [API key]
```

curl

```
1curl -i -X GET https://api.didww.com/v3/exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv.gz -H "Api-Key: [API key]"
```

[[DIDWW-API-EXAMPLE-END]]

A successful request returns `200 OK` with `Content-Type: application/gzip` and the
compressed CSV file in the response body. To save the file with curl, use `-o` with a file
name in place of `-i`:

```
curl -o a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv.gz https://api.didww.com/v3/exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv.gz -H "Authorization: Bearer [access token]"
```

## Other Responses

| Code | Success | Description |
| --- | --- | --- |
| 404 | No | Not Found (without body). No completed Export of the account has this filename. |
| 401 | No | [Unauthorized](../authentication.html#authentication-v35). A missing or refused API key returns no body. A refused access token returns an error document and a `WWW-Authenticate` header. |
| 429 | No | The request budget of the account for the current window is spent (`too_many_requests`). `Retry-After` gives the number of seconds to wait. |
