Delete a legal basis for user data processing using DELETE.
For every API request you make, you'll need to present the API access key in the HTTP Header as X-API-Key to be authenticated.
$request_url = 'https://api.frontcore.com/v2/privacy/users/:id/legalbases';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-API-Key: {your-api-key}',
'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
If the method is successful it responds with an JSON structure, as it is shown below.
{ "id": 2911, "idLead": null, "consent": { "id": 146, "title": "Yes, I want e-mail about new courses once a week", "version": 1, "created_at": "2020-04-27T22:27:16+02:00", "updated_at": "2020-04-27T22:27:16+02:00", "deleted_at": null }, "legal_basis": { "id": 1, "title": "Consent" }, "purpose": { "id": 112, "title": "Marketing", "created_at": "2020-04-27T22:16:58+02:00", "updated_at": null, "deleted_at": null }, "source": { "id": 3, "title": "Incoming request" }, "comment": "Consent given via registration form", "created_at": "2020-04-27T22:34:58+02:00", "updated_at": "2020-04-27T22:34:58+02:00", "deleted_at": "2020-04-28T22:34:58+02:00", "idUser": 2911 }
Unsuccessful response sample:
{ "error": "Wrong API Key" }