Try our conversational search powered by Generative AI!

Philipp Gaska
Jul 8, 2021
  1466
(1 votes)

Right to be forgotten: Deleting recipient data

Data security and protecting the privacy of your customers and newsletter recipients is vital important. With the introduction of the General Data Protection Regulation (GDPR) at the latest, you must provide the possibility of deleting personal data upon request. This is embodied in Article 17 of the GDPR – the so-called "Right to be forgotten".

To irrevocably delete all recipient data from Episerver Campaign (except blocklist entries which is anonymized data), you can use the recipient history in the Episerver Campaign user interface.

A more flexible way is using the Episerver Campaign REST API. This lets you delete recipient data remotely – without logging in to Episerver Campaign. You can, for example, use the Swagger Try it out feature, enter the curl request in the Windows command prompt, or implement a deletion option right into your system, such as a CRM software.

To delete recipient data via REST API, use the DELETE /{clientId}​/recipients operation.

You need the following information:

  • Client ID. The ID of the client the REST API is set up for. You can find the client ID in Episerver Campaign under Administration > API Overview > REST API.
  • Reason. Reason for data deletion.
  • Recipient key. Recipient ID, usually the email address.

The request in curl looks as follows:

curl -X DELETE "https://api.campaign.episerver.net/rest/123456789/recipients?reason=customerrequest&recipientKey=recipient%40example.com" -H "Authorization: BASIC k783r3fjn989dhnfjjdr83dgds1383NDfv="

The following example shows the request as PHP code.

Note: The PHP code is a basic example and is not ready to use in your live system. Use it only as a template for testing and adapt the code to your company's internal requirements.
<?php
$user = 'user@example.com'; // API user name, usually your email address 
$password = 'password'; // password of your API user
$clientId = 123456789; // ID of the client the REST API is set up for
$recipientId = 'recipient@example.com'; // ID of the recipient whose data is to be deleted
$reason = 'customerrequest'; // reason for data deletion (without blanks)
$URL = 'https://api.campaign.episerver.net/rest/'.$clientId.'/recipients?recipientKey='.$recipientId.'&reason='.$reason;

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,$URL);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "$user:$password");

$result = curl_exec ($curl);
$result = json_decode($result, true);
     
echo '<pre>';
var_dump ($result);
echo '</pre><br>';

curl_close ($curl);       

?>​
Tip: To delete the recipient's blocklist entry, you can use the DELETE​/{clientId}​/blacklistentries​/{entry} operation.
Jul 08, 2021

Comments

Please login to comment.
Latest blogs
Configured Commerce - Infrastructure Updates Ahoy!

I'm very happy to share an important milestone - we no longer have any customers in our legacy v1 environment!  This means that the Configured...

John McCarroll | May 10, 2024

A day in the life of an Optimizely Developer - Enabling Opti ID within your application

Hello and welcome to another instalment of A Day In The Life Of An Optimizely developer, in this blog post I will provide details on Optimizely's...

Graham Carr | May 9, 2024

How to add a custom property in Optimizely Graph

In the Optimizely CMS content can be synchronized to the Optimizely Graph service for it then to be exposed by the GraphQL API. In some cases, you...

Ynze | May 9, 2024 | Syndicated blog

New Security Improvement released for Optimizely CMS 11

A new security improvement has been released for Optimizely CMS 11. You should update now!

Tomas Hensrud Gulla | May 7, 2024 | Syndicated blog