forked from pdfrest/pdfrest-api-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
25 lines (20 loc) · 1.16 KB
/
Copy pathdelete.php
File metadata and controls
25 lines (20 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require 'vendor/autoload.php'; // Require the autoload file to load Guzzle HTTP client.
use GuzzleHttp\Client; // Import the Guzzle HTTP client namespace.
use GuzzleHttp\Psr7\Request; // Import the PSR-7 Request class.
use GuzzleHttp\Psr7\Utils; // Import the PSR-7 Utils class for working with streams.
// By default, we use the US-based API service. This is the primary endpoint for global use.
$apiUrl = "https://api.pdfrest.com";
/* For GDPR compliance and enhanced performance for European users, you can switch to the EU-based service by uncommenting the URL below.
* For more information visit https://pdfrest.com/pricing#how-do-eu-gdpr-api-calls-work
*/
//$apiUrl = "https://eu-api.pdfrest.com";
$delete_client = new Client(['http_errors' => false]);
$delete_headers = [
'api-key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'Content-Type' => 'application/json'
];
$delete_body = '{"ids":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}';
$delete_request = new Request('POST', $apiUrl.'/delete', $delete_headers, $delete_body);
$delete_res = $delete_client->sendAsync($delete_request)->wait();
echo $delete_res->getBody() . PHP_EOL;