Try our conversational search powered by Generative AI!

Philipp Gaska
Jul 8, 2021
  1450
(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
The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024

What's new in Language Manager 5.3.0

In Language Manager (LM) version 5.2.0, we added an option in appsettings.json called TranslateOrCopyContentAreaChildrenBlockForTypes . It does...

Quoc Anh Nguyen | Apr 15, 2024

Optimizely Search & Navigation: Boosting in Unified Search

In the Optimizely Search & Navigation admin view, administrators can set a certain weight of different properties (title, content, summary, or...

Tung Tran | Apr 15, 2024

Optimizely CMS – Getting all content of a specific property with a simple SQL script

When you need to retrieve all content of a specific property from a Page/Block type, normally you will use the IContentLoader or IContentRepository...

Tung Tran | Apr 15, 2024

Join the Content Recommendations Work Smarter webinar May 8th 16.00-16.45 CET with expert Aidan Swain

Learn more about Content Recommendations, with Optimizely’s very own Senior Solutions consultant, Aidan Swain . He will discuss best practices and...

Karen McDougall | Apr 12, 2024