## Get all export requests

### cURL

```
curl --request GET \
  --url 'https://live.copilot.fabric.inc/api-offers/offers-exports?size=10' \
  --header 'Authorization: Bearer <token>' \
  --header 'x-site-context: <x-site-context>'
```

```python
import requests

url = "https://live.copilot.fabric.inc/api-offers/offers-exports?size=10"

headers = {
    "x-site-context": "<x-site-context>",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
```

```javascript
const options = {
  method: 'GET',
  headers: {'x-site-context': '<x-site-context>', Authorization: 'Bearer <token>'}
};

fetch('https://live.copilot.fabric.inc/api-offers/offers-exports?size=10', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://live.copilot.fabric.inc/api-offers/offers-exports?size=10",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "x-site-context: <x-site-context>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

url := "https://live.copilot.fabric.inc/api-offers/offers-exports?size=10"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-site-context", "<x-site-context>")
	req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}
```

```java
HttpResponse<String> response = Unirest.get("https://live.copilot.fabric.inc/api-offers/offers-exports?size=10")
  .header("x-site-context", "<x-site-context>")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://live.copilot.fabric.inc/api-offers/offers-exports?size=10")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

### Response Codes

- **200**
- **400**
- **401**
- **500**

### Example Response

```
{
  "query": {
    "size": 10,
    "offset": 10,
    "count": 50
  },
  "data": [
    {
      "exportId": "ab50fe48-5da0-4e77-92d1-bb629eedf19e",
      "startedAt": "2023-05-17T21:24:52.398Z",
      "status": "IN_PROGRESS",
      "type": "REDEMPTION",
      "endedAt": "null",
      "totalDataExported": 0,
      "fileId": "redemption/tenantId/1687294954996-redemption-export.csv"
    }
  ]
}
```

```
{
  "code": "REQUEST_VALIDATION",
  "message": "Size should be a valid number."
}
```

```
{
  "code": "UNAUTHORIZED",
  "message": "Invalid credentials"
}
```

```
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error."
}
```

### Authorizations

- **Authorization**: string, required, Bearer authentication header of the form `Bearer <token>`.
- **x-site-context**: string, required. JSON object containing information about the source (account, channel, stage, date).

### Query Parameters

- **size**: integer (default: 10). Required range: `1 <= x <= 100`.
- **offset**: integer (default: 0). Required range: `x >= 0`.
- **sort**: string. Field to sort export requests.
- **type**: enum (options: `REDEMPTION`, `CALCULATED_PRICE`).

### Response Structure

- **query**: object that provides pagination data.
- **data**: array of response data.
