Several methods are possible to send a user's choices to your server
window._axcb = window._axcb || [];window._axcb.push(function (axeptio) {axeptio.on('cookies:complete', function (choices) {fetch('/backend/consent', {method: 'POST',body: {settings: axeptio.settings,choices: choices}}).then(function (response) {console.info('successfully saved user preferences');}).catch(function (error) {console.info('something went wrong');})});});
window._axcb = window._axcb || [];window._axcb.push(function (axeptio) {axeptio.on('ready', function () {fetch('/backend/token', {method: 'POST',body: { token: axeptio.settings.token }}).then(function (response) {console.info('successfully saved user token');}).catch(function (error) {console.info('something went wrong');})});});
Send a POST request for the webhook creation :
POST https://api.axept.io/v1/webhooksAuthorization: Bearer XXXXXXXXXXXXX <-- your bearer token{"method": "POST","url": "https://www.yourwebsite.com/backend/consent","event": "consent/XXXXXXXXXXXXX" <-- your project Id}
<script>window.axeptioSettings = {clientId: "XXXXXXXXXXXX",cookiesVersion: "ga_only",token: <?php echo json_encode(session_id()) ?>};(function(d, s) {var t = d.getElementsByTagName(s)[0], e = d.createElement(s);e.async = true; e.src = "//static.axept.io/sdk.js";t.parentNode.insertBefore(e, t);})(document, "script");</script>
Send a POST request for the webhook creation :
POST https://api.axept.io/v1/webhooksAuthorization: Bearer XXXXXXXXXXXX <-- your bearer token{"method": "POST","url": "https://www.yourwebsite.com/backend/consent","event": "consent/XXXXXXXXXXXXX" <-- your project Id}