# How to Create Free Mint NFT Rewards with Callback Verification

With the successful integration of the API callback, winners will be able to mint their own NFT on your website via a specific URL containing their track\_id and eligibility.

**Please follow the steps to create Free Mint NFT reward and to integrate API callback.**&#x20;

**Step 1**

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

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/5hLdQY9KzsChYBi6Gk71/image%20150%20(1).png" alt=""><figcaption></figcaption></figure>

**Step 2**

After that, you will need to get url params (something like <mark style="color:green;">track\_id=Edg1Y475BiU</mark>) from your website and parse out the trackId.

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/pEx72fpYRGh2Rg2cEAQo/Frame%20514338%20(1).png" alt=""><figcaption></figcaption></figure>

<mark style="color:blue;">**About track\_id:**</mark>

* 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 <mark style="color:green;">?trackId={{trackId}}</mark> will be used for detection.
* You will see the <mark style="color:green;">?trackId={{trackId}}</mark> applied to your website link:

If your website link is

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/HWxRvAwj3EnKpzY7cIhq/Frame%20514339%20(1).png" alt=""><figcaption></figcaption></figure>

the visitors may come to your site via the link

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/9afU34uPffOMggsX6CPD/Frame%20514340%20(1).png" alt=""><figcaption></figcaption></figure>

**Step 3**

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

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/tgLgKqCWh2tiEK0H6b1M/image%20151.png" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/6iqkcWc6WHD8qutPOdCx/Frame%20514341%20(1).png" alt=""><figcaption></figcaption></figure>

**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>

```javascript
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.

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/L6QfpNIvyhtsgLjvEFZw/image%20152.png" alt=""><figcaption></figcaption></figure>

**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 Free Mint NFT reward on multiple websites if you need to.
