Rights Request Integration
For any right request form, certain fields are required, and they must have a specific name for 4Comply to recognize them.
The required fields are:
- Email Address: this is the main identifier in 4Comply, so it must be sent with every request. The expected name form the JSON is email.
- Request Type: in the 4Comply system there are 4 request types, Right to Access (RTA), Right to be Forgotten (RTBF), Right to Portability (RTP), and Right to Update (RTU). Each right request form submission needs to identify itself as one of the 4 types. The accepted values are the ones between parenthesis. And, the expected name form the JSON is request_type.
- Geo Override: This must contain a valid country value that is used in 4Comply to determine the correct Regulation to use. This is a parameter that is passed as a request header. By default, the list of countries in the system uses the two-letter (ISO 3166-1 alpha-2) code, but you can personalize the values to meet your needs. The expected name is geo_override.
Now, you can send a request to 4Comply including the required fields. This is an example using jQuery to submit the information to 4Comply:
$(function () {
$('form').submit(e => {
$.ajax({
type: "POST",
beforeSend: function (request) {
request.setRequestHeader("Content-type", "application/json");
request.setRequestHeader("Accept", "application/json");
//Set your tenant_id
request.setRequestHeader("client_id", "Your-Client-Id");
//Get the country field value from the form
request.setRequestHeader("geo_override", $('select[name="country"]').val());
},
url: "https://api.4comply.io/v1/rightrequests",
data: JSON.stringify({
//Get the email address from the form
'email': $('input[name="email_address"]').val(),
'request_type': 'RTA'
}),
success: function (data) {
console.log("Response: " + data);
},
error: function (xhr, status, error) {
console.error("Error: " + error);
}
});
});
});
The data sent to 4Comply should be in the JSON key-value format. That's why we use the stringify function to parse the data.
You can use the code above with any right processing request, the only difference would be the Request Type; instead of 'RTA', you can send 'RTU' or 'RTP' or 'RTBF'.