$apiInstance = new Fastly\Api\ClientSideProtectionApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| cspCreatePage() | POST /client-side-protection/v1/pages | Create page |
| cspCreatePolicy() | POST /client-side-protection/v1/pages/{page_id}/policies | Create policy |
| cspCreateWebsite() | POST /client-side-protection/v1/websites | Create website |
| cspDeletePage() | DELETE /client-side-protection/v1/pages/{page_id} | Delete page |
| cspDeleteWebsite() | DELETE /client-side-protection/v1/websites/{website_id} | Delete website |
| cspGetPage() | GET /client-side-protection/v1/pages/{page_id} | Get page |
| cspGetPolicy() | GET /client-side-protection/v1/pages/{page_id}/policies/{policy_id} | Get policy |
| cspGetScript() | GET /client-side-protection/v1/pages/{page_id}/scripts/{script_id} | Get script |
| cspGetWebsite() | GET /client-side-protection/v1/websites/{website_id} | Get website |
| cspListHeaderEvents() | GET /client-side-protection/v1/pages/{page_id}/events | List header events |
| cspListHeaders() | GET /client-side-protection/v1/pages/{page_id}/headers | List security headers |
| cspListPages() | GET /client-side-protection/v1/pages | List pages |
| cspListPolicies() | GET /client-side-protection/v1/pages/{page_id}/policies | List policies |
| cspListPolicyReports() | GET /client-side-protection/v1/pages/{page_id}/policies/{policy_id}/reports | List policy reports |
| cspListScripts() | GET /client-side-protection/v1/pages/{page_id}/scripts | List scripts |
| cspListWebsites() | GET /client-side-protection/v1/websites | List websites |
| cspUpdatePage() | PATCH /client-side-protection/v1/pages/{page_id} | Update page |
| cspUpdatePolicy() | PATCH /client-side-protection/v1/pages/{page_id}/policies/{policy_id} | Update policy |
| cspUpdateScript() | PATCH /client-side-protection/v1/pages/{page_id}/scripts/{script_id} | Update script |
| cspUpdateWebsite() | PATCH /client-side-protection/v1/websites/{website_id} | Update website |
cspCreatePage($options): \Fastly\Model\Page // Create pageCreate a new page for monitoring.
$options['page_create'] = new \Fastly\Model\PageCreate(); // \Fastly\Model\PageCreate
try {
$result = $apiInstance->cspCreatePage($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspCreatePage: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_create | \Fastly\Model\PageCreate | [optional] |
[Back to top] [Back to API list] [Back to README]
cspCreatePolicy($options): \Fastly\Model\Policy // Create policyCreate a new Content Security Policy for a page.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_create'] = new \Fastly\Model\PolicyCreate(); // \Fastly\Model\PolicyCreate
try {
$result = $apiInstance->cspCreatePolicy($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspCreatePolicy: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| policy_create | \Fastly\Model\PolicyCreate | [optional] |
[Back to top] [Back to API list] [Back to README]
cspCreateWebsite($options): \Fastly\Model\Website // Create websiteCreate a new website for Client-Side Protection monitoring.
$options['website_create'] = new \Fastly\Model\WebsiteCreate(); // \Fastly\Model\WebsiteCreate
try {
$result = $apiInstance->cspCreateWebsite($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspCreateWebsite: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| website_create | \Fastly\Model\WebsiteCreate | [optional] |
[Back to top] [Back to API list] [Back to README]
cspDeletePage($options) // Delete pageDelete a page and all associated scripts and policies.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
try {
$apiInstance->cspDeletePage($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspDeletePage: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
cspDeleteWebsite($options) // Delete websiteDelete a website and all associated pages, scripts, and policies.
$options['website_id'] = 2Xk9JgPCkf1NzVsNmKrECp; // string | Website identifier
try {
$apiInstance->cspDeleteWebsite($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspDeleteWebsite: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| website_id | string | Website identifier |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
cspGetPage($options): \Fastly\Model\Page // Get pageGet details for a specific page.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
try {
$result = $apiInstance->cspGetPage($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspGetPage: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier |
[Back to top] [Back to API list] [Back to README]
cspGetPolicy($options): \Fastly\Model\Policy // Get policyGet details for a specific policy.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_id'] = 7Cp4OlUHqj6SfAwSrQwJHu; // string | Policy identifier
try {
$result = $apiInstance->cspGetPolicy($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspGetPolicy: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| policy_id | string | Policy identifier |
[Back to top] [Back to API list] [Back to README]
cspGetScript($options): \Fastly\Model\Script // Get scriptGet details for a specific script.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['script_id'] = 5An2MjSFoh4QcYvQpNuHFs; // string | Script identifier
try {
$result = $apiInstance->cspGetScript($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspGetScript: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| script_id | string | Script identifier |
[Back to top] [Back to API list] [Back to README]
cspGetWebsite($options): \Fastly\Model\Website // Get websiteGet details for a specific website.
$options['website_id'] = 2Xk9JgPCkf1NzVsNmKrECp; // string | Website identifier
try {
$result = $apiInstance->cspGetWebsite($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspGetWebsite: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| website_id | string | Website identifier |
[Back to top] [Back to API list] [Back to README]
cspListHeaderEvents($options): \Fastly\Model\InlineResponse20011 // List header eventsList security header change events for a page.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListHeaderEvents($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListHeaderEvents: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse20011
[Back to top] [Back to API list] [Back to README]
cspListHeaders($options): \Fastly\Model\InlineResponse20010 // List security headersList security headers detected on a page.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListHeaders($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListHeaders: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse20010
[Back to top] [Back to API list] [Back to README]
cspListPages($options): \Fastly\Model\InlineResponse2006 // List pagesList all pages. Optionally filter by website.
$options['website_id'] = 'website_id_example'; // string | Filter pages by website ID
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListPages($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListPages: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| website_id | string | Filter pages by website ID | [optional] |
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse2006
[Back to top] [Back to API list] [Back to README]
cspListPolicies($options): \Fastly\Model\InlineResponse2008 // List policiesList all Content Security Policies for a page.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListPolicies($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListPolicies: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse2008
[Back to top] [Back to API list] [Back to README]
cspListPolicyReports($options): \Fastly\Model\InlineResponse2009 // List policy reportsList CSP violation reports for a policy.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_id'] = 7Cp4OlUHqj6SfAwSrQwJHu; // string | Policy identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListPolicyReports($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListPolicyReports: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| policy_id | string | Policy identifier | |
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse2009
[Back to top] [Back to API list] [Back to README]
cspListScripts($options): \Fastly\Model\InlineResponse2007 // List scriptsList all scripts detected on a page.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListScripts($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListScripts: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse2007
[Back to top] [Back to API list] [Back to README]
cspListWebsites($options): \Fastly\Model\InlineResponse2005 // List websitesList all websites configured for Client-Side Protection.
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.
try {
$result = $apiInstance->cspListWebsites($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspListWebsites: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Limit how many results are returned. | [optional] [defaults to 100] |
| page | int | Page number of the collection to request. | [optional] [defaults to 0] |
\Fastly\Model\InlineResponse2005
[Back to top] [Back to API list] [Back to README]
cspUpdatePage($options): \Fastly\Model\Page // Update pageUpdate a page's configuration.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['page_update'] = new \Fastly\Model\PageUpdate(); // \Fastly\Model\PageUpdate
try {
$result = $apiInstance->cspUpdatePage($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspUpdatePage: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| page_update | \Fastly\Model\PageUpdate | [optional] |
[Back to top] [Back to API list] [Back to README]
cspUpdatePolicy($options): \Fastly\Model\Policy // Update policyUpdate a policy's configuration.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_id'] = 7Cp4OlUHqj6SfAwSrQwJHu; // string | Policy identifier
$options['policy_update'] = new \Fastly\Model\PolicyUpdate(); // \Fastly\Model\PolicyUpdate
try {
$result = $apiInstance->cspUpdatePolicy($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspUpdatePolicy: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| policy_id | string | Policy identifier | |
| policy_update | \Fastly\Model\PolicyUpdate | [optional] |
[Back to top] [Back to API list] [Back to README]
cspUpdateScript($options): \Fastly\Model\Script // Update scriptUpdate a script's authorization status or justification.
$options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['script_id'] = 5An2MjSFoh4QcYvQpNuHFs; // string | Script identifier
$options['script_update'] = new \Fastly\Model\ScriptUpdate(); // \Fastly\Model\ScriptUpdate
try {
$result = $apiInstance->cspUpdateScript($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspUpdateScript: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page_id | string | Page identifier | |
| script_id | string | Script identifier | |
| script_update | \Fastly\Model\ScriptUpdate | [optional] |
[Back to top] [Back to API list] [Back to README]
cspUpdateWebsite($options): \Fastly\Model\Website // Update websiteUpdate a website's configuration.
$options['website_id'] = 2Xk9JgPCkf1NzVsNmKrECp; // string | Website identifier
$options['website_update'] = new \Fastly\Model\WebsiteUpdate(); // \Fastly\Model\WebsiteUpdate
try {
$result = $apiInstance->cspUpdateWebsite($options);
} catch (Exception $e) {
echo 'Exception when calling ClientSideProtectionApi->cspUpdateWebsite: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| website_id | string | Website identifier | |
| website_update | \Fastly\Model\WebsiteUpdate | [optional] |