> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Get cookie report

GET https://api-gw.perimeterx.com/v1/cookie-report

Returns a list of cookie data for the given Application IDs and domains.


Reference: https://docs.humansecurity.com/applications/reference/get-cookie-report

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `appId=hostDomain` (string, required) — A pair of `appId` and `hostDomain` keys.
- `from` (integer, optional) — A timestamp, in milliseconds, indicating from what point in time to filter the results by. Defaults to the past 24 hours.
- `to` (integer, optional) — A timestamp, in milliseconds, indicating until what point in time to filter the results by. Defaults to the current time.
- `skip` (integer, optional, default: 0) — The number of incidents to offset pagination by when returning the results.
- `take` (integer, optional, default: 20) — The number of incidents to display per page when returning the results.

## Response

### 200

Success

- `paging` (GetCookieReportPaging, optional)
- `data` (list of GetCookieReportDataItems, optional)

## Errors

### 401 Unauthorized Error

Access token is missing or invalid.

- `any`

### 422 Unprocessable Entity Error

Invalid or missing parameters.

- `any`

### 500 Internal Server Error

Internal error. Contact HUMAN if the error persists.

- `any`

## Types

### GetCookieReportPaging

- `previous` (string, optional)
- `current` (string, optional)
- `next` (string, optional)

### GetCookieReportDataItems

- `app_id` (string, optional)
- `host_domain` (string, optional)
- `count` (integer, optional)
- `data` (list of GetCookieReportDataItemsDataItems, optional)

### GetCookieReportDataItemsDataItems

- `name` (string, optional)
- `vendor` (string, optional)
- `description` (string, optional)
- `first_seen` (string, optional)
- `last_seen` (string, optional)
- `scripts` (list of string, optional)

## Examples

**Response**

```json
{
  "paging": {
    "previous": "",
    "current": "https://api-gw.perimeterx.com/v1/cookie-report?ABC123=domain.com&from=1675209600000&take=20&skip=0",
    "next": "https://api-gw.perimeterx.com/v1/cookie-report?ABC123=domain.com&from=1675209600000&take=20&skip=20"
  },
  "data": [
    {
      "app_id": "PXabc123",
      "host_domain": "domain.com",
      "count": 1000,
      "data": [
        {
          "name": "__pxvid",
          "vendor": "PerimeterX",
          "description": "Used for browser detection and distinguishing whether it is a real user or malicious bot.",
          "first_seen": "2020-01-21T13:29:29+02:00",
          "last_seen": "2023-02-27T16:12:21+02:00",
          "scripts": [
            "client.px-cloud.net/PX8U0i7rwC/main.min.js"
          ]
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api-gw.perimeterx.com/v1/cookie-report"

querystring = {"appId=hostDomain":"hostDomain","from":"1674313200000","skip":"40","take":"10","to":"1674313200000"}

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
```

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

url = URI("https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000")

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

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

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gw.perimeterx.com/v1/cookie-report?appId%3DhostDomain=hostDomain&from=1674313200000&skip=40&take=10&to=1674313200000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```