Skip to main content

Client redirects

Client redirects are used by inBrain to redirect the user back to the partner system when the user has completed, is disqualified, or chooses to exit from the survey. There are two types of client redirect links - success and failure.

Configuration

  • Partner provides the base success/failure link only, without any parameters
  • inBrain extends the given link with parameters on completion/termination of the survey, before the user is redirected

Parameters

ParameterDescriptionRequired
surveyIdId of the completed surveytrue
entrySurveyIdId of the entry surveytrue
userIdId of the user that completed the surveytrue
midPartner specific parameter passed in the entry linkfalse
rewardReward in partner specific currencytrue
rewardIdId of the rewardtrue
hashHash signaturetrue

surveyId vs entrySurveyId

entrySurveyId is the survey id from the entry link. When the survey with id from the entry link is still available and the user completes it, both surveyId and entrySurveyId have the same value in the redirect link.

However, there can be cases where a survey the user enters is no longer available or the user is immediately disqualified due to unknown reasons. In such a case, inBrain may load an alternative survey in order to provide great user experience instead of redirecting the user immediately. When that happens and the user completes the alternative survey, the id of that survey is the surveyId in the redirect link, while the entrySurveyId remains the survey id from the entry link.

Example

https://exampleclient.com/success
https://exampleclient.com/success?surveyId=58f12ab5&entrySurveyId=58f12ab5&userId=xyz&mid=MS4wSM8xLjUx&reward=10&rewardId=1d16f66e-9b7a-44fa-840e-8ec8afb4d60e&hash=8ccacca98f62ab553d6a78ecb1e1

Parameters

ParameterDescriptionRequired
surveyIdId of the terminated surveytrue
userIdId of the user that got disqualified from the surveytrue
midPartner specific parameter passed in the entry linkfalse
statusStatus code indicating termination reason. See full list of termination status codes.true
rewardPartial reward in partner specific currencyfalse
rewardIdId of the rewardfalse
hashHash signaturetrue
info
inBrain evaluates the reasons why the survey was terminated and the user could still be given a partial reward for his effort

Example

https://exampleclient.com/failure
https://exampleclient.com/failure?surveyId=58f12ab5&userId=xyz&mid=MS4wSM8xLjUx&status=1&reward=2&rewardId=1d16f66e-9b7a-44fa-840e-8ec8afb4d60e&hash=8ccacca98f62ab553d6a78ecb1e1

Hash signature verification

Before the user is redirected, the redirect link is signed on the inBrain side by adding a hash parameter following the Link signing process. Your system is responsible for handling hash verification in order to prevent unauthorized communication and ensure the link has not been manipulated during the redirect.

Hash verification process is explained in Hash signature section.