> 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 script audits

GET https://api-gw.perimeterx.com/v1/pci/audits/scripts

Returns a list of PCI DSS payment page script audits for the given Application ID and host domain.


Reference: https://docs.humansecurity.com/applications/reference/get-script-audits

## Authentication

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

## Request

### Query parameters

- `appId` (list of string, required) — An array of Application IDs to filter the relevant incidents by. At least one ID is required.
- `tld` (list of string, required) — An array of host domains to filter the relevant incidents by. At least one domain is required.
- `from` (integer, optional) — A timestamp, in milliseconds, indicating from what point in time to filter the results by. Defaults to the past year.

## Response

### 200

Success

- `paging` (GetScriptAuditsPaging, optional)
- `data` (list of GetScriptAuditsDataItems, 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

### GetScriptAuditsPaging

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

### GetScriptAuditsDataItems

- `event_key` (string, optional)
- `event_time` (string, optional)
- `app_id` (string, optional)
- `host_domain` (string, optional)
- `script` (string, optional)
- `script_key` (string, optional)
- `status` (enum, optional)
  - Allowed values: `authorized`, `unreviewed`, `to_be_removed`, `under_review`, `archived`
- `change` (string, optional)
- `updated_by` (string, optional)
- `vendor_name` (string, optional)
- `vendor_url` (string, optional)

## Examples

**Response**

```json
{
  "paging": {
    "previous": "",
    "current": "https://localhost:80/v1/pci/audits/scripts?appId=PXabcd1234&from=1&tld=humansecurity.com&take=31&skip=0",
    "next": "",
    "count": 31
  },
  "data": [
    {
      "event_key": "226b2511975a885acf8b74a01255fff2",
      "event_time": "2021-09-15 15:40:01 +0000 UTC",
      "app_id": "PXabcd1234",
      "host_domain": "humansecurity.com",
      "script": "humansecurity.com/js/oldscript.js",
      "script_key": "aaa111bbb222ccc333ddd444",
      "status": "unreviewed",
      "change": "New script",
      "updated_by": "HUMAN Security",
      "vendor_name": "string",
      "vendor_url": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api-gw.perimeterx.com/v1/pci/audits/scripts"

querystring = {"appId":"[\"PXabc123\",\"PXdef456\"]","from":"1674313200000","tld":"[\"domain1.com\",\"domain2.com\"]"}

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

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

print(response.json())
```

```javascript
const url = 'https://api-gw.perimeterx.com/v1/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D';
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/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D"

	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/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D")

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/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D")
  .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/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-gw.perimeterx.com/v1/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D");
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/pci/audits/scripts?appId=%5B%22PXabc123%22%2C%22PXdef456%22%5D&from=1674313200000&tld=%5B%22domain1.com%22%2C%22domain2.com%22%5D")! 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()
```