How to Verify Actions on Your Website with Callback Verification
If you host a giveaway, you might want to learn how to optimize the performance of your campaign, and gain leads and traffic.
const api_key =
"3lhpTSAJd6XDgBe4XWcozob4iMmYUlkPc9c4fwnoydGk4Bh5lSA3qrSiqgXeJcX7"; // your api_key
const { track_id, send } = queryString.parse(window.location.search); // url search
const remark = "remark"; // optional
const data = `track_id=${track_id}&event=${send}&remark=${remark}`; // optional
const sign = crypto.HmacSHA256(data, api_key).toString(); // HmacSHA256
fetch("https://cwallet.com/public/v1/giveaway/task/callback", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
track_id,
sign,
event: send,
remark,
}),
}).then(async (res) => {
console.log(await res.json());
});