Try our conversational search powered by Generative AI!

Philipp Gaska
Jul 8, 2021
  1458
(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
Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog