How to Set and Verify Custom App Actions with Callback Verification

Utilize callback verification to automatically verify whether users have taken any actions within the app.

Utilize callback verification to automatically verify whether users have taken any actions within the app. Participants who have performed the actions are eligible to complete this task. All types of tasks can be verified!

Follow the steps to enable the callback verification:

Step 1

To let participants know what the task is, choose one or more tasks and give them a name as a description.

  • Add Single or Multiple Tasks You can choose one of the existing tasks or click the 'Custom task' button to add a different task with or without a specific value related to the task. You can also choose or custom multiple tasks for participants to complete in order to join your giveaway.

Step 2

Then, you need to get url search params from your website and parse out the track_id.

track_id=U$MikHklwcY&sign_up=true&invite=true

About track_id:

  • Every participant will have a unique track_id, so that we can verify if the participant really complete the required task. The ?track_id={{ track_id }} will be used for verification.

  • You will see the ?track_id={{ track_id }}&send=true applied to your website link: For example, if your website link is

http://example.com

the participants may come to your site via a link like this

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.

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.

Note: adding a remark is optional.

Official API

https://giveaway.com/public/v1/giveaway/task/callback

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

After the above steps are completed, enter your website URL and click the 'Check API callback' to test it.

Each project you created on Giveaway.com 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.

Last updated