Simple Sweepstake submission Example using
Toolkit Sweepstake Open (CORS) API
E-mail
Sweepstake user E-mail
First Name
Swepstake user first name
Last Name
Sweepstake user last name
Address
Sweepstake user address
City
Sweepstake user city
Country Code
Sweepstake user Country Code. Must match one of the accepted Country Code: see
GET /open/referencedata/countries
State Code
Sweepstake user State Code. Must match one of the accepted State Code: see
GET /open/referencedata/countries/{country_code}/states
Zip Code
Sweepstake user zip code
Sweepstake Code
Don't use this value in your app, it is only for testing. Usually this value is constant and hidden. To setup a Sweepstake and obtain the Sweepstake Code please email
CN DIGITAL - TOOLKIT SUPPORT <_1DDC1C@CONDENAST.COM>
Sweepstake Form Name
Usually this value is constant and hidden. Used for reporting, it can be any string
Sweepstake Site Code
Don't use this value in your app, it is only for testing. Usually this value is constant and hidden. It must be the Site code associated with the previous Sweepstake Code, for example VYF for Vanity Fair, NYR for the New Yorker, etc...
POST /open/sweepstake/{sweepstakeCode}/entries
Execute!
Next steps:
Take a look at the source code for this example @
Condé Nast GitHub repository
Change the fields in the form above and possibly make them hidden. All the fields are mandatory. There are other optional fields, including custom fields, described in the
Wiki [link accessible only in CN network]
that can be passed.
The Sweepstake Open API is using
CORS (Cross Origin Resource Sharing)
. See
Toolkit Authentication Wiki Page [link accessible only in CN network]
for more infos.
Take a look at the Ajax call and change the
ustkEndpoint
(stag or prod) and
ustkKey
variables in
sweepsSubmission.js
file (see inline comments there).
Test invalid input response code and messages. e.g. invalid E-mail or State Code values.
Need help? Send an email to:
CN DIGITAL - TOOLKIT SUPPORT <_1DDC1C@CONDENAST.COM>