diff --git a/examples/DeleteInteraction/client.php b/examples/DeleteInteraction/client.php new file mode 100644 index 0000000..195b951 --- /dev/null +++ b/examples/DeleteInteraction/client.php @@ -0,0 +1,29 @@ +loadPrivateKey("../private_rsa.pem"); + +$interactionId = 1; + +try { + $request = new DeleteInteractionRequest($interactionId); + + $response = $client->send($request); + + dump($response->getData()); +} catch (RequestException $exception) { + http_response_code(400); + + dump($exception->getMessage()); +} diff --git a/src/Client.php b/src/Client.php index 5c62fcd..7acf74c 100644 --- a/src/Client.php +++ b/src/Client.php @@ -10,7 +10,7 @@ class Client extends BaseClient { const API_URL = 'https://api.onecommunity.nl/v1/'; - const VERSION = '0.5.0'; + const VERSION = '0.5.1'; public function __construct(string $apiKey, int $userId, string $projectName) { diff --git a/src/Requests/DeleteInteractionRequest.php b/src/Requests/DeleteInteractionRequest.php new file mode 100644 index 0000000..9775284 --- /dev/null +++ b/src/Requests/DeleteInteractionRequest.php @@ -0,0 +1,25 @@ +interactionId = $interactionId; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function getUri(): string + { + return "interactions/{$this->interactionId}/delete"; + } +}