Callbacks

The Callback is the basis by which you can reward your users. The Callback is a GET request that is sent to your processing script upon the conclusion of a transaction - either a complete C, screenout P, or overquota F.

This request contains important information about which user needs to be rewarded, what offer was taken, and how much virtual currency they should be paid.

Setup Callback

Dynata supports secure hasing on system-to-system callbacks. Please reach out to a Dynata account manager to configure the Callback URL. Follow the steps below to complete your setup.

How to create a Processing Script

  1. Create an endpoint that can receive a GET request to its location.

  2. Reward your users for completes and screen-out rewards (if applicable).

  3. Store information in your database

  4. Respond with a 1 if callback received & processed correctly and 0 if you require us to repeat the callback (can be repeated three more times).

Add the Callback to your application

  1. Go to Apps section.

  2. Select your Application.

  3. Click on the Callback section.

  4. Click on the Setup Callback button.

  5. Enter your Callback URL.

  6. Click Save button.

Callback Responses

Sample processing script location (sometimes referring to a php, aspx, or another script depending on your webapp configuration)

app-domain.com/callback

Parameters will be appended with their corresponding variables after the processing script location as follows:

app-domain.com/callback?cmd=transactionComplete&userId=user123-9370-d163590aa9&amt=100&offerInvitationId=1234&status=C&oiHash=2ef1130cca32cd030141d8935dec0992&currencyAmt=20000&transactionId=4321&endUserId=user123&offerTitle=TestProject&useragent=Peanut+Labs+Media&profiler=&currencyName=Chachingz&offerType=survey&txnHash=66a2b2987083666c76592d505240748e&program=&transactionSource=iframe&

Callback Parameters

cmd

will always be transactionComplete

userId

Peanut Labs userId as generated earlier.

amt

Amount paid in dollars to you for this particular transaction. In rare cases we may pass a negative value to indicate a chargeback. (See more on chargebacks below)

offerInvitationId

Enables you to remember for which offer a user has been rewarded for.

status

F - user screened out of survey, the required number of responses from this demographic has already been met.

C - user successfully completed the transaction.

P - user screened out of survey, does not have the relevant attributes needed.

oidHash

32 character hex string = md5(concat(offerInvitationId, applicationKey))

You should verify oidHash upon receipt of the callback by recomputing it with the callback offerInvitationId and your ApplicationKey. This will secure against users faking their own id and passing it in if by some chance they come across the script.

currencyAmt

Payout to user in your virtual currency. Important for screenout rewards.

integer (default) or float (on request)

Indicates how many points the user should get in your site’s virtual currency. Based on your configured conversion rate on the control panel. Negative values indicate chargebacks.

transactionId

Unique ID representing a single user participating in a single survey/offer, please include if requesting support for a particular transaction.

txnHash

32 character hex string = md5(concat(transactionId, current TransactionKey)) You can find your TransactionKey in your Application list.

sub_id

Optional alias identifier to track traffic on campaigns, can be used for testing and segmentation purposes.

IP Whitelist

We highly recommend whitelisting the following IPs to secure your system from fraudulent callbacks. If the following list is update, you will be notified via email prior to the change.

107.20.152.198, 107.20.201.76, 107.20.235.89, 107.20.246.140, 107.20.248.88, 107.22.160.14, 107.22.160.31, 107.22.160.89, 107.22.162.83, 107.22.164.5, 107.22.164.53, 107.22.164.55, 107.22.164.59, 107.22.164.67, 107.22.164.69, 174.129.209.2, 174.129.209.23, 174.129.219.230, 174.129.22.190, 174.129.237.1, 174.129.238.17, 174.129.240.137, 174.129.242.30, 174.129.37.199, 184.72.221.219, 184.72.222.104, 184.72.222.51, 184.72.230.119, 184.73.153.111, 184.73.158.48, 184.73.166.67, 184.73.196.208, 184.73.244.77, 184.73.249.128, 184.73.250.161, 184.73.254.133, 184.73.254.159, 23.21.123.40, 50.16.236.39, 50.16.239.186, 50.16.241.60, 50.16.243.67, 50.16.245.185, 50.16.249.162, 50.16.249.58, 50.16.250.192, 50.17.181.11, 50.17.181.118, 50.17.181.130, 50.17.182.17, 50.17.182.19, 50.17.182.38, 50.17.184.153, 50.17.184.98, 50.17.186.39, 50.17.186.7, 50.17.187.145, 50.17.187.192, 50.17.187.218, 50.17.187.32, 50.17.189.138, 50.17.189.201, 50.17.189.251, 50.17.190.174, 50.17.190.69, 50.17.191.143, 50.17.191.62, 50.17.193.185, 50.17.194.132, 50.19.92.139, 54.243.143.97, 54.243.146.21, 54.243.149.247, 54.243.149.248, 54.243.150.126, 54.243.150.156, 54.243.204.6, 54.243.210.15, 54.243.235.176, 75.101.154.153

Setup callback IP whitelist

  1. Go to Apps section.

  2. Select your application.

  3. Click on the Callback section.

  4. Under the IP Whitelist section click the Copy IP Whitelist button to copy the IPs to your clipboard.

How to Test the Callback

First ensure that you have whitelisted the IPs listed in the above section.

Instructions

  1. Go to Apps section.

  2. Select your Application.

  3. Click on the Callback section.

  4. Click on the Test Callback button.

  5. Fill out the form with the parameters you want and click the invoke Test Callback button.

  6. Get your results.

Callback successful
Callback successful
Callback Failed
Callback Failed