iubenda’s Consent Database is available via two different channels which allow you to choose the cycle of periodic updates that best suits your needs:
You can specify the channel you want to use by using the dedicated dropdown menu next to “Sync your iubenda legal documents with the Consent Database” (to get there: Dashboard > [Your site] > Consent Database > Embed):
Let’s assume that you want to use the beta channel. The code generated for the current channel is:
<script type="text/javascript">
var _iub = _iub || {};
_iub.cons_instructions = _iub.cons_instructions || [];
_iub.cons_instructions.push(["init", {
api_key: "XXXXXXXX" //use you api_key
}]);
</script>
<script type="text/javascript" src="https://cdn.iubenda.com/cons/iubenda_cons.js" async></script>
Once selected “Beta” from the dropdown menu, it will become:
<script type="text/javascript">
var _iub = _iub || {};
_iub.cons_instructions = _iub.cons_instructions || [];
_iub.cons_instructions.push(["init", {
api_key: "XXXXXXXX" //use you api_key
}]);
</script>
<script type="text/javascript" src="https://cdn.iubenda.com/cons/beta/iubenda_cons.js" async></script>
Copy the resulting code (make sure to use your api_key) and paste it into the HEAD
tag of your site, replacing the default one.
The examples suggested for the current channel are:
//Create consent
curl -H "ApiKey: XXXXXXXX" -X POST "https://consent.iubenda.com/consent/"
//Create subjects
curl -H "ApiKey: XXXXXXXX" -X POST "https://consent.iubenda.com/subjects/"
Once selected “Beta” from the dropdown menu, they’ll become:
//Create consent
curl -H "ApiKey: XXXXXXXX" -X POST "https://consent.iubenda.com/beta/consent/"
//Create subjects
curl -H "ApiKey: XXXXXXXX" -X POST "https://consent.iubenda.com/beta/subjects/"
More on the HTTP API documentation.
The complete changelog is available at this link.