# 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="/files/KD9eKd5kIhfsrINclyte" 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="/files/dxFdKAzoJWubhW1OK0fh" 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 

![](/files/qyoKv90bw76UaWOWp2iK)

Then your custom tasks will appear as follows:

<figure><img src="/files/3B9n3ppncyDd9Np0s7UL" 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="/files/PJkURdhCks6Hoay69IrN" 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="/files/AvTXnYdN37yALhcZW5Rx" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/fPzmjavoxL4hz3EhowRj" alt=""><figcaption></figcaption></figure>

**Step 4**

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

<figure><img src="/files/4AOd2KfknT9PdVZDVMWm" 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="/files/lg6YfAeg5sZ8emqqygZZ" 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="/files/L6SAQw1T1PbdFAltiYkL" 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.


---

# 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://docs.cwallet.com/cwallet-tools/giveaway/how-to-verify-actions-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.
