# 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="/files/KVaCsu5iDy8MAsprY1NE" 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="/files/gvaGlfatIFY8Kq6tFpaH" alt=""><figcaption></figcaption></figure>

Your custom level will appear as follows:

<figure><img src="/files/JAi7IiQ89R0PuXfQf7rM" 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="/files/FqL9UFlL48i41chlyjSS" 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

```
http://example.com
```

the visitors may come to your site via the link

```
http://example.com/?track_id=12345_67890&send=true
```

### **Step 3**

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

<figure><img src="/files/fpPf3swA3Arrbwzf98fb" 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.**

```
const data = `track_id=${track_id}&event=send&remark=${remark}`; // remark is optional.
```

### **Step 4**

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

**official API:** [https://giveaway.com/public/v1/giveaway/task/callback](<https://giveaway.com/public/v1/giveaway/task/callback&#xA;>)

```javascript
const api_key = "{{your api_key}}";
const {track_id} = queryString.parse(window.location.search); // url search
const event="send" //your chosen event
const remark = "remark"; //add remark optional
const value="{{your event value}}"
const data = `track_id=${track_id}&event=${event}&value=${value}&remark=${remark}`; // optional
const sign = crypto.HmacSHA256(data, api_key).toString(); // HmacSHA256
fetch("https://giveaway.com/public/v1/giveaway/task/callback", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    track_id,
    sign,
    event,
    remark,
    value
  }),
}).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="/files/FTQh1or2eQuavNE7eKST" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Each project you create on **Giveaway** 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.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.giveaway.com/project-partner-tutorial/other-faq/tasks/callback-verifications-instruction/how-to-verify-the-user-player-vip-level-requirement-on-your-website-with-callback-verification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
