RFG Offerwall API
Use this command to query if there are survey opportunities for a respondent.
Command
"offerwall/query/1"
Inputs
The following values are expected in the JSON body:
Name | Type | Required | Description |
---|---|---|---|
command | String | Must be "offerwall/query/1" |
|
rid | String | A string uniquely identifying the respondent. The same string must be sent on repeat visits, allowing us to target using previously collected data. |
|
country | String | The 2 character ISO country code |
|
postalCode | String | Australia, South Africa: 4 digits |
|
gender | String | Accepted values:
|
|
birthday | String | The respondent's birthday, formatted as yyyy-MM-dd |
|
ip | String | String value corresponding to the respondent's IP. If included, we will use it to consider only the surveys where a respondent with the same IP has not participated, thus reducing the probability of a term due to deduplication. |
|
fingerprint | String | The code to compute the fingerprint is available at https://hosting.researchforgood.com/js/df-fp.js
If you are not able to generate the fingerprint, you can send fingerprint:0. In such cases, the rid value becomes mandatory. We will use the fingerprint value we have stored in our system for that respondent in order to determine if the respondent is likely to be ruled out because of deduplication. If the respondent has not started a session with us yet, then we will only consider the IP value. Please note that this is not the preferred option: if you are able to run javascript and generate a fingerprint, you should send the fingerprint value to us. Only use this workaround if you cannot run javascript on your site / app. |
|
type | Integer | Optional parameter that indicates the kind of projects that should be returned:
|
|
**See description for possible values | * | Additional Datapoints In addition to the above parameters, you may also send us any of the datapoints listed in the RFGdatapoints.json file.
Datapoint TypesDatapoint types may be:
For these optional datapoints, you may provide as few or as many as you wish. Any datapoints not provided will be profiled when the respondent begins to take surveys. Please note that some datapoints only apply to certain countries. If a datapoint does not list countries, then it applies to all countries. |
Outputs
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
countrySupported | Boolean | Indicates if the specified country is supported. |
|||||||||||||||||||||||||||||||||||||||
surveys | JSON[] | An array of JSON documents. Each document represents an available survey. The fields of each project are:
|
Example Command
{
command: "offerwall/query/1",
rid: "4e882a9bc2748d24",
country: "US",
postalCode: "10025",
gender: 1,
birthday: "1977-02-25",
ip: "201.78.52.21",
fingerprint: "c042ac342900efdfceee4a2edb549f5c",
ethnicityUS: [1,2,3],
householdIncome: 4,
language: 3,
maritalStatus:2
}
Example Response
{
"command" : "offerwall/query/1",
"response" : {
"countrySupported" : true,
"surveys" : [
{
"ir" : 90,
"loi" : 12,
"offer_icon" : "https%3A%2F%2Fsurvey.saysoforgood.com%2Fux%2Fimages%2FGeneral.svg",
"offer_url" : "https://survey.saysoforgood.com/trop/survey/59974770e4b0cbdb4262c8fd?init=o6eovNpwhpU5R1S46Vf-LY6dmgo%7B%22tropPanelist%22%3A%225ebbf8f4e4b01c40f6ecdd6f%22%2C%22project%22%3A%225ea7e96de4b05b008da6fd6f%22%7D",
"payout" : "$1.53",
"payout_currency" : "USD",
"projectCR" : 28,
"projectEPC" : "$.44",
"sourceStats" : {
"completes" : 0,
"cr" : 0,
"epc" : 0,
"quotas" : 0,
"starts" : 0,
"terminates" : 0
},
"survey_id" : "RFG3553903-044",
"title" : "New survey opportunity for you!",
"type" : 3
},
{
"ir" : 25,
"loi" : 20,
"offer_icon" : "https%3A%2F%2Fsurvey.saysoforgood.com%2Fux%2Fimages%2FHealth.svg",
"offer_url" : "https://survey.saysoforgood.com/trop/survey/59974770e4b0cbdb4262c8fd?init=RFAQMvvcOcj3QK7wK6kmxoPXFpA%7B%22tropPanelist%22%3A%225ebbf8f4e4b01c40f6ecdd6f%22%2C%22project%22%3A%225ea7e96de4b05b008da6fd55%22%7D",
"payout" : "$2.20",
"payout_currency" : "USD",
"projectCR" : 36,
"projectEPC" : "$.80",
"sourceStats" : {
"completes" : 0,
"cr" : 0,
"epc" : 0,
"quotas" : 0,
"starts" : 0,
"terminates" : 0
},
"survey_id" : "RFG3553903-041",
"title" : "Take a look at this survey",
"type" : 3
},
The response contains a list of surveys targeted to the specific respondent. As each respondent makes multiple attempts, our targeting will become more precise as we use additional collected information to target, and track the answers across multiple visits. The URLs provided must only be used for that specific respondent, as they contain information identifying the respondent and the selected survey.