Download OpenAPI specification:Download
The Bonbon Rewards API allows you to create rewarded experiences for users on the Open Internet. Our offer database is made publicly avaialable here & us refreshed nightly: https://cdn.bonbon.tech/offers
Initiate a request for an earn token using the email OTP code flow. Dispatches an email with an OTP code the end user will later enter into your form to complete authentication & generate an earn token. The email will be branded per the clientId provided.
x-bonbon-clientid | string Examples:
|
The payload to begin an OTP code authentication.
string The user's email address |
{- "email": "test-user@bonbon.tech"
}
{- "message": "Email sent to test-user@bonbon.tech"
}
Exchange an email address / OTP code pair for an earn token. To be called after a successful call to /earn/otp
, this method will return an earn token if the email and OTP code provided match expectations.
x-bonbon-clientid | string Examples:
|
The payload to exchange an email / OTP code pair for an earn token
string The user's email address | |
otp | string The OTP code for the given email address |
reward | string The ID of the reward from |
preferences | object An object set of key/value pairs representing the user's preferences must at least include the keys pAds and newsletter with boolean values representing the user's personalized ads and newsletter preferences, respectively. |
lastLoginUrl | string The URL where the user is logging in from |
bonbons | integer The number of Bonbons to reward the user for logging in |
{- "email": "test-user@bonbon.tech",
- "otp": "123456",
- "reward": "airpods_v1",
- "preferences": {
- "pAds": true,
- "newsletter": true
}, - "bonbons": 10
}
{- "earnToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9",
- "signUp": true
}
Exchange an OIDC ID Token for an earn token. Used to perform an immediate exchange of an OIDC ID Token for an earn token. Ensure your JWKS is configured for your client ID to use this method.
x-bonbon-clientid | string Examples:
|
The payload to exchange an OIDC token for an earn token
token | string The user's OIDC ID token. |
provider | string One of googlegsi, openpass, bonbonsso. |
reward | string The ID of a reward from our reward catalog. |
preferences | string An flat object of key/value pairs of preferences. |
lastLoginUrl | string The URL where the user is signing in. |
bonbons | integer The number of Bonbons to reward the user for signing in. |
{- "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imkwd25uIn0.eyJzdWIiOiJqb2UiLCJhdWQiOiJpbV9vaWNfY2xpZW50IiwianRpIjoidWY5MFNLNHdzY0ZoY3RVVDZEdHZiMiIsImlzcyI6Imh0dHBzOlwvXC9sb2NhbGhvc3Q6OTAzMSIsImlhdCI6MTM5NDA2MDg1MywiZXhwIjoxMzk0MDYxMTUzLCJub25jZSI6ImU5NTdmZmJhLTlhNzgtNGVhOS04ZWNhLWFlOGM0ZWY5Yzg1NiIsImF0X2hhc2giOiJ3Zmd2bUU5VnhqQXVkc2w5bGM2VHFBIn0",
- "provider": "bonbonsso",
- "reward": "airpods_v1",
- "preferences": {
- "pAds": true,
- "newsletter": true
}, - "bonbons": 10
}
{- "earnToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9",
- "signUp": true
}
Called to log an earn action and credit the user associated with the earn token. Credits a user for a site activity.
x-bonbon-clientid | string Examples:
|
Authorization | string Examples:
|
{- "message": "ok"
}
Called to fetch how many bonbons the user has accumulated and the latest reward they've expressed interest in winning.
x-bonbon-clientid | string Examples:
|
Authorization | string Examples:
|
{- "auth": {
- "hem": "XZDvQK/efPV1ssioCcAL3IjwJJYTsJFfeYbPKej9X2o=",
- "uid2": {
- "advertising_token": "xxx",
- "identity_expires": 1713474456684,
- "refresh_expires": 1715807256684,
- "refresh_from": 1713218856684,
- "refresh_response_key": "yyy",
- "refresh_token": "zzz"
}
}, - "user_id": "email|64641ae9fcc2eef15f95a412",
- "user_metadata": {
- "bonbons": 114,
- "reward": "airpods_v1",
- "first_name": true,
- "last_name": true,
- "gender": false,
- "postal": true
}
}
Generates a signed and encrypted JWT Bonbon ID Token for your user.
x-bonbon-clientid | string Examples:
|
x-bonbon-api-key | string Examples:
|
The payload to begin an OTP code authentication.
string The user's email address | |
emailVerified | boolean A boolean flag indicating whether the user has verified their email address in your system. |
{- "email": "test-user@bonbon.tech",
- "emailVerified": true
}
{- "message": "eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTcxNDA1MDUzNiwiaWF0IjoxNzE0MDUwNTM2fQ.lfhqUGBexVpL1HABA34lhwK35UvXfPbUcN6f_xWDK1s"
}