This article will show you how to use implement Virtual Incentives using the API.
Implementing Virtual Incentives through the API
1) Ensure you have collected the respondents first name, last name and email address. For first and last name, if you do not want to collect that it is okay to pass something generic through. The email address is the most important thing here. This is typically collected in a contact info type question, but any variables that hold these pieces of information will work.
2) Create a single variable with no response list called "VI_LINK".
Using logic set this variable to this: "https://custom.cmix.com/rewards/process?surveyId= XXXX&respondentId=" . ID . "&hash=" . SHA256 ( ID . "YYYYYY" )
XXXX: replace with the code found after svy= in the URL when you are located on the dashboard of the study
YYYYYY: replace with the code found after cmixTest= in the URL when you are viewing the test link for the study.
3) Create a single variable "VI_ENVIRONMENT" with a response list 1=TEST, 2=LIVE. Set this in logic to 1 if TEST = "Y" otherwise assume live. (Conditions can be adjusted for any use case).
4) Create the following single variables and set accordingly:
VI_FIRST_NAME --> Set to the variable holding the respondents first name
VI_LAST_NAME --> Set to the variable hodling the respondents last name
VI_EMAIL --> Set to the variable holding the respondents email address
VI_AMOUNT --> Set to the amount of the incentive. Do NOT include the $.
VI_PROGRAM_ID --> Set this to the program id Virtual Incentives has assigned to this study
VI_SKU --> Set this to the SKU Virtual Incentives has assigned to this study
VI_USERNAME --> See Step 5
VI_PASSWORD --> See Step 5
5) You will need to create a lookup file that contains the username with both a test passcode and a live passcode provided by Virtual incentives. The ENVIRONMENT column will remain the same but the USERNAME and PASSCODE columns will both be updated. Upload this to your lookups.
6) In logic set the last two variables using your lookup: