# Retrieve an export

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


This API gets the status of the export job initiated by the Exports API. If the export job is completed, the downloads resource will also be obtained in the API response. The returned URL in the downloads resource is secure and can be downloaded. The URL expires after 4 hours. Please note that this is a public URL, and can be downloaded by anyone with whom it's shared.

**Note:** In case the export is in Failed or In-process state, then the downloads resource will not be available.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/exports/__test__KyVnHhSBWTF7H8v \
     -u {site_api_key}:
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Export.Retrieve("__test__KyVnHhSBWTF7H8v").Request();

Export export = result.Export;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    exportAction "github.com/chargebee/chargebee-go/v3/actions/export"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := exportAction.Retrieve("__test__KyVnHhSBWTF7H8v").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Export := res.Export
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.ExportRetrieveRequest{
    Id : "__test__KyVnHhSBWTF7H8v",
}
  res, err := client.Export.Retrieve(req)
      if err != nil {
        fmt.Println(err)
    } else {
        Export := res.Export
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Export.retrieve("__test__KyVnHhSBWTF7H8v").request();

        Export export = result.export();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.export.Export;
import com.chargebee.v4.models.export.params.ExportRetrieveParams;
import com.chargebee.v4.models.export.responses.ExportRetrieveResponse;

public class ExportRetrieve {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        ExportRetrieveResponse response = client.exports().retrieve("__test__KyVnHhSBWTF7H8v");

        Export export = response.getExport();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.export.retrieve("__test__KyVnHhSBWTF7H8v");

    console.log(result);
    const export_response = result.export;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->export()->retrieve("__test__KyVnHhSBWTF7H8v");
$export = $result->export;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Export.retrieve("__test__KyVnHhSBWTF7H8v")
export = response.export
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::Export.retrieve("__test__KyVnHhSBWTF7H8v")

export = result.export
```

## Sample Response

```json
{
  "export": {
    "created_at": 1527791400,
    "id": "__test__KyVnHhSBWTF7H8v",
    "mime_type": "zip",
    "object": "export",
    "operation_type": "Deferred Revenue Report",
    "status": "failed"
  }
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/exports/{export-id}

## Returns

- `export` (Export object)
  Resource object representing export
