Vielen Dank für Deinen Eintrag!
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const id = urlParams.get(‚id');
console.log(id);
async function optin() {
const response = await fetch(‚https://api.db-ip.com/v2/free/self');
const data = await response.json();
const ipAdresse = data.ipAddress;
const URL = ‚https://www.zohoapis.eu/crm/v4/functions/optin__optInFunction/actions/execute?auth_type=apikey&zapikey=1003.5c144d73426bb590deb47e1baa5aa71f.1d66cc859a81fc7f90beefe6a2b5c9ec';
const URL1 = URL + ‚&id=' + id + ‚&ipAdresse=' + ipAdresse;
console.log(URL1);
const settings = {
cache: false,
dataType: ‚jsonp',
async: true,
crossDomain: true,
url: URL1,
method: ‚POST',
headers: {
accept: ‚application/json',
‚Access-Control-Allow-Origin': ‚*',
},
};
const response1 = await $.ajax(settings);
console.log(response1);
}
optin();