How to Verify Custom Reward From Your Website with Callback Verification

Creating a Custom Reward will allow you to auto-distribute any rewards from your websites.

For example:

Let's say you wish to provide winners with a $50 coupon reward after they have won the giveaway.

Upon successful integration of API callbacks between your site and Cwallet, the participants will receive their rewards automatically according to the method you have specified.

However, the $50 coupon reward is just one of the reward examples, because you can create any type of rewards distributed from your websites.

Why and how is it auto-distributed?

Following the successful integration of the API callback, winners will be able to claim their rewards via a specific URL containing their track_id and eligibility. Regardless of the method of delivery, the reward will be automatically sent to the winner. In this way, you are not required to manually distribute rewards on your website.

Please follow the steps to create custom rewards and to integrate API callback:

Step 1:

Enter a reward name, number of winners, and upload an image of that reward.

Step 2:

After that, you will need to get url params (something like track_id=MVNHLLEEwIR) from your website and parse out the trackId.

About track_id:

TrackId is necessary to detect the user's participation in the task and to verify it. We will detect when a user clicks to participate in the task, the ?trackId={{trackId}} will be used for detection.

You will see the ?trackId={{trackId}} applied to your website link:

If your website link is

the visitors may come to your site via the link

Step 3:

Next, please copy the API key we provide you to integrate it with your website.

Then enter the parameters according to the rules of const data, and encrypt the whole const data using the standard HmacSHA256 algorithm.

Step 4:

Use our official API below and pass the corresponding parameters in the following code.

Official API: https://cwallet.com/cctip/v1/giveaway/task/callback

const api_key =
"3lhpTSAJd6XDgBe4XWcozob4iMmYUlkPc9c4fwnoydGk4Bh5lSA3qrSiqgXeJcX7"; // your api_key

const { track_id} = queryString.parse(location.search);

const timestamp=new Date().getTime()

const data = `track_id=${track_id}&timestamp=${timestamp}`

const sign = crypto.HmacSHA256(data, api_key).toString(); // HmacSHA256

fetch("https://cwallet.com/cctip/v1/giveaway/player/status", {
method: "POST",
headers: {
"Content-Type": "application/json",
},

body: JSON.stringify({
track_id,
sign,
timestamp,
}),
}).then(async (res) => {
console.log(await res.json());
});

Step 5:

After the above steps are completed, enter your website link and click the ‘Check API callback’ to test it.

Note:

Each project you created on Cwallet Giveaway Tool will have a unique API key, and it will not change. So you only need to integrate once for a website. Also, you will be able to create custom rewards on multiple websites if you need to.

Last updated