# How to Verify the User/Player/VIP Level Requirement on Your Website with Callback Verification

**How the task works**

With this Level Requirement task, you can create giveaways only available for eligible users who meet the level requirements, and participants who don’t meet this requirement will not be able to join this giveaway. It helps you filter qualified participants and encourage users to reach the level you require for your website.

**Please follow the steps to set up the task and to integrate API callback.**&#x20;

**Step 1**

Choose a level type as the requirement for level verification on your website:&#x20;

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/5PXdekluWrHLoOVHHSpE/11.png" alt=""><figcaption></figcaption></figure>

<mark style="color:blue;">**To custom level requirement:**</mark>

You can customize the level name and relevant requirement based on the design of your website:

E.g. You can add a level type: super vip 4&#x20;

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/ksEHl0HzUA73czT4HeFh/custom.png" alt=""><figcaption></figcaption></figure>

Your custom level will appear as follows:

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/ijdQNIojjCeYqRS64hEb/cus2.png" alt=""><figcaption></figcaption></figure>

**Step 2**

After that, you will need to obtain URL search params (<mark style="color:green;">track\_id=MikHklwcY\&leve1=true</mark>） from your website and parse out the trackId.

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

<mark style="color:blue;">**About TrackId:**</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}}\&level1=true</mark> applied to your website link:

If your website link is

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/MJpqHmvWIGjxfwATIQkN/Frame%20514336%20(3).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/0NsH1Rm9oeQtb4m8hviB/Frame%20514337%20(2).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/I4AoWzLcv8bjagvaGg1E/api.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/SukaJGYvbtecSp2miYTk/Frame%20514335%20(6).png" alt=""><figcaption></figcaption></figure>

**Step 4**

Use our official API below and pass the corresponding parameters in the following code.&#x20;

**official API:** <https://cwallet.com/cctip/v1/giveaway/task/callback>

```javascript
// const api_key =
      "3lhpTSAJd6XDgBe4XWcozob4iMmYUlkPc9c4fwnoydGk4Bh5lSA3qrSiqgXeJcX7"; // your api_key
    const event = “level1” //your chose level

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

    const remark = "remark"; // optional

    const data = `track_id=${track_id}&event=${event}&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,
        remark,
      }),
    }).then(async (res) => {
      console.log(await res.json());
    });
```

**Step 5**

Enter your website address and click '**Check API callback**' to test if the integration is successful and task is verifiable.

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/sdxST9xhCgriDtQdJgWl/ck2.png" alt=""><figcaption></figcaption></figure>

**Note**:&#x20;

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 tasks on multiple websites if you need to.
