# How to Verify Actions on Your Website with Callback Verification

### Why Callback Verification?

With callback verification, you can get users to do tasks on your website such as sign up, deposit, purchase, clicks and everything else. It is VERIFIABLE regardless of the tasks. It is possible to add multiple tasks to the same website, as well as to use multiple websites.

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

**Step 1**

To verify the task, you will need to enable **Callback verification** firs&#x74;**.**&#x20;

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

**Step 2**

To let participants know what the task is, choose one or more tasks and give them a name as a description.\
\ <mark style="color:blue;">**Single task:**</mark> e.g. Choose Sign up as your website task and describe what you would like the user to do as the Task Name.

<mark style="color:blue;">**Multiple tasks:**</mark> e.g. Choose Sign up and Play Game as your website tasks and describe what you would like the user to do as the Task Name.

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/em6XgbtXDqUcs30QP8mN/Screen%20Shot%202022-11-11%20at%2019.40.21.png" alt=""><figcaption></figcaption></figure>

<mark style="color:blue;">**Custom tasks:**</mark> Moreover, it is also possible to customize tasks and add relevant required amount. 

e.g. You create a task: like 3 articles in your website 

![](https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/sIKdfmZSMkhQckqAkukP/Screen%20Shot%202022-11-11%20at%2015.26.39.png)

Then your custom tasks will appear as follows:

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

**Step 3**

Then, you need to obtain url search params (e.g. <mark style="color:green;">track\_id=U$MikHklwcY\&sign\_up=true\&invite=true</mark>) from your website and parse out the trackId.

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

🔸**About Track\_Id:**

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

If your website link is&#x20;

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

the visitors may come to your site via the link:&#x20;

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

**Step 4**

Please copy the **API key** we provide you to integrate it with your website.

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/Uk4Tb2kuB788Pw2Def5c/cb7.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..&#x20;

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

Note: **remark** is optional. You may omit it if you do not require it.

**Step 5**

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

**Official API:** <https://cwallet.com/public/v1/giveaway/task/callback>

```javascript
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());
    });

```

**Step 6**

Upon successful completion of the above steps, you may click on the Check API callback to test it.

<figure><img src="https://content.gitbook.com/content/LIfMHqDEB5rVHERvbUyz/blobs/wxZ5cXd1FcDYYqVozJ1r/web.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 tasks on multiple websites if you need to.
