formData should contain below format:
{
firstname (string - required)
lastname (string - required)
address1 (string - required)
address2 (string - optional)
city (string - required)
state (string - required - foramt: XX abbreviation)
zip (string - required - format: [0-9]{5}(-[0-9]{4}) )
email (required - valid email)
verifyemail (required - must match with email)
phone (string - required - format: 11111111)
birthdate (string - optional - format: YYYY-MM-DD)
captchaValue (optional - if your using Google recaptcha for spam and abuse protection)
ageverified (optional - boolean - true or false)
receiveemails (optional - boolean - true or false)
receivetext (optional - boolean - true or false)
mobilenumber (* required if receivetext = true - format: 11111111)
sweepstakesId (campaign name - recommended to provide since the sweeps are tried to a campaign)
maxEntries (number - optional)
}
Sample Input:
{
"firstname": "FristName 1",
"lastname": "LastName 1",
"address1": "700 Folsom st",
"address2": "",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"email": "nobody2211@macys.com",
"verifyemail": "nobody2211@macys.com",
"phone": "1112223333",
"birthdate": null,
"captchavalue": "1Wasd24",
"ageverified": true,
"receiveemails": true,
"receivetext": true,
"mobilenumber": "9998887777",
"sweepstakesId": "mssweeps2016_sweeps"
}
| input properties | |
| formdata: object | Form data for Sweepstakes that is being submitted. If optional data sweepstakesId and maxEntries are passed, unique entries (determined by email address) are checked by sweepstakesId (ie. 'wedding-grand-prize') and maxEntries sets the entry # limit. Defaults to 1 entry limit per email address. |
| callback: function | Callback function to be called when sweepstakes are submitted and response is ready |
| output properties | |
| responseCode: number | 0 = Sweeps submitted successfully. |
| 1 = User Already Submitted Sweeps. | |
| 2 = Invalid input or Any Validation errors. (Ex: First Name is missing) | |
| 1 = Any Other Application Error in submitting sweeps | |
| responseMessage: string | Detailed Error message occured as mentioned above. |