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
Success link
Parameters
Parameter | Description | Required |
---|---|---|
surveyId | Id of the completed survey | true |
entrySurveyId | Id of the entry survey | true |
userId | Id of the user that completed the survey | true |
mid | Partner specific parameter passed in the entry link | false |
reward | Reward in partner specific currency | true |
rewardId | Id of the reward | true |
hash | Hash signature | true |
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
Base link
https://exampleclient.com/success
Full link
https://exampleclient.com/success?surveyId=58f12ab5&entrySurveyId=58f12ab5&userId=xyz&mid=MS4wSM8xLjUx&reward=10&rewardId=1d16f66e-9b7a-44fa-840e-8ec8afb4d60e&hash=8ccacca98f62ab553d6a78ecb1e1
Failure link
Parameters
Parameter | Description | Required |
---|---|---|
surveyId | Id of the terminated survey | true |
userId | Id of the user that got disqualified from the survey | true |
mid | Partner specific parameter passed in the entry link | false |
status | Status code indicating termination reason. See full list of termination status codes. | true |
reward | Partial reward in partner specific currency | false |
rewardId | Id of the reward | false |
hash | Hash signature | true |
Example
Base link
https://exampleclient.com/failure
Full link
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.