Skip to main content

Survey Server Callbacks

Inbrain provides callback data when survey completion or disqualification event occurs.

Survey Completed Event

Upon successful completion of a survey, inBrain will issue an HTTP POST JSON request with the following data to your specified Success Callback URL.

Example Callback:

POST ​http://yourdomainname.com/path/to/your/successendpoint
{
"Sig": "cd917216cb4cb02648bb96ac77760269",
"PanelistId": "6a8c5d53-d8bf-4a3e-ba54-460d00f5caa0​",
"RewardType": "survey_completed",
"RewardId": "c55b3483-5755-42f8-9bc5-5c185862e35a",
"Reward": 100,
"SessionId": "custom_session_value",
"RevenueAmount": 1.00,
"IsTest": false
}

Survey Disqualification Event

When a user is disqualified from a survey, inBrain will issue an HTTP ​POST JSON request with the following data to your specified ​Failure Callback URL.

Example Callback:

POST ​http://yourdomainname.com/path/to/your/failureendpoint
{
"Sig": "cd917216cb4cb02648bb96ac77760269",
"PanelistId": "6a8c5d53-d8bf-4a3e-ba54-460d00f5caa0",
"RewardType": "survey_disqualified",
"RewardId": "c55b3483-5755-42f8-9bc5-5c185862e35a",
"Reward": 2,
"SessionId": "custom_session_value",
"RevenueAmount": 0.02,
"IsTest": false
}

Explanation of Callback Properties for Survey Callbacks

PropertyTypeDescription
SigstringSignature used to verify the authenticity of the callback request. See more on how to verify requests using ‘Sig’ in the next section
PanelistIdstringThe unique app_uid provided within the iFrame configuration
RewardTypestringPossible values listed below along with explanations:
“profiler_completed” Initial profiler survey completed
“survey_completed” Survey completed successfully
“survey_disqualified” User disqualfied from survey
“ad_hoc” Manual survey reward from inBrain
RewardIdstringUnique Identifier for a particular reward/survey completion.
This can be used to check for any duplicates in the event that your system receives duplicate callback requests
RewarddecimalThe amount of In App Currency that the user should be awarded for the survey outcome. This value is calculated based on your IAC (In App Currency) setting in the publisher dashboard
RevenueAmountdecimalRevenue in USD earned from the survey outcome
IsTestbooleanIndicates whether or not this callback is a test callback from a test survey.
If true, then it is a test survey callback

Signature Hash Calculation

To compute and verify the ‘Sig’ property of a callback request, combine the following callback properties along with the Callback Secret found in the ​Postback ​tab of your publisher dashboard:

[PanelistId] + [RewardId] + [CallbackSecret]

Next compute an MD5 hash of the resulting concatenated string. The result should be a hash value matching the Sig property in the callback request.