Ga naar hoofdinhoud

Privacy API

De Privacy API biedt endpoints voor het beheren van privacy verzoeken en consents in Joomla, conform de AVG/GDPR wetgeving.

Base URL

/api/index.php/v1/privacy

Endpoints Overzicht

Privacy Requests

MethodeEndpointBeschrijving
GET/privacy/requestsAlle privacy verzoeken ophalen
GET/privacy/requests/{id}Specifiek verzoek ophalen
POST/privacy/requestsNieuw privacy verzoek aanmaken

Privacy Consents

MethodeEndpointBeschrijving
GET/privacy/consentsAlle consents ophalen
GET/privacy/consents/{id}Specifieke consent ophalen
DELETE/privacy/consents/{id}Consent verwijderen

Privacy Requests

Alle privacy verzoeken ophalen

GET /api/index.php/v1/privacy/requests

Response

{
"data": [
{
"type": "privacy-requests",
"id": "1",
"attributes": {
"email": "gebruiker@example.com",
"requested_at": "2024-01-15 10:30:00",
"status": 1,
"request_type": "export",
"confirm_token": "abc123...",
"confirm_token_created_at": "2024-01-15 10:30:00"
}
}
]
}

Specifiek verzoek ophalen

GET /api/index.php/v1/privacy/requests/{id}

Voorbeeld

curl -X GET "https://jouwesite.nl/api/index.php/v1/privacy/requests/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN"

Privacy verzoek aanmaken

POST /api/index.php/v1/privacy/requests

Request Body

{
"email": "gebruiker@example.com",
"request_type": "export"
}

Verplichte velden

VeldTypeBeschrijving
emailstringE-mailadres van gebruiker
request_typestringType verzoek

Request Types

TypeBeschrijving
exportData export verzoek
removeData verwijdering verzoek

Voorbeeld

curl -X POST "https://jouwesite.nl/api/index.php/v1/privacy/requests" \
-H "X-Joomla-Token: JOUW_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "gebruiker@example.com",
"request_type": "export"
}'

Privacy Request Status

WaardeStatus
-1Ongeldig
0In afwachting
1Bevestigd
2Voltooid

Data Export

Na het aanmaken van een export verzoek moet de gebruiker dit bevestigen via een e-mail link. Daarna kan de data worden geëxporteerd:

GET /api/index.php/v1/privacy/requests/{id}/export

Voorbeeld

curl -X GET "https://jouwesite.nl/api/index.php/v1/privacy/requests/1/export" \
-H "X-Joomla-Token: JOUW_API_TOKEN"

De response bevat alle verzamelde gebruikersdata in JSON formaat.

Privacy Consents

Consents zijn akkoordverklaringen die gebruikers hebben gegeven voor privacy policies.

Alle consents ophalen

GET /api/index.php/v1/privacy/consents

Response

{
"data": [
{
"type": "privacy-consents",
"id": "1",
"attributes": {
"user_id": 42,
"state": 1,
"created": "2024-01-15 10:30:00",
"subject": "PLG_SYSTEM_PRIVACYCONSENT_SUBJECT",
"body": "Privacy policy tekst...",
"remind": 0
}
}
]
}
DELETE /api/index.php/v1/privacy/consents/{id}
Let op

Het verwijderen van een consent record is permanent. Dit is meestal alleen nodig bij data verwijdering verzoeken.

Voorbeeld

curl -X DELETE "https://jouwesite.nl/api/index.php/v1/privacy/consents/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN"

AVG/GDPR Workflow

1. Export verzoek

2. Verwijdering verzoek

Filtering

Op status

GET /api/index.php/v1/privacy/requests?filter[status]=1

Op type

GET /api/index.php/v1/privacy/requests?filter[request_type]=export

Op e-mail

GET /api/index.php/v1/privacy/requests?filter[email]=gebruiker@example.com

Privacy Plugins

Joomla verzamelt data via privacy plugins. Standaard plugins:

PluginData verzameld
Privacy - ContactsContact formulier data
Privacy - ContentArtikelen van gebruiker
Privacy - UserGebruikersaccount data
Privacy - Action LogsActie logs
Privacy - ConsentsConsent records

Voorbeeld: Automatische export

<?php
/**
* Automatisch privacy export verzoek verwerken
*/
function processPrivacyExport($requestId) {
$url = "https://jouwesite.nl/api/index.php/v1/privacy/requests/{$requestId}";
$token = 'JOUW_API_TOKEN';

// Controleer status
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Joomla-Token: ' . $token
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

// Als bevestigd, haal export op
if ($response['data']['attributes']['status'] == 1) {
$exportUrl = $url . '/export';
// ... export ophalen
}

return $response;
}
?>
Privacy compliance

Zorg ervoor dat je privacy verzoeken binnen de wettelijke termijn (meestal 30 dagen) verwerkt. Gebruik de API om dit proces te automatiseren.