Quick start
YetiPoll shows surveys to your users and tells your server when one of them earns a reward. An integration has two halves: showing the wall, and receiving the reward message (the postback).
1. Create an app and get your keys
Create an account and add an app. Each app has four keys:
| Key | Looks like | Use |
|---|---|---|
| Sandbox public | yp_test_pk_… | In pages and apps while you build. Practice surveys only. |
| Sandbox secret | yp_test_sk_… | On your server: signs sandbox postbacks, opens the API in sandbox. |
| Live public | yp_live_pk_… | In pages and apps in production. |
| Live secret | yp_live_sk_… | On your server only. Never in client code. |
2. Show the wall
The fastest way on the web is the script. Put it where the surveys should appear and pass your own id for the signed-in user:
<script src="https://yetipoll.com/sdk/v1/yetipoll.js"
data-app="yp_test_pk_your_key"
data-user="USER_ID"
async></script>
Other options: iFrame, SDKs for mobile, or the API.
USER_ID is whatever identifies the user in your system: 1 to 128 characters from letters, digits and _ . @ : -. Use a stable id, not an email address.
3. Receive rewards
Set a postback URL in the app settings. We call it every time a user completes a survey:
https://your-server.example/yetipoll?user={user_id}&tx={transaction_id}&reward={reward}&status={status}&sig={signature}
Verify the signature, credit the user once per transaction_id, and answer with any 2xx status. Details and sample code: Postbacks.
4. Test in the sandbox
With a sandbox key the wall lists practice surveys. Open one, choose "Complete", and a postback marked test=1 arrives at your URL. Try a screen-out and a reversal too. See Sandbox and live.
5. Go live
Swap the sandbox public key for the live one, and make sure your server verifies postbacks with the live secret key. That is the whole switch.