The SaaSquatch API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients. JSON will be returned in all responses from the API, including errors.
To make the SaaSquatch API as explorable as possible, accounts have test-mode API keys as well as live-mode API keys. These keys are both active at the same time. Data created with test-mode credentials will use your payment system's respective test mode.
API methods are organized by tags of similar functionality. If you're in a hurry to understand how the SaaSquatch REST API works, then understanding the tags is a great place to start.
Accounts can be shared between users and accumulate credit.
Users are the people in your program. In other places a User might also be called a Contact, Lead or Participant.
Events are a way to send SaaSquatch additional information about users. For example, whenever someone makes a purchase or downloads an item.
Referral Codes are unique ids used to track referrals.
A Referral tracks who has referred whom.
Reward Balances summarizes the Rewards in someone's account.
A Reward keeps track of a prize, discount or credit that someone has received.
Open Endpoints are special methods designed specifically for Client-facing applications like the Mobile SDK and Javascript SDK.
Webhooks can be used to do real time actions and data synchronization from SaaSquatch.
Themes control the look and feel of your program's widgets.
Endpoints for working with discounts. Most of these are deprecated in favor of using Reward endpoints.
Endpoints that have been deprecated.
API methods may be used with one or several authentication schemes as defined in this table:
Authorize your requests using a tenant's API Key. Use this method of security only in server-to-server interactions.
Authorize your requests using a JWT (JSON Web Token) for a given user. Useful for client-server authorization, such as the Mobile and Web SDKs. Used in Open Endpoints.
Method | Route | Description | Auth | Tags |
---|---|---|---|---|
POST | /api/v1/{tenant_alias}/accountsync | Create or Update an account | APIKey | Account |
GET | /api/v1/{tenant_alias}/account/{accountId} | Lookup an account | APIKey | Account |
POST | /api/v1/{tenant_alias}/user | Create or Update a User | APIKey | User |
GET | /api/v1/{tenant_alias}/user | Lookup a user by Referral Code | APIKey | User |
GET | /api/v1/{tenant_alias}/account/{accountId}/user/{userId} | Lookup a user | APIKey | User |
GET | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/pii | Lookup a user PII | APIKey | User |
POST | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}/events | Track User Event | APIKey UserJWT | User Event Open Endpoint |
GET | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/sharelinks | Lookup a user's share links | APIKey | User |
GET | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/shareurls | Lookup a user's share URLs | APIKey | User |
POST | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/block | Block user | APIKey | User |
POST | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/unblock | Unblock user | APIKey | User |
GET | /api/v1/{tenant_alias}/users | List users | APIKey | User |
GET | /api/v1/{tenant_alias}/code/{code} | Lookup a referral code | APIKey | Referral Code |
GET | /api/v1/{tenant_alias}/referrals | List referrals | APIKey | Referral |
GET | /api/v1/{tenant_alias}/referrals/{referralId} | Lookup a Referral | APIKey | Referral |
POST | /api/v1/{tenant_alias}/referrals/moderate | Moderate referrals | APIKey | Referral |
GET | /api/v1/{tenant_alias}/reward/balance | List reward balances | APIKey | Reward Balance |
POST | /api/v1/{tenant_alias}/credit/bulkredeem | Debit a reward balance | APIKey | Reward Balance |
GET | /api/v1/{tenant_alias}/reward | List an account's rewards | APIKey | Reward |
GET | /api/v1/{tenant_alias}/reward/{id}/ | Lookup a single reward | APIKey | Reward |
POST | /api/v1/{tenant_alias}/credit/{id}/redeem | Redeem a single reward | APIKey | Reward |
POST | /api/v1/{tenant_alias}/reward/{id}/cancel | Cancel a single reward | APIKey | Reward |
POST | /api/v1/{tenant_alias}/rewards/account/{accountId}/user/{userId} | Create a single reward | APIKey | Reward |
PUT | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} | User Upsert | APIKey UserJWT | User Open Endpoint |
POST | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} | Create a user and account | APIKey UserJWT | User Open Endpoint |
GET | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} | Lookup a user | APIKey UserJWT | User Open Endpoint |
DELETE | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} | Delete a user | APIKey | User Open Endpoint |
GET | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}/shareurls | Lookup a user's share URLs | APIKey UserJWT | User Open Endpoint |
PUT | /api/v1/{tenant_alias}/open/user/cookie_user | Create Cookie User | APIKey UserJWT | User Open Endpoint |
GET | /api/v1/{tenant_alias}/open/user | Get a user by a referral code | Unauthenticated | User Open Endpoint |
GET | /api/v1/{tenant_alias}/open/code/{referral_code} | Lookup a referral code | Unauthenticated | Referral Code Open Endpoint |
POST | /api/v1/{tenant_alias}/open/code/{referral_code}/account/{account_id}/user/{user_id} | Apply a referral code | APIKey UserJWT | Referral Code Open Endpoint |
GET | /api/v1/{tenant_alias}/open/referrals | List referrals | APIKey UserJWT | Referral Open Endpoint |
DELETE | /api/v1/{tenant_alias}/open/account/{accountId} | Delete an account | APIKey | Account Open Endpoint |
POST | /api/v1/{tenant_alias}/subscription | Create a webhook subscription | APIKey | Webhook |
GET | /api/v1/{tenant_alias}/subscription | List webhook subscriptions | APIKey | Webhook |
DELETE | /api/v1/{tenant_alias}/subscription/{url} | Delete a webhook subscription | APIKey | Webhook |
POST | /api/v1/{tenant_alias}/subscription/{url}/test | Test a webhook subscription | APIKey | Webhook |
POST | /api/v1/{tenant_alias}/export | Create an Export | APIKey | Export |
GET | /api/v1/{tenant_alias}/export/{exportId} | Lookup an Export | APIKey | Export |
GET | /api/v1/{tenant_alias}/export/{exportId}/download | Download an Export | APIKey | Export |
GET | /api/v1/{tenant_alias}/export/history/list | List Exports | APIKey | Export |
GET | /api/v1/{tenant_alias}/theme/variables/schema | Lookup variables schema | APIKey | Theme |
GET | /api/v1/{tenant_alias}/theme/variables/instance | Lookup Default Variables Values | APIKey | Theme |
PUT | /api/v1/{tenant_alias}/theme/variables/instance | Replace Default Variable Values | APIKey | Theme |
PATCH | /api/v1/{tenant_alias}/theme/variables/instance | Update Default Variable Values | APIKey | Theme |
GET | /api/v1/{tenant_alias}/theme/{locale}/variables/instance | Lookup Localized Variables Values | APIKey | Theme |
PUT | /api/v1/{tenant_alias}/theme/{locale}/variables/instance | Replace Localized Variable Values | APIKey | Theme |
PATCH | /api/v1/{tenant_alias}/theme/{locale}/variables/instance | Update Localized Variable Values | APIKey | Theme |
DELETE | /api/v1/{tenant_alias}/theme/{locale}/variables/instance | Delete Localized Variable Values | APIKey | Theme |
POST | /api/v1/{tenant_alias}/theme/email/{email_type}/preview | Preview Theme Email | APIKey | Theme |
GET | /api/v1/{tenant_alias}/discount/{code} | Lookup a discount code | APIKey | Discount |
POST | /api/v1/{tenant_alias}/discount | Set discount code on an account | APIKey | Discount |
GET | /api/v1/{tenant_alias}/account/{accountId}/discount | Lookup an account discount | APIKey | Discount |
/api/v1/{tenant_alias}/accountsync
Use this method to update SaaSquatch when the status of an account changes or when a new account is created.
This call is only available on an API-only program. Making this call on a payment provider program will fail and return a 403 error indicating the call is incompatible with your type of program.
/api/v1/{tenant_alias}/account/{accountId}
Looks up an Account based upon id
and returns the stored account information.
This method just returns the details of the account in question, and not all associated properties like Rewards, ShareLinks, Balances or Referrals.
This call is only available on an API-only program. Making this call on a payment provider program will fail and return a 403 error indicating the call is incompatible with your type of program.
Tags: Account Authentication: APIKey
Required |
accountId string |
The |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/account/{accountId} \
-u :API_KEY \
id string |
Unique identifier for the account |
||||||||
---|---|---|---|---|---|---|---|---|---|
subscription object |
An object describing the current subscription for this account
|
||||||||
referral object |
Info about who referred this account. Use this on first signup.
|
||||||||
currency string |
Default is |
Example Response
HTTP 200
{
"id": "89842",
"currency": "USD",
"subscription": {
"status": "PAID",
"value": 29.99,
"billingIntervalType": "MONTH",
"billingIntervalValue": 1
},
"referral": {
"code": "WILLSANDERSON2"
}
}
Example Response
HTTP 403
{
"message": "Account sync failed. This push is not valid for your tenant type[STRIPE]",
"statusCode": 403,
"apiErrorCode": "API_REQUEST_NOT_SUPPORTED"
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/user
This method creates or updates a User object by performing an atomic upsert operation. Using this method will either replace the information stored about a given user, or
create a new user if no User with a matching id
is found. This method is helpful for synchronizing user information from your database into Referral SaaSquatch.
This method will not create or update the Account linked by accountId
. When creating users for the first time ensure that the Account already exists or create it before using this call.
See the article on Shared vs Solo Accounts for more information on Users and Accounts and how they relate.
Tags: User Authentication: APIKey
Required |
user JSON Body |
Details of the User to be created or updated
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/user \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"id": "219065",
"accountId": "accc9065",
"email": "bob@example.com",
"firstName": "Bob",
"lastName": "Testerson",
"referralCode": "BOBTESTERSON",
"imageUrl": "https://www.example.com/profiled/ab5111251125",
"locale": "`en` or `en_US` or `zh_CN`"
}'
id string |
The unique identifier provided for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstSeenIP string readonly |
The user's IP address on indentification |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastSeenIP string readonly |
The user's last known IP address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateCreated integer readonly |
The Unix time stamp of when the user was created |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emailHash string readonly |
The hash of the user's email address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralSource string readonly |
The domain from which the user was registered |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
Example Response
HTTP 200
{
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
/api/v1/{tenant_alias}/user
Looks up a user based upon their referralCode
and returns their personal information.
This method is useful for retrieving the user when only the Referral Code is available. For example when a referred user enters a Referral Code during checkout and you want to find out who this Referral Code belongs to.
Tags: User Authentication: APIKey
Required |
referralCode string |
The |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/user?referralCode=BOBTESTERSON \
-u :API_KEY \
id string |
The unique identifier provided for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstSeenIP string readonly |
The user's IP address on indentification |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastSeenIP string readonly |
The user's last known IP address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateCreated integer readonly |
The Unix time stamp of when the user was created |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emailHash string readonly |
The hash of the user's email address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralSource string readonly |
The domain from which the user was registered |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
Example Response
HTTP 200
{
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/account/{accountId}/user/{userId}
Looks up a user based upon their id
and returns their personal information.
This method just returns the details of the user in question, and not all associated properties like Rewards, Balances, or Referrals.
Tags: User Authentication: APIKey
Required |
accountId string |
The |
---|---|---|
Required |
userId string |
The |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/account/{accountId}/user/{userId} \
-u :API_KEY \
id string |
The unique identifier provided for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstSeenIP string readonly |
The user's IP address on indentification |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastSeenIP string readonly |
The user's last known IP address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateCreated integer readonly |
The Unix time stamp of when the user was created |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emailHash string readonly |
The hash of the user's email address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralSource string readonly |
The domain from which the user was registered |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
Example Response
HTTP 200
{
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/account/{accountId}/user/{userId}/pii
Returns details of the Personally identifiable information stored in the SaaSquatch system for a specific SaaSquatch user.
Warning! This method should only be used in connection with data protection and privacy compliance.
For programatically looking up information about users within your SaaSquatch project, please use the Lookup User endpoint
Tags: User Authentication: APIKey
Required |
accountId string |
The |
---|---|---|
Required |
userId string |
The |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/account/{accountId}/user/{userId}/pii \
-u :API_KEY \
id string |
The unique identifier provided for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastInitial string |
The user's last name initial |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cookieId string |
A unique identifier for this participant. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
paymentProviderId string |
The paymentProviderId is either the Stripe Customer ID, the Recurly Account ID, the Braintree Account ID or the Zuora Account ID. This field cannot be updated. Do not include this arguement on an API-only program, or unless looking to set it. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referable boolean |
Flag used by the SaaSquatch system to determine whether a user is able to be referred. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customFields object |
An object containing the custom fields for this user. Learn more about the available custom field functionality in our Custom Fields Developer Guide |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstSeenIP string readonly |
The user's IP address on indentification |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastSeenIP string readonly |
The user's last known IP address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstSeenIPLocation object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastSeenIPLocation object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstSeenUserAgent string readonly |
The user's browser user agent on indentification |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastSeenUserAgent string readonly |
The latest user agent seen for the user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateCreated integer readonly |
The Unix time stamp of when the user was created |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emailHash string readonly |
The hash of the user's email address |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralSource string readonly |
The domain from which the user was registered |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredByReferral object |
A link between the user/account of the referrer and the new referred user/account. The authoritative source of who has referred whom. Not all referrals result in a Reward or a RewardBalance being created, such as in-progress referrals.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rewards object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rewardBalances array |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referrals object |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
segments array |
A list of segments that a user is a member of. |
Example Response
HTTP 200
{
"id": "abc_132",
"accountId": "abc_132",
"firstName": "John",
"lastName": "Doe",
"lastInitial": "D",
"referralCode": "JOHNDOECODE",
"imageUrl": "",
"email": "john@example.com",
"cookieId": null,
"paymentProviderId": null,
"locale": null,
"referable": true,
"customFields": {},
"firstSeenIP": "207.194.49.162",
"lastSeenIP": "207.194.49.162",
"firstSeenIPLocation": {
"lat": 48.4765,
"lon": -123.3145
},
"lastSeenIPLocation": {
"lat": 48.4765,
"lon": -123.3145
},
"firstSeenUserAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
"lastSeenUserAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
"dateCreated": 1521477982534,
"emailHash": "d4c74594d841139328695756648b6bd6",
"referralSource": "UNKNOWN",
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
},
"referredByReferral": {
"id": "546270a6e4b0c1871186a920",
"referredUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referrerUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referredReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"referrerReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"moderationStatus": "ACTIONED",
"dateReferralStarted": 1415737510411,
"dateReferralPaid": 1415737557217,
"dateReferralEnded": null,
"dateModerated": 1427410131029,
"referredModerationStatus": "APPROVED",
"referrerModerationStatus": "APPROVED",
"fraudSignals": {
"ip": {
"message": "Referrer and referred came from the same IP",
"score": 50
}
}
},
"rewards": {
"totalCount": 1,
"data": [
{
"id": "582142aae4b05442a5fa01a5",
"type": "CREDIT",
"dateGiven": 1478574762838,
"dateExpires": null,
"dateCancelled": null,
"dateScheduledFor": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"unit": "CENTS",
"assignedCredit": 2500,
"redeemedCredit": 0,
"redemptions": [
{
"id": "5462600de4b09b1c41238f2f",
"dateRedeemed": 1415733261275,
"quantityRedeemed": 2000
}
],
"name": "Dollar Credit",
"currency": null
}
]
},
"rewardBalances": [
{
"type": "CREDIT",
"count": "4",
"totalAssignedCredit": "10000",
"totalRedeemedCredit": "0",
"unit": "cents"
}
],
"referrals": {
"totalCount": 1,
"data": [
{
"id": "546270a6e4b0c1871186a920",
"referredUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referrerUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referredReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"referrerReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"moderationStatus": "ACTIONED",
"dateReferralStarted": 1415737510411,
"dateReferralPaid": 1415737557217,
"dateReferralEnded": null,
"dateModerated": 1427410131029,
"referredModerationStatus": "APPROVED",
"referrerModerationStatus": "APPROVED",
"fraudSignals": {
"ip": {
"message": "Referrer and referred came from the same IP",
"score": 50
}
}
}
],
"segments": []
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}/events
This method can be used to track when users make purchases, download items, or take other meaningful actions that you want to use to trigger your programs.
Tags: User Event Open Endpoint Authentication: APIKey UserJWT
Required |
accountId string |
The |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Required |
userId string |
The |
||||||||||||||||||
Required |
tenant_alias string |
Tenant being referenced. E.g. |
||||||||||||||||||
Required |
body JSON Body |
Details of the events to be tracked
|
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}/events \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"userId": "someUserId",
"accountId": "someAccountId",
"events": [
{
"key": "purchase",
"fields": {
"currency": "CAD"
}
}
]
}'
Example Response
HTTP 200
{
"userId": "someUserId",
"accountId": "someAccountId",
"events": [
{
"id": "5bb3978dbd8bfe821a5f26f3",
"key": "purchase",
"fields": {
"currency": "CAD"
},
"dateTriggered": 1538496397475,
"dateReceived": 1538496397475,
"dateProcessed": 1538496397479
}
]
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/account/{accountId}/user/{userId}/block
Block a user from making successful referrals based upon their user and account id
.
More information about blocking users from participating in your referral program can be found in the SaaSquatch docs.
Tags: User Authentication: APIKey
Required |
accountId string |
The |
---|---|---|
Required |
userId string |
The |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/account/{accountId}/user/{userId}/block \
-u :API_KEY \
-H "Content-Type: application/json" \
-d ''
Example Response
HTTP 200
{}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/account/{accountId}/user/{userId}/unblock
Unblock a user based upon their user and account id
.
More information about blocking users from participating in your referral program can be found in the SaaSquatch docs.
Tags: User Authentication: APIKey
Required |
accountId string |
The |
---|---|---|
Required |
userId string |
The |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/account/{accountId}/user/{userId}/unblock \
-u :API_KEY \
-H "Content-Type: application/json" \
-d ''
Example Response
HTTP 200
{}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/users
List all of the Users in your Referral SaaSquatch tenant. This method is the primary way of getting a full list of everyone that has been identified through the API, Squatch.js or mobile widgets.
This method supports pagination using the parameters for limit
and offset
to iterate through a very large list of records.
You can also search for particular users using the query
method. To find information about which users have completed referrals, use the List referrals method.
Tags: User Authentication: APIKey
query string |
A search query that can be used to filter users by email, name or ID. |
|
---|---|---|
limit integer |
A limit on the number of results returned. Defaults to |
|
offset integer |
When included offsets the first result returns in the list. Use this to paginate through a long list of results. Defaults to |
|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/users \
-u :API_KEY \
users array |
A list of User objects. This is the actual data in this list envelope.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count integer |
The number of results returned in this list, see |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
totalCount integer |
The total number of results available overall, see |
Example Response
HTTP 200
{
"count": 1,
"totalCount": 1,
"users": [
{
"id": "14125",
"accountId": "89842",
"email": "mark@example.com",
"firstName": "Mark",
"lastName": "Testerson",
"referralCode": "MARKTESTER",
"imageUrl": "",
"dateCreated": 1414452680584,
"emailHash": "a65a76ba72e5a0b1e6253efce357abb6"
}
]
}
/api/v1/{tenant_alias}/code/{code}
Looks up a referral code and the attached details
Tags: Referral Code Authentication: APIKey
Required |
code string |
The referral code to look up. E.g. "BOBTESTERSON" |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/code/{code} \
-u :API_KEY \
code string |
The unique identifier for the code. E.g. "BOBTESTERSON" |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dateCreated integer |
The date the code was created. |
||||||||||||||
referrerName string |
The name of the owner of this code. E.g. "Bob Testerson" |
||||||||||||||
reward object |
Details of the reward that could be earned -- but is not yet earned.
|
Example Response
HTTP 200
{
"code": "BOBTESTERSON",
"dateCreated": 1411600868797,
"referrerName": "Bob T",
"reward": {
"type": "CREDIT",
"unit": "CENTS",
"credit": 2500
}
}
{
"code": "BOBTESTERSON",
"dateCreated": 1411600868797,
"referrerName": "Bob T",
"reward": {
"type": "PCT_DISCOUNT",
"discountPercent": 20,
"unit": "%"
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/referrals
List all of the referrals in your Referral SaaSquatch tenant. This method is the primary way of getting a full list of everyone that has made a referral and everyone that has been referred,
and supports pagination using the parameters for limit
and offset
to iterate through a very large list of records.
You can also use the query parameters for referringAccountId
and referringUserId
to filters this list of referrals to only include those made by a given user.
Tags: Referral Authentication: APIKey
referringAccountId string |
When included, filters the results to only referrals that were referred users with this |
|
---|---|---|
referringUserId string |
When included, filters the results to only referrals that were referred users with this |
|
dateReferralPaid string |
When included, filters the results either to the exact timestamp if only one value is given, or a range if devided by a comma. I.E. 0,123412451 gives all referrals that converted between 0 and 123412451. |
|
dateReferralEnded string |
When included, filters the results either to the exact timestamp if only one value is given, or a range if devided by a comma. I.E. 0,123412451 gives all referrals that ended between 0 and 123412451. |
|
referredModerationStatus string |
When included, filters the result to only include referred users with that status. Statuses that are accepted: |
|
referrerModerationStatus string |
When included, filters the result to only include referrers with that status. Statuses that are accepted: |
|
limit integer |
A limit on the number of results returned. Defaults to |
|
offset integer |
When included offsets the first result returns in the list. Use this to paginate through a long list of results. Defaults to |
|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/referrals \
-u :API_KEY \
referrals array |
A list of Referral objects. This is the actual data in this list envelope.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count integer |
The number of results returned in this list, see |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
totalCount integer |
The total number of results available overall, see |
Example Response
HTTP 200
{
"count": 2,
"totalCount": 4,
"referrals": [
{
"id": "5462600de4b09b1c41108f28",
"referredUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referrerUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referredReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"referrerReward": null,
"moderationStatus": "ACTIONED",
"dateReferralStarted": 1415733261238,
"dateReferralPaid": null,
"dateReferralEnded": null,
"dateModerated": 1427410131006,
"referredModerationStatus": "APPROVED",
"referrerModerationStatus": "APPROVED"
},
{
"id": "546270a6e4b0c1871186a920",
"referredUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referrerUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referredReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"referrerReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"moderationStatus": "ACTIONED",
"dateReferralStarted": 1415737510411,
"dateReferralPaid": 1415737557217,
"dateReferralEnded": null,
"dateModerated": 1427410131029,
"referredModerationStatus": "APPROVED",
"referrerModerationStatus": "APPROVED",
"fraudSignals": {
"ip": {
"message": "Referrer and referred came from the same IP",
"score": 50
}
}
}
]
}
/api/v1/{tenant_alias}/referrals/{referralId}
Looks up a single Referral object by it's associated id
. This method is helpful for looking into a particular referral of interest. Since it requires the id
of the referral to
be specified, it isn't applicable for querying all referrals to find those made by a particular user or account. To query for those referrals use the list referrals endpoint instead
with query parameters specified.
Tags: Referral Authentication: APIKey
Required |
referralId string |
The |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/referrals/{referralId} \
-u :API_KEY \
id string |
Unique identifier for the Referral object |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
referredUser object |
An object describing an individual user. Users are used in SaaSquatch to track people/contacts/leads. When a referral happens, it always happens between two Users.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referrerUser object |
An object describing an individual user. Users are used in SaaSquatch to track people/contacts/leads. When a referral happens, it always happens between two Users.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredReward object |
Rewards are used in SaaSquatch to track the credits, discounts, gift cards and other prizes that a User earns.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referrerReward object |
Rewards are used in SaaSquatch to track the credits, discounts, gift cards and other prizes that a User earns.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
moderationStatus string |
When referrals are manually managed, each referral has a Possible values:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredModerationStatus string |
Used to identify the referred user's moderation status and affect Reward cancellation. Possible values:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referrerModerationStatus string |
Used to identify the referrer user's moderation status and affect Reward cancellation. Possible values:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fraudSignals object |
Information about signals of potential fraud on the referral
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateReferralStarted integer |
Timestamp of when this referral was started. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateReferralPaid integer |
Timestamp of when this referral was marked as |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateReferralEnded integer |
Timestamp of when this referral was ended. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dateModerated integer |
Timestamp of when this referral was last moderated. |
Example Response
HTTP 200
"546270a6e4b0c1871186a920"
{
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
{
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
{
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
}
{
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
}
"ACTIONED"
1415737510411
1415737557217
""
1427410131029
"APPROVED"
"APPROVED"
{
"ip": {
"message": "Referrer and referred came from the same IP",
"score": 50
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/referrals/moderate
Moderates one or several referrals by either approving or denying.
Moderation can apply to one side of a referral, the other side, or both sides (Referrer and Referred).
When a referral is denied, the associated reward will be "cancelled".
A referral can be moderated several times, subsequently cancelling and un-cancelling the associated reward or rewards, and can be done as long as the associated reward is cancellable
.
Some rewards such as the coupons automatically generated by Referral SaaSquatch into Stripe and Recurly are not cancellable
and requests to change the moderation will error.
Tags: Referral Authentication: APIKey
Required |
moderationBulkRequest JSON Body |
Details of the referrals to be moderated
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/referrals/moderate \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"actions": [
{
"referralId": "546270a6e4b0c1871186a920",
"action": "REFERRED_DENIED"
}
]
}'
Example Response
HTTP 200
/api/v1/{tenant_alias}/reward/balance
Looks up the balance for all rewards of the same type and units.
Tags: Reward Balance Authentication: APIKey
Required |
accountId string |
The ID of the account to look up |
---|---|---|
userId string |
Filters rewards by |
|
rewardTypeFilter string |
Filters rewards by |
|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/reward/balance?accountId= \
-u :API_KEY \
type string |
The type of reward. Possible values:
|
---|---|
unit string |
An identifier for the unit of the reward. E.g. "credit-in-cents", "freemb", "giftcard20", "tshirt", "freemonth". Only works with |
count integer |
"The number of rewards earned. Usually is equal to the number of successful referrals made.
E.g. An account has $80 of credit due to the referral program. $60 from making referrals, $20 from being referred.
The count would be 4 rewards, each worth $20. Only works for |
totalAssignedCredit integer |
The total assignedCredit for all reward credits of the same unit type. Only works with types: |
totalRedeemedCredit integer |
The total redeemedCredit for all reward credits of the same unit type. Only works with types: |
totalDiscountPercent integer |
The total discountPercent from all rewards. Only works with types: |
referredDiscountPercent integer |
The total discountPercent from rewards with |
referrerDiscountPercent integer |
The total discountPercent from rewards with |
totalFuelTankCodes integer |
The number of earned fueltank rewards. Only works with type: |
Example Response
HTTP 200
[
{
"type": "CREDIT",
"count": "4",
"totalAssignedCredit": "10000",
"totalRedeemedCredit": "0",
"unit": "cents"
},
{
"type": "PCT_DISCOUNT",
"totalDiscountPercent": "30",
"referredDiscountPercent": "10",
"referrerDiscountPercent": "20"
},
{
"type": "FUELTANK",
"totalFuelTankCodes": 1
}
]
/api/v1/{tenant_alias}/credit/bulkredeem
Used to redeem the credit earned from a referral program. Permanently debits an account balance. Works with: CREDIT
Tags: Reward Balance Authentication: APIKey
Required |
debit JSON Body |
Details of the debit
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/credit/bulkredeem \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"accountId": "abc123",
"unit": "cents",
"amount": 200
}'
creditRedeemed integer |
The amount of credit that was just debitted. |
---|---|
creditAvailable integer |
The remaining credit in this account of the same unit type. |
unit string |
The type of credit that was just debitted. |
Example Response
HTTP 200
{
"creditRedeemed": 200,
"creditAvailable": 0,
"unit": "cents"
}
/api/v1/{tenant_alias}/reward
Looks up a list of single rewards
Tags: Reward Authentication: APIKey
Required |
accountId string |
The ID of the account to look up |
---|---|---|
userId string |
Filters rewards by |
|
rewardTypeFilter string |
Filters rewards by |
|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/reward?accountId= \
-u :API_KEY \
id string |
The unique identifier for this reward |
||||||
---|---|---|---|---|---|---|---|
type string |
The type of reward. Possible values:
|
||||||
dateGiven integer |
Timestamp of when this reward was earned. |
||||||
dateExpires integer |
Timestamp of when this reward is set to expire. |
||||||
dateCancelled integer |
Timestamp if the reward is cancellable and has been cancelled, the date it was cancelled on. Null if not never cancelled. |
||||||
dateScheduledFor integer |
Timestamp of when the reward is sheduled to become available. |
||||||
cancellable boolean |
If a reward is cancellable then it may be revoked. If it has been cancelled then |
||||||
rewardSource string |
The type of the source of the reward. Possible values:
|
||||||
unit string |
An identifier for the unit of the reward. E.g. |
||||||
discountPercent integer |
The percent discount. E.g. 10 means 10% Works with: |
||||||
name string |
The human-readable name of the reward. |
||||||
description string |
The human-readable description of the reward. Works with: |
||||||
assignedCredit integer |
The earned quantity of the reward. Works with: |
||||||
redeemedCredit integer |
The redeemed quantity of the reward. Works with: |
||||||
redemptions array |
|
||||||
currency string |
For programs that require a currency. Works with: |
||||||
amount integer |
The earned quantity of the reward. Works with: |
||||||
fuelTankCode string |
The fueltank code associated with this reward. Works with: |
||||||
fueltankType string |
The type of reward associated with this fueltank code. Works with: Possible values:
|
Example Response
HTTP 200
[
{
"id": "582142aae4b05442a5fa01a5",
"type": "CREDIT",
"dateGiven": 1478574762838,
"dateExpires": null,
"dateCancelled": null,
"dateScheduledFor": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"unit": "CENTS",
"assignedCredit": 2500,
"redeemedCredit": 0,
"redemptions": [
{
"id": "5462600de4b09b1c41238f2f",
"dateRedeemed": 1415733261275,
"quantityRedeemed": 2000
}
],
"name": "Dollar Credit",
"currency": null
},
{
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
{
"id": "12345678e4b1234aff143be5",
"type": "FUELTANK",
"dateGiven": 1497907329060,
"dateExpires": null,
"dateCancelled": null,
"accountId": "abc_122",
"userId": "abc_122",
"cancellable": true,
"rewardSource": "FRIEND_SIGNUP",
"fuelTankCode": "CODE8",
"unit": "CENTS",
"amount": 1000,
"fueltankType": "CREDIT"
}
]
/api/v1/{tenant_alias}/reward/{id}/
Used to lookup an individual reward using the ID of the reward. Works with: CREDIT
, PCT_DISCOUNT
, and FUELTANK
Tags: Reward Authentication: APIKey
Required |
id string |
The ID of the specific reward to lookup |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/reward/{id}/ \
-u :API_KEY \
id string |
The unique identifier for this reward |
||||||
---|---|---|---|---|---|---|---|
type string |
The type of reward. Possible values:
|
||||||
dateGiven integer |
Timestamp of when this reward was earned. |
||||||
dateExpires integer |
Timestamp of when this reward is set to expire. |
||||||
dateCancelled integer |
Timestamp if the reward is cancellable and has been cancelled, the date it was cancelled on. Null if not never cancelled. |
||||||
dateScheduledFor integer |
Timestamp of when the reward is sheduled to become available. |
||||||
cancellable boolean |
If a reward is cancellable then it may be revoked. If it has been cancelled then |
||||||
rewardSource string |
The type of the source of the reward. Possible values:
|
||||||
unit string |
An identifier for the unit of the reward. E.g. |
||||||
discountPercent integer |
The percent discount. E.g. 10 means 10% Works with: |
||||||
name string |
The human-readable name of the reward. |
||||||
description string |
The human-readable description of the reward. Works with: |
||||||
assignedCredit integer |
The earned quantity of the reward. Works with: |
||||||
redeemedCredit integer |
The redeemed quantity of the reward. Works with: |
||||||
redemptions array |
|
||||||
currency string |
For programs that require a currency. Works with: |
||||||
amount integer |
The earned quantity of the reward. Works with: |
||||||
fuelTankCode string |
The fueltank code associated with this reward. Works with: |
||||||
fueltankType string |
The type of reward associated with this fueltank code. Works with: Possible values:
|
Example Response
HTTP 201
{
"id": "582142aae4b05442a5fa01a5",
"type": "CREDIT",
"dateGiven": 1478574762838,
"dateExpires": null,
"dateCancelled": null,
"dateScheduledFor": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"unit": "CENTS",
"assignedCredit": 2500,
"redeemedCredit": 0,
"redemptions": [
{
"id": "5462600de4b09b1c41238f2f",
"dateRedeemed": 1415733261275,
"quantityRedeemed": 2000
}
],
"name": "Dollar Credit",
"currency": null
}
{
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
}
{
"id": "12345678e4b1234aff143be5",
"type": "FUELTANK",
"dateGiven": 1497907329060,
"dateExpires": null,
"dateCancelled": null,
"accountId": "abc_122",
"userId": "abc_122",
"cancellable": true,
"rewardSource": "FRIEND_SIGNUP",
"fuelTankCode": "CODE8",
"unit": "CENTS",
"amount": 1000,
"fueltankType": "CREDIT"
}
/api/v1/{tenant_alias}/credit/{id}/redeem
Used to redeem an individual credit earned from a referral program. Works with: CREDIT
Tags: Reward Authentication: APIKey
Required |
id string |
The ID of the specific reward to be redeemed |
||||||
---|---|---|---|---|---|---|---|---|
Required |
debit JSON Body |
Details of the debit
|
||||||
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/credit/{id}/redeem \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 200,
"unit": "cents"
}'
creditRedeemed integer |
The amount of credit that was just debitted. |
---|---|
creditAvailable integer |
The remaining credit in this account of the same unit type. |
unit string |
The type of credit that was just debitted. |
Example Response
HTTP 200
{
"creditRedeemed": 200,
"creditAvailable": 1800,
"unit": "cents"
}
/api/v1/{tenant_alias}/reward/{id}/cancel
Used to cancel an individual reward earned from a referral program. Works with: CREDIT
, PCT_DISCOUNT
, and FUELTANK
Tags: Reward Authentication: APIKey
Required |
id string |
The ID of the specific reward to be cancelled |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/reward/{id}/cancel \
-u :API_KEY \
-H "Content-Type: application/json" \
-d ''
id string |
The unique identifier for this reward |
||||||
---|---|---|---|---|---|---|---|
type string |
The type of reward. Possible values:
|
||||||
dateGiven integer |
Timestamp of when this reward was earned. |
||||||
dateExpires integer |
Timestamp of when this reward is set to expire. |
||||||
dateCancelled integer |
Timestamp if the reward is cancellable and has been cancelled, the date it was cancelled on. Null if not never cancelled. |
||||||
dateScheduledFor integer |
Timestamp of when the reward is sheduled to become available. |
||||||
cancellable boolean |
If a reward is cancellable then it may be revoked. If it has been cancelled then |
||||||
rewardSource string |
The type of the source of the reward. Possible values:
|
||||||
unit string |
An identifier for the unit of the reward. E.g. |
||||||
discountPercent integer |
The percent discount. E.g. 10 means 10% Works with: |
||||||
name string |
The human-readable name of the reward. |
||||||
description string |
The human-readable description of the reward. Works with: |
||||||
assignedCredit integer |
The earned quantity of the reward. Works with: |
||||||
redeemedCredit integer |
The redeemed quantity of the reward. Works with: |
||||||
redemptions array |
|
||||||
currency string |
For programs that require a currency. Works with: |
||||||
amount integer |
The earned quantity of the reward. Works with: |
||||||
fuelTankCode string |
The fueltank code associated with this reward. Works with: |
||||||
fueltankType string |
The type of reward associated with this fueltank code. Works with: Possible values:
|
Example Response
HTTP 200
{
"id": "582142aae4b05442a5fa01a5",
"type": "CREDIT",
"dateGiven": 1478574762838,
"dateExpires": null,
"dateCancelled": null,
"dateScheduledFor": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"unit": "CENTS",
"assignedCredit": 2500,
"redeemedCredit": 0,
"redemptions": [
{
"id": "5462600de4b09b1c41238f2f",
"dateRedeemed": 1415733261275,
"quantityRedeemed": 2000
}
],
"name": "Dollar Credit",
"currency": null
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 400
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/rewards/account/{accountId}/user/{userId}
Used to create a reward for a specified user. Note that the reward will only be redeemed automatically if the default program supports automatic redemption for the provided reward type (see the install guides for more on automatic redemption).
Tags: Reward Authentication: APIKey
Required |
userId string |
The ID of the user that will be given the reward |
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Required |
accountId string |
The ID of the account that will be given the reward |
|||||||||||||||||||||||||||||||||
Required |
reward JSON Body |
Details of the reward to create
|
|||||||||||||||||||||||||||||||||
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/rewards/account/{accountId}/user/{userId} \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"type": "PCT_DISCOUNT",
"dateExpires": 1471028988000,
"cancellable": true,
"discountPercent": 15
}'
id string |
The unique identifier for this reward |
||||||
---|---|---|---|---|---|---|---|
type string |
The type of reward. Possible values:
|
||||||
dateGiven integer |
Timestamp of when this reward was earned. |
||||||
dateExpires integer |
Timestamp of when this reward is set to expire. |
||||||
dateCancelled integer |
Timestamp if the reward is cancellable and has been cancelled, the date it was cancelled on. Null if not never cancelled. |
||||||
dateScheduledFor integer |
Timestamp of when the reward is sheduled to become available. |
||||||
cancellable boolean |
If a reward is cancellable then it may be revoked. If it has been cancelled then |
||||||
rewardSource string |
The type of the source of the reward. Possible values:
|
||||||
unit string |
An identifier for the unit of the reward. E.g. |
||||||
discountPercent integer |
The percent discount. E.g. 10 means 10% Works with: |
||||||
name string |
The human-readable name of the reward. |
||||||
description string |
The human-readable description of the reward. Works with: |
||||||
assignedCredit integer |
The earned quantity of the reward. Works with: |
||||||
redeemedCredit integer |
The redeemed quantity of the reward. Works with: |
||||||
redemptions array |
|
||||||
currency string |
For programs that require a currency. Works with: |
||||||
amount integer |
The earned quantity of the reward. Works with: |
||||||
fuelTankCode string |
The fueltank code associated with this reward. Works with: |
||||||
fueltankType string |
The type of reward associated with this fueltank code. Works with: Possible values:
|
Example Response
HTTP 201
[
{
"id": "582142aae4b05442a5fa01a5",
"type": "CREDIT",
"dateGiven": 1478574762838,
"dateExpires": null,
"dateCancelled": null,
"dateScheduledFor": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"unit": "CENTS",
"assignedCredit": 2500,
"redeemedCredit": 0,
"redemptions": [
{
"id": "5462600de4b09b1c41238f2f",
"dateRedeemed": 1415733261275,
"quantityRedeemed": 2000
}
],
"name": "Dollar Credit",
"currency": null
},
{
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
{
"id": "12345678e4b1234aff143be5",
"type": "FUELTANK",
"dateGiven": 1497907329060,
"dateExpires": null,
"dateCancelled": null,
"accountId": "abc_122",
"userId": "abc_122",
"cancellable": true,
"rewardSource": "FRIEND_SIGNUP",
"fuelTankCode": "CODE8",
"unit": "CENTS",
"amount": 1000,
"fueltankType": "CREDIT"
}
]
/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}
This method updates/creates a user and an account and returns the user object representing that newly created user/account.
Because this call creates a user, it requires either a write token or an API key.
Tags: User Open Endpoint Authentication: APIKey UserJWT
Required |
accountId string |
The account to upsert |
|||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Required |
userId string |
The user to upsert |
|||||||||||||||||||||||||||||||||||||||||||||||||||
Required |
user JSON Body |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Required |
tenant_alias string |
Tenant being referenced. E.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
fields string |
The fields to be included in the response. Cannot coexist with |
||||||||||||||||||||||||||||||||||||||||||||||||||||
extraFields string |
The fields to be included in the response in addition to all the default fields. To select from default fields, use |
Example Curl Request
curl -X PUT https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"id": "219065",
"accountId": "accc9065",
"firstName": "Bob",
"lastName": "Testerson",
"email": "bob@example.com",
"referable": true,
"referralCode": "BOBTESTERSON",
"referralCodes": {
"classic": "BOBTESTERSON",
"fakeProgram1": "BOBTESTERSON123"
},
"paymentProviderId": "cus_8rVOAthabctvT6",
"locale": "en_US",
"referredBy": {
"code": "JONDOE1234",
"isConverted": true
},
"referredByCodes": [
"JONDOE1234",
"JOHNDOECODE"
],
"imageUrl": "https://www.example.com/profile/ab5111251125",
"segments": [
"segment1",
"~segment2"
],
"customFields": {
"lastPurchaseDate": 1512152525513,
"plan": "Pro+",
"phone": 19055551234,
"address": "123 Main st., City, Province, Country, H0H0H0",
"shoeSize": 12.5,
"currency": "CAD"
}
}'
id string |
The unique identifier for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cookieId string |
A unique identifier for this participant. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCodes object |
The referral codes across all programs that the user currently has. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredBy object |
An object containing information about who referred this user.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredByCodes array |
An array of referral codes used to refer this account. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referable boolean |
Flag used by the SaaSquatch system to determine whether a user is able to be referred. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customFields object |
An object containing the custom fields for this user. Learn more about the available custom field functionality in our Custom Fields Developer Guide |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
segments array |
A list of segments that a user is a member of. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
Example Response
HTTP 200
{
"id": "898746321",
"cookieId": "2523423436323",
"accountId": "987321",
"firstName": "Henk",
"lastName": "Thompson",
"email": "hello@example.com",
"referable": true,
"locale": null,
"referralCode": "HENKTHOMPSON",
"referralCodes": {
"classic": "HENKTHOMPSON",
"fakeProgram1": "HENKTHOMPSON123"
},
"referredBy": {
"code": "JONDOE1234",
"isConverted": true,
"newlyReferred": false
},
"referredByCodes": [
"JONDOE1234"
],
"imageUrl": "",
"customFields": {
"lastPurchaseDate": 1512152525513,
"plan": "Pro+",
"phone": 19055551234,
"address": "123 Main st., City, Province, Country, H0H0H0",
"shoeSize": 12.5,
"currency": "CAD"
},
"segments": [
"segment1",
"segment3"
],
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}
This method creates a user and an account and returns the user object representing that newly created user/account.
Because this call creates a user, it requires either a write token or an API key.
Tags: User Open Endpoint Authentication: APIKey UserJWT
Required |
accountId string |
The account to create |
|||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Required |
userId string |
The user to create |
|||||||||||||||||||||||||||||||||||||||||||||||||||
Required |
user JSON Body |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Required |
tenant_alias string |
Tenant being referenced. E.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
fields string |
The fields to be included in the response. Cannot coexist with |
||||||||||||||||||||||||||||||||||||||||||||||||||||
extraFields string |
The fields to be included in the response in addition to all the default fields. To select from default fields, use |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"id": "219065",
"accountId": "accc9065",
"firstName": "Bob",
"lastName": "Testerson",
"email": "bob@example.com",
"referable": true,
"referralCode": "BOBTESTERSON",
"referralCodes": {
"classic": "BOBTESTERSON",
"fakeProgram1": "BOBTESTERSON123"
},
"paymentProviderId": "cus_8rVOAthabctvT6",
"locale": "en_US",
"referredBy": {
"code": "JONDOE1234",
"isConverted": true
},
"referredByCodes": [
"JONDOE1234",
"JOHNDOECODE"
],
"imageUrl": "https://www.example.com/profile/ab5111251125",
"segments": [
"segment1",
"~segment2"
],
"customFields": {
"lastPurchaseDate": 1512152525513,
"plan": "Pro+",
"phone": 19055551234,
"address": "123 Main st., City, Province, Country, H0H0H0",
"shoeSize": 12.5,
"currency": "CAD"
}
}'
id string |
The unique identifier for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cookieId string |
A unique identifier for this participant. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCodes object |
The referral codes across all programs that the user currently has. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredBy object |
An object containing information about who referred this user.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredByCodes array |
An array of referral codes used to refer this account. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referable boolean |
Flag used by the SaaSquatch system to determine whether a user is able to be referred. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customFields object |
An object containing the custom fields for this user. Learn more about the available custom field functionality in our Custom Fields Developer Guide |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
segments array |
A list of segments that a user is a member of. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
Example Response
HTTP 201
{
"id": "898746321",
"cookieId": "2523423436323",
"accountId": "987321",
"firstName": "Henk",
"lastName": "Thompson",
"email": "hello@example.com",
"referable": true,
"locale": null,
"referralCode": "HENKTHOMPSON",
"referralCodes": {
"classic": "HENKTHOMPSON",
"fakeProgram1": "HENKTHOMPSON123"
},
"referredBy": {
"code": "JONDOE1234",
"isConverted": true,
"newlyReferred": false
},
"referredByCodes": [
"JONDOE1234"
],
"imageUrl": "",
"customFields": {
"lastPurchaseDate": 1512152525513,
"plan": "Pro+",
"phone": 19055551234,
"address": "123 Main st., City, Province, Country, H0H0H0",
"shoeSize": 12.5,
"currency": "CAD"
},
"segments": [
"segment1",
"segment3"
],
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}
Looks up a user based upon their id
and returns their personal information including sharelinks. This endpoint requires a read token or an API key.
This is an Open Endpoint and disabled by default. Contact support to enable the open endpoints.
Tags: User Open Endpoint Authentication: APIKey UserJWT
Required |
accountId string |
A valid Account ID that a user is associated with |
---|---|---|
Required |
userId string |
A valid User ID |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
fields string |
The fields to be included in the response. Cannot coexist with |
|
extraFields string |
The fields to be included in the response in addition to all the default fields. To select from default fields, use |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} \
-u :API_KEY \
id string |
The unique identifier for this user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cookieId string |
A unique identifier for this participant. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
accountId string |
The unique identifier of the Account that this user belongs to. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
firstName string |
The user's first name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lastName string |
The user's last name |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email string |
The email address provided for the user. SaaSquatch uses this to notify someone when they have a successful referral. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCode string |
The referral code used for sharing by this user |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referralCodes object |
The referral codes across all programs that the user currently has. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
imageUrl string |
Optionally used in widgets, emails, and themes. If you provide a absolute profile image URL the minimum image size is 80px x 80px. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locale string |
The user's locale, used for Internationalization. The locale must be of the format 'language_COUNTRY' where the language code must be lowercase and the country code must be uppercase. The separator must be an underscore. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredBy object |
An object containing information about who referred this user.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referredByCodes array |
An array of referral codes used to refer this account. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
referable boolean |
Flag used by the SaaSquatch system to determine whether a user is able to be referred. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customFields object |
An object containing the custom fields for this user. Learn more about the available custom field functionality in our Custom Fields Developer Guide |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
segments array |
A list of segments that a user is a member of. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareLinks object readonly |
Share link for an individual user.
|
Example Response
HTTP 200
{
"id": "898746321",
"cookieId": "2523423436323",
"accountId": "987321",
"firstName": "Henk",
"lastName": "Thompson",
"email": "hello@example.com",
"referable": true,
"locale": null,
"referralCode": "HENKTHOMPSON",
"referralCodes": {
"classic": "HENKTHOMPSON",
"fakeProgram1": "HENKTHOMPSON123"
},
"referredBy": {
"code": "JONDOE1234",
"isConverted": true,
"newlyReferred": false
},
"referredByCodes": [
"JONDOE1234"
],
"imageUrl": "",
"customFields": {
"lastPurchaseDate": 1512152525513,
"plan": "Pro+",
"phone": 19055551234,
"address": "123 Main st., City, Province, Country, H0H0H0",
"shoeSize": 12.5,
"currency": "CAD"
},
"segments": [
"segment1",
"segment3"
],
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 401
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}
Delete a user in your SaaSquatch project. This endpoint will only delete a User on an Account (and not the Account itself). Learn more about Accounts vs. Users in our article on Account Structure.
To delete both the Account (and all the users on the account), use the Delete Account endpoint.
Learn more about deleting participants within your SaaSquatch project in our article on Participant Deletion
Include the doNotTrack
query parameter as true
to indicate to the SaaSquatch system that the user should not be able to be re-registered on the same account. Learn more about doNotTrack
in our article on Participant Deletion
Tags: User Open Endpoint Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|---|---|
Required |
accountId string |
The ID of the account to be deleted |
Required |
userId string |
The ID of the user to be deleted |
doNotTrack boolean |
Do not track this user (this user cannot be re-registered in SaaSquatch on the same account). Learn more about |
Example Curl Request
curl -X DELETE https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} \
-u :API_KEY \
Example Response
HTTP 204
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/open/user
Looks up a user based upon their ReferralCode
and returns their personal information. This method is useful for retrieving the user when only the Referral Code is available, for example when a referred user enters a Referral Code during checkout and you want to find out who this Referral Code belongs to.
This is an Open Endpoint and disabled by default. Contact support to enable the open endpoints.
Tags: User Open Endpoint Authentication: Unauthenticated
Required |
referralCode string |
The code with which to lookup the User |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/user?referralCode= \
-u :API_KEY \
Example Response
HTTP 200
{
"id": "876343",
"accountId": "613611",
"email": "bob@example.com",
"firstName": "Bob",
"lastName": "Testerson",
"referralCode": "BOBTESTERSON",
"imageUrl": ""
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/open/code/{referral_code}
Looks up a referral code and the details of the attached reward.
This is an Open Endpoint and disabled by default. Contact support to enable the open endpoints.
Tags: Referral Code Open Endpoint Authentication: Unauthenticated
Required |
referral_code string |
The code to be validated |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/code/{referral_code} \
-u :API_KEY \
code string |
The unique identifier for the code. E.g. "BOBTESTERSON" |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dateCreated integer |
The date the code was created. |
||||||||||||||
referrerName string |
The name of the owner of this code. E.g. "Bob Testerson" |
||||||||||||||
reward object |
Details of the reward that could be earned -- but is not yet earned.
|
Example Response
HTTP 200
{
"code": "BOBTESTERSON",
"dateCreated": 1411600868797,
"referrerName": "Bob T",
"reward": {
"type": "CREDIT",
"unit": "CENTS",
"credit": 2500
}
}
{
"code": "BOBTESTERSON",
"dateCreated": 1411600868797,
"referrerName": "Bob T",
"reward": {
"type": "PCT_DISCOUNT",
"discountPercent": 20,
"unit": "%"
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/open/code/{referral_code}/account/{account_id}/user/{user_id}
Apply a ReferralCode
to a referred account to attribute a referral.
This endpoint requires a write token or an API key.
This is an Open Endpoint and disabled by default. Contact support to enable the open endpoints.
Tags: Referral Code Open Endpoint Authentication: APIKey UserJWT
Required |
referral_code string |
Referral code to apply to user account. |
---|---|---|
Required |
account_id string |
Account to apply referral code to. This account will be marked as "referred by" the owner of the |
Required |
user_id string |
User to apply referral code to. This user will be marked as "referred by" the owner of the |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/code/{referral_code}/account/{account_id}/user/{user_id} \
-u :API_KEY \
-H "Content-Type: application/json" \
-d ''
Example Response
HTTP 200
{
"code": "BOBTESTERSON",
"dateCreated": 1411600868797,
"referrerName": "Bob T",
"reward": {
"type": "PCT_DISCOUNT",
"discountPercent": 10,
"monthsDiscountIsValid": 12
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 400
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 401
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 403
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/open/referrals
Lists all of the referrals involving the given user. This method is the primary way of getting a list of everyone that has made a referral and everyone that has been referred, and supports pagination using the parameters for limit
and offset
to iterate through a very large list of records.
Note: Either the referringAccountId
and referringUserId
or referredAccountId
and referredUserId
parameters are required, along with a read token for authenticaion.
This is an Open Endpoint and disabled by default. Contact support to enable the open endpoints.
Tags: Referral Open Endpoint Authentication: APIKey UserJWT
referringAccountId string |
When included, filters the results to only include referrals where this |
|
---|---|---|
referringUserId string |
When included, filters the results to only include referrals where this |
|
referredAccountId string |
When included, filters the results to only include referrals where this |
|
referredUserId string |
When included, filters the results to only include referrals where this |
|
dateReferralStarted string |
When included, filters the results either to the exact timestamp if only one value is given, or a range if devided by a comma. I.E. 0,123412451 gives all referrals that started between 0 and 123412451. |
|
dateReferralPaid string |
When included, filters the results either to the exact timestamp if only one value is given, or a range if devided by a comma. I.E. 0,123412451 gives all referrals that converted between 0 and 123412451. |
|
dateReferralEnded string |
When included, filters the results either to the exact timestamp if only one value is given, or a range if devided by a comma. I.E. 0,123412451 gives all referrals that ended between 0 and 123412451. |
|
referredModerationStatus string |
When included, filters the result to only include referred users with that status. Statuses that are accepted: |
|
referrerModerationStatus string |
When included, filters the result to only include referrers with that status. Statuses that are accepted: |
|
limit integer |
A limit on the number of results returned. Defaults to |
|
offset integer |
When included offsets the first result returns in the list. Use this to paginate through a long list of results. Defaults to |
|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/referrals \
-u :API_KEY \
referrals array |
A list of Referral objects. This is the actual data in this list envelope.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count integer |
The number of results returned in this list, see |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
totalCount integer |
The total number of results available overall, see |
Example Response
HTTP 200
{
"count": 2,
"totalCount": 4,
"referrals": [
{
"id": "546270a6e4b0c1871186a920",
"referredUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referrerUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referredReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"referrerReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"moderationStatus": "ACTIONED",
"dateReferralStarted": 1415737510411,
"dateReferralPaid": 1415737557217,
"dateReferralEnded": null,
"dateModerated": 1427410131029,
"referredModerationStatus": "APPROVED",
"referrerModerationStatus": "APPROVED",
"fraudSignals": {
"ip": {
"message": "Referrer and referred came from the same IP",
"score": 50
}
}
},
{
"id": "546270a6e4b0c1871186a920",
"referredUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referrerUser": {
"id": "898746321",
"accountId": "987321",
"email": "hello@example.com",
"firstName": "Henk",
"lastName": "Thompson",
"referralCode": "HENKTHOMPSON",
"imageUrl": "",
"firstSeenIP": "10.230.163.157",
"lastSeenIP": "184.66.242.57",
"dateCreated": 1467222395030,
"emailHash": "180bc1412a038746af9b37fb782724a2",
"referralSource": "http://unifiedtestapp.herokuapp.com/",
"locale": null,
"shareLinks": {
"shareLink": "http://ssqt.co/mvbcF5",
"facebookShareLink": "http://ssqt.co/mmbcF5",
"twitterShareLink": "http://ssqt.co/mRbcF5",
"emailShareLink": "http://ssqt.co/mLbcF5",
"linkedinShareLink": "http://ssqt.co/mLbcF5",
"mobileShareLink": "http://ssqt.co/mebcF5",
"mobileFacebookShareLink": "http://ssqt.co/mnbcF5",
"mobileTwitterShareLink": "http://ssqt.co/mCbcF5",
"mobileEmailShareLink": "http://ssqt.co/mEbcF5",
"EMBED": {
"shareLink": "http://ssqt.co/mQbcF5",
"facebookShareLink": "http://ssqt.co/mwbcF5",
"twitterShareLink": "http://ssqt.co/mcbcF5",
"emailShareLink": "http://ssqt.co/mJbcF5",
"linkedinShareLink": "http://ssqt.co/mHbcF5"
},
"POPUP": {
"shareLink": "http://ssqt.co/m5bcF5",
"facebookShareLink": "http://ssqt.co/m9bcF5",
"twitterShareLink": "http://ssqt.co/mMbcF5",
"emailShareLink": "http://ssqt.co/mobcF5",
"linkedinShareLink": "http://ssqt.co/m7bcF5"
},
"HOSTED": {
"shareLink": "http://ssqt.co/mtbcF5",
"facebookShareLink": "http://ssqt.co/mubcF5",
"twitterShareLink": "http://ssqt.co/mSbcF5",
"emailShareLink": "http://ssqt.co/mlbcF5",
"linkedinShareLink": "http://ssqt.co/mYbcF5"
},
"MOBILE": {
"shareLink": "http://ssqt.co/mebcF5",
"facebookShareLink": "http://ssqt.co/mnbcF5",
"twitterShareLink": "http://ssqt.co/mCbcF5",
"emailShareLink": "http://ssqt.co/mEbcF5",
"linkedinShareLink": "http://ssqt.co/m3bcF5"
},
"EMAIL": {
"shareLink": "http://ssqt.co/mPbcF5",
"facebookShareLink": "http://ssqt.co/mTbcF5",
"twitterShareLink": "http://ssqt.co/mGbcF5",
"emailShareLink": "http://ssqt.co/mbbcF5",
"linkedinShareLink": "http://ssqt.co/m1bcF5"
}
}
},
"referredReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"referrerReward": {
"id": "5462600de4b09b1c41108f2e",
"type": "PCT_DISCOUNT",
"dateGiven": 1415733261275,
"dateExpires": null,
"dateCancelled": null,
"accountId": "613611",
"userId": "876343",
"cancellable": true,
"rewardSource": "REFERRED",
"discountPercent": 20,
"unit": "%"
},
"moderationStatus": "ACTIONED",
"dateReferralStarted": 1415737510411,
"dateReferralPaid": 1415737557217,
"dateReferralEnded": null,
"dateModerated": 1427410131029,
"referredModerationStatus": "APPROVED",
"referrerModerationStatus": "APPROVED",
"fraudSignals": {
"ip": {
"message": "Referrer and referred came from the same IP",
"score": 50
}
}
}
]
}
/api/v1/{tenant_alias}/open/account/{accountId}
Delete an account in your SaaSquatch project. This endpoint will delete the account and all users on the account. Learn more about Accounts vs. Users in our article on Account Structure.
To delete only a specific User on the Account use the Delete User endpoint.
Learn more about deleting participants within your SaaSquatch project in our article on Participant Deletion
Include the doNotTrack
query parameter as true
to indicate to the SaaSquatch system that all currently-registered Users on this Account should not be able to be re-registered on the same Account. Learn more about doNotTrack
in our article on Participant Deletion
Tags: Account Open Endpoint Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|---|---|
Required |
accountId string |
The ID of the account to be deleted |
doNotTrack boolean |
Do not track the user (this user cannot be re-registered in SaaSquatch). Learn more about |
Example Curl Request
curl -X DELETE https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId} \
-u :API_KEY \
Example Response
HTTP 204
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
Example Response
HTTP 404
/api/v1/{tenant_alias}/subscription
Subscribes a URL to receive events via webhooks
Tags: Webhook Authentication: APIKey
Required |
endpoint JSON Body |
Details of the endpoint to be created
|
||||||
---|---|---|---|---|---|---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/subscription \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"endpointUrl": "http://app.example.com/endpoint/sqtch",
"name": "Zapier"
}'
Example Response
HTTP 201
/api/v1/{tenant_alias}/subscription
Lists all the URLs that are currently subscribed to receive events via webhooks
Tags: Webhook Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/subscription \
-u :API_KEY \
endpointUrl string |
The url of the endpoint that receives events |
---|---|
name string |
Optional name of the endpoint that receives events |
Example Response
HTTP 200
[
{
"endpointUrl": "https://example.com/hook",
"name": "Zapier"
},
{
"endpointUrl": "https://another.example.com/hook",
"name": "Example"
}
]
/api/v1/{tenant_alias}/subscription/{url}
Removes a URL from receiving events via webhooks
Tags: Webhook Authentication: APIKey
Required |
url string |
The url of the endpoint that will be removed. Remember to URL-encode this field |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X DELETE https://app.referralsaasquatch.com/api/v1/{tenant_alias}/subscription/{url} \
-u :API_KEY \
Example Response
HTTP 204
/api/v1/{tenant_alias}/subscription/{url}/test
Sends a test event to the specified webhook
Tags: Webhook Authentication: APIKey
Required |
url string |
The url of the endpoint to send a test message to. Remember to URL-encode this field |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/subscription/{url}/test \
-u :API_KEY \
-H "Content-Type: application/json" \
-d ''
Example Response
HTTP 204
/api/v1/{tenant_alias}/export
Creates an asynchronous request for an Exports. Depending on the size of the Export and other exports in the export pipeline, it may take awhile for an export request to complete. Once the Export is completed, it can be downloaded in the requested format (CSV or zipped XLSX) using the download url endpoint.
Here are a few ways to check for when an export is ready.
id
. Make sure you store the id
of the export when you request it.Tags: Export Authentication: APIKey
Required |
export JSON Body |
Details of the export to be created
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/export \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"type": "REFERRAL",
"format": "CSV",
"requester": "Referral SaaSquatch for Salesforce",
"params": {
"createdOrUpdatedSince": 1471486152087,
"createdOrUpdatedBefore": 1471486452087,
"programId": "my-program-id"
}
}'
type string |
The type of Export that's being requested. Possible values:
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
format string |
The format of the Export Possible values:
|
||||||||||||||
name string |
A user-friendly name for this report. Useful for keeping track of which report is which. |
||||||||||||||
requester string |
Detail on the service or user that requested this report. |
||||||||||||||
params object |
Filter parameters for limiting the types of results returned. When parameters are included, their are grouped by a logical "AND" so it's possible to create situations that return no results.
|
||||||||||||||
id string readonly |
A unique ID used to keep track of an export's life. Can be used to lookup an exports status. |
||||||||||||||
status string readonly |
The status of this export. Possible values:
|
||||||||||||||
dateCreated integer readonly |
The timestamp when this request was created. This field will never change. |
||||||||||||||
dateCompleted integer readonly |
The timestamp when this report finished processing and had it's |
||||||||||||||
dateExpires integer readonly |
The timestamp when this report will expire. By default all reports will eventually expire. |
Example Response
HTTP 201
/api/v1/{tenant_alias}/export/{exportId}
Looks up an Export to check its status. Useful when you're generating exports to check when an export is complete. When the status is no longer PENDING
so that you can begin to download the export.
Tags: Export Authentication: APIKey
Required |
exportId string |
The |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/export/{exportId} \
-u :API_KEY \
type string |
The type of Export that's being requested. Possible values:
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
format string |
The format of the Export Possible values:
|
||||||||||||||
name string |
A user-friendly name for this report. Useful for keeping track of which report is which. |
||||||||||||||
requester string |
Detail on the service or user that requested this report. |
||||||||||||||
params object |
Filter parameters for limiting the types of results returned. When parameters are included, their are grouped by a logical "AND" so it's possible to create situations that return no results.
|
||||||||||||||
id string readonly |
A unique ID used to keep track of an export's life. Can be used to lookup an exports status. |
||||||||||||||
status string readonly |
The status of this export. Possible values:
|
||||||||||||||
dateCreated integer readonly |
The timestamp when this request was created. This field will never change. |
||||||||||||||
dateCompleted integer readonly |
The timestamp when this report finished processing and had it's |
||||||||||||||
dateExpires integer readonly |
The timestamp when this report will expire. By default all reports will eventually expire. |
Example Response
HTTP 200
Example Response
HTTP 404
/api/v1/{tenant_alias}/export/{exportId}/download
The endpoint to download a completed export. This method can only be used when an export is COMPLETED
. Exports are not always immediately available to download
after they have been created, often exports are large files that take time to process and prepare. If you want to check if an export is ready to be downloaded,
use the API method to lookup an export or to list exports.
Tags: Export Authentication: APIKey
Required |
exportId string |
The |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/export/{exportId}/download \
-u :API_KEY \
Example Response
HTTP 200
/api/v1/{tenant_alias}/export/history/list
List all of the exports in a tenant. Useful for tracking down exports
Tags: Export Authentication: APIKey
limit integer |
A limit on the maximum number of results to return, defaults to |
|
---|---|---|
offset integer |
The row number of the first result to return, defaults to |
|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/export/history/list \
-u :API_KEY \
data array |
A list of Export objects. This is the actual data in this list envelope.
|
||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count integer |
The number of results returned in this list, see |
||||||||||||||||||||||||||||||||||
totalCount integer |
The total number of results available overall, see |
Example Response
HTTP 200
/api/v1/{tenant_alias}/theme/variables/schema
Returns the variables schema object that is defined in the tenant theme repository. This will be a JSON Schema standards compliant definition.
For the list of current variable values, see the theme variables for more info.
Tags: Theme Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/variables/schema \
-u :API_KEY \
Example Response
HTTP 200
{
"title": "Example Theme Variables Schema",
"type": "object",
"properties": {
"jsOptions": {
"type": "object",
"properties": {
"widget": {
"type": "object",
"properties": {
"defaultWidgetType": {
"type": "string",
"title": "Default Widget Type",
"default": "REFERRER_WIDGET",
"enum": [
"REFERRER_WIDGET",
"CONVERSION_WIDGET"
],
"options": {
"enum_titles": [
"Referrer's Widget",
"Referred User Widget"
]
}
}
}
},
"conversionUrls": {
"type": "array",
"items": {
"type": "string"
}
},
"widgetUrlMappings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"showAsCTA": {
"type": "boolean"
},
"displayOnLoad": {
"type": "boolean"
},
"widgetType": {
"type": "string",
"enum": [
"REFERRER_WIDGET",
"CONVERSION_WIDGET"
],
"options": {
"enum_titles": [
"Referrer's Widget",
"Referred User Widget"
]
}
}
}
}
}
}
},
"widget": {
"type": "object",
"properties": {
"REFERRER_WIDGET": {
"type": "object",
"properties": {
"configuration": {
"properties": {
"themeMapping": {
"default": "widget"
}
}
},
"content": {
"properties": {
"widgetCustomization": {
"title": "Customize Referral Widget",
"properties": {
"widgetFont": {
"default": "\"Helvetica Neue\",Helvetica,Arial,sans-serif"
},
"headerColor": {
"default": "#4486E1"
},
"heading": {
"default": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!"
},
"headerDetails": {
"default": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill."
},
"shareCodeDetails": {
"type": "string",
"format": "markdown",
"title": "Call To Action Text",
"default": "Share the link below or use the code **{{user.referralCode}}**",
"options": {
"input_height": "100px",
"validate": [
"handlebars"
]
}
},
"registrationHeader": {
"type": "string",
"format": "markdown",
"title": "Registration Header",
"default": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used.",
"options": {
"input_height": "100px",
"validate": [
"handlebars"
]
}
}
},
"$ ref": "#/definitions/widget/definitions/content/definitions/generalBody"
},
"shareMessaging": {
"$ ref": "#/definitions/widget/definitions/content/definitions/shareContent",
"required": [
"emailShareBody",
"emailShareSubject",
"facebookShareSubject",
"facebookShareBody",
"twitterShareBody",
"smsShareBody"
]
}
}
},
"cta": {
"type": "object",
"properties": {
"configuration": {
"$ ref": "#/definitions/widget/definitions/cta/definitions/configuration"
},
"content": {
"properties": {
"buttonText": {
"default": "Refer Friends For Rewards"
}
},
"$ ref": "#/definitions/widget/definitions/cta/definitions/content"
}
}
}
}
},
"CONVERSION_WIDGET": {
"type": "object",
"properties": {
"configuration": {
"properties": {
"themeMapping": {
"default": "conversion-widget"
}
}
},
"content": {
"properties": {
"widgetCustomization": {
"title": "Customize Referred Widget",
"properties": {
"widgetHeaderImage": {
"type": "string",
"format": "text",
"minLength": 1,
"title": "Heading Image Url:",
"default": "{{assets 'images/conversion.png'}}"
},
"widgetFont": {
"default": "\"Helvetica Neue\",Helvetica,Arial,sans-serif"
},
"headerColor": {
"default": "#444"
},
"heading": {
"default": "You were Successfully Referred to {{companyName}}"
},
"headerDetails": {
"default": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount"
},
"buttonCopy": {
"type": "string",
"format": "text",
"minLength": 1,
"title": "Button Copy",
"default": "COPY CODE"
}
},
"$ ref": "#/definitions/widget/definitions/content/definitions/generalBody"
}
}
},
"cta": {
"type": "object",
"properties": {
"configuration": {
"$ ref": "#/definitions/widget/definitions/cta/definitions/configuration"
},
"content": {
"properties": {
"buttonText": {
"default": "Get Rewarded"
}
},
"$ ref": "#/definitions/widget/definitions/cta/definitions/content"
}
}
}
}
}
}
},
"email": {
"type": "object",
"properties": {
"REFERRER_REWARD_LIMIT_REACHED": {
"type": "object",
"properties": {
"configuration": {
"properties": {
"subject": {
"default": "You have hit the reward limit!"
},
"themeMapping": {
"default": "emails/referrer-reward-limit"
}
},
"$ ref": "#/definitions/email/definitions/configuration"
},
"content": {
"properties": {
"headerImageUrl": {
"default": "{{assets 'images/email/reward-limit-header.png'}}"
},
"headerContent": {
"default": "#Reward Limit\nYou have successfully referred the maximum!"
},
"bodyContent": {
"default": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
},
"shareCTA": {
"default": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**"
}
},
"$ ref": "#/definitions/email/definitions/shareContent"
}
}
},
"REFERRAL_CONVERTED": {
"type": "object",
"properties": {
"configuration": {
"properties": {
"subject": {
"default": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
},
"themeMapping": {
"default": "emails/referral-converted"
}
},
"$ ref": "#/definitions/email/definitions/configuration"
},
"content": {
"properties": {
"headerImageUrl": {
"default": "{{assets 'images/email/referral-converted-header.png'}}"
},
"headerContent": {
"default": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!"
},
"bodyContent": {
"default": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"$ ref": "#/definitions/email/definitions/shareContent"
}
}
},
"REFERRAL_STARTED": {
"type": "object",
"properties": {
"configuration": {
"properties": {
"subject": {
"default": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!"
},
"themeMapping": {
"default": "emails/referral-started"
}
},
"$ ref": "#/definitions/email/definitions/configuration"
},
"content": {
"properties": {
"headerImageUrl": {
"default": "{{assets 'images/email/referral-started-header.png'}}"
},
"headerContent": {
"default": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!"
},
"bodyContent": {
"default": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
},
"$ ref": "#/definitions/email/definitions/shareContent"
}
}
}
}
}
},
"definitions": {
"widget": {
"definitions": {
"content": {
"definitions": {
"generalBody": {
"type": "object",
"properties": {
"widgetFont": {
"type": "string",
"title": "Widget Font:",
"enum": [
"\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"'Lato',sans-serif",
"'Times New Roman'",
"Arial",
"Courier",
"Tahoma",
"Verdana",
"Georgia"
],
"options": {
"enum_titles": [
"Helvetica Neue",
"Lato",
"Times New Roman",
"Arial",
"Courier",
"Tahoma",
"Verdana",
"Georgia"
]
}
},
"headerColor": {
"type": "string",
"format": "text",
"minLength": 1,
"title": "Heading Text Color (hex code):",
"options": {
"validate": [
"hex-color"
]
}
},
"heading": {
"type": "string",
"minLength": 1,
"format": "markdown",
"title": "Heading Text:",
"options": {
"input_height": "100px",
"validate": [
"handlebars"
]
}
},
"headerDetails": {
"type": "string",
"minLength": 1,
"format": "markdown",
"title": "Body Text:",
"options": {
"input_height": "100px",
"validate": [
"handlebars"
]
}
}
}
},
"shareContent": {
"title": "Share Messaging",
"type": "object",
"properties": {
"emailShareSubject": {
"type": "string",
"description": "Email share subject",
"minLength": 4,
"default": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}"
},
"emailShareBody": {
"type": "string",
"description": "Email share body",
"minLength": 4,
"default": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}"
},
"facebookShareImageURL": {
"type": "string",
"description": "Facebook URL Image",
"default": ""
},
"facebookShareSubject": {
"type": "string",
"description": "Facebook share subject",
"minLength": 4,
"default": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}"
},
"facebookShareBody": {
"type": "string",
"description": "Facebook share subject",
"minLength": 4,
"default": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.facebookShareLink}}"
},
"twitterShareBody": {
"type": "string",
"description": "Twitter share body",
"minLength": 4,
"default": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}"
},
"smsShareBody": {
"type": "string",
"description": "SMS share body",
"minLength": 4,
"default": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
}
}
}
},
"cta": {
"definitions": {
"configuration": {
"type": "object",
"properties": {
"themeMapping": {
"default": "cta-widget"
}
}
},
"content": {
"type": "object",
"title": "Customize CTA Button",
"properties": {
"buttonSide": {
"type": "string",
"title": "Button Side:",
"default": "right",
"enum": [
"left",
"right",
"center"
],
"options": {
"enum_titles": [
"Left Side",
"Right Side",
"Center"
]
}
},
"buttonPosition": {
"type": "string",
"title": "Button Position:",
"default": "bottom",
"enum": [
"top",
"bottom",
"middle"
],
"options": {
"enum_titles": [
"Top",
"Bottom",
"Middle"
]
}
},
"buttonColor": {
"type": "string",
"format": "text",
"minLength": 1,
"title": "Button Color (hex code):",
"default": "#4486E1",
"options": {
"validate": [
"hex-color"
]
}
},
"buttonText": {
"type": "string",
"title": "Button Text",
"format": "markdown",
"propertyOrder": 4,
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
},
"buttonWidth": {
"type": "integer",
"title": "Button Width",
"format": "number",
"default": 230
}
}
}
}
}
}
},
"email": {
"definitions": {
"configuration": {
"type": "object",
"title": "Email Defaults",
"properties": {
"fromName": {
"type": "string",
"title": "From Name",
"default": "{{companyName}}",
"propertyOrder": 1,
"minLength": 1,
"options": {
"validate": [
"handlebars"
]
}
},
"fromAddress": {
"type": "string",
"title": "From Address",
"format": "email",
"default": "referral@mail.saasquat.ch",
"propertyOrder": 2,
"minLength": 5,
"options": {
"validate": [
"email"
]
}
},
"subject": {
"type": "string",
"title": "Subject",
"format": "textarea",
"default": "Referral Update",
"propertyOrder": 3,
"minLength": 1,
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
},
"themeMapping": {
"options": {
"hidden": true
}
}
}
},
"generalContent": {
"type": "object",
"properties": {
"headerImageUrl": {
"type": "string",
"title": "Header Image URL",
"propertyOrder": 1,
"options": {
"validate": [
"handlebars"
]
}
},
"headerContent": {
"type": "string",
"title": "Header Content",
"format": "markdown",
"propertyOrder": 2,
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
},
"bodyContent": {
"type": "string",
"title": "Body Content",
"format": "markdown",
"propertyOrder": 3,
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
},
"footer": {
"type": "string",
"title": "Footer",
"format": "markdown",
"propertyOrder": 1001,
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
}
}
},
"shareContent": {
"type": "object",
"properties": {
"shareCTA": {
"type": "string",
"title": "Share Code CTA",
"format": "markdown",
"propertyOrder": 4,
"default": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
},
"hasShareLink": {
"type": "boolean",
"format": "checkbox",
"title": "Enable Share Link",
"propertyOrder": 5,
"default": true
},
"shareButtonHeader": {
"type": "string",
"title": "Share Button Header",
"format": "markdown",
"propertyOrder": 6,
"default": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"options": {
"validate": [
"handlebars"
],
"input_height": "50px"
}
}
}
}
}
}
},
"required": [
"jsOptions",
"widget",
"email"
]
}
/api/v1/{tenant_alias}/theme/variables/instance
Returns the current default variables values stored for the schema object that is defined in the tenant theme repository.
Tags: Theme Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/variables/instance \
-u :API_KEY \
Example Response
HTTP 200
{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}
/api/v1/{tenant_alias}/theme/variables/instance
Replaces all of the previously set default variables values. Use this operation only when your
goal is to completely replace all variable values, including deleting previous
values of othe fields that you're not setting. Prefer to use a PATCH
request
when you only want to update one variable or a subset of variables.
See theme variables for more info.
Tags: Theme Authentication: APIKey
Required |
instance JSON Body |
The variables object to replace all previously stored default values. |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X PUT https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/variables/instance \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}'
Example Response
HTTP 204
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
validationErrors array |
A list of validation errors |
Example Response
HTTP 400
{
"message": "Your request failed to validate against the current variables schema.",
"statusCode": 400,
"apiErrorCode": "VALIDATION_FAILED",
"validationErrors": [
"object has missing required properties ([\"emailShareSubject\",\"facebookShareBody\",\"facebookShareSubject\",\"twitterShareBody\"])"
]
}
/api/v1/{tenant_alias}/theme/variables/instance
Updates the previously stored values for the default variables included in this request. Will not override, nullify or delete the other variable values that are not included. This method can be used to selectively set a single variable. See theme variables for more info.
Tags: Theme Authentication: APIKey
Required |
instance JSON Body |
The variables object that will update fields included here. |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X PATCH https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/variables/instance \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}'
Example Response
HTTP 200
{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
validationErrors array |
A list of validation errors |
Example Response
HTTP 400
{
"message": "Your request failed to validate against the current variables schema.",
"statusCode": 400,
"apiErrorCode": "VALIDATION_FAILED",
"validationErrors": [
"object has missing required properties ([\"emailShareSubject\",\"facebookShareBody\",\"facebookShareSubject\",\"twitterShareBody\"])"
]
}
/api/v1/{tenant_alias}/theme/{locale}/variables/instance
Returns the current variables values, for a specific locale, stored for the schema object that is defined in the tenant theme repository.
Tags: Theme Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|---|---|
Required |
locale string |
The Locale for the variables object being retrieved. |
Example Curl Request
curl -X GET https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/{locale}/variables/instance \
-u :API_KEY \
Example Response
HTTP 200
{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}
/api/v1/{tenant_alias}/theme/{locale}/variables/instance
Replaces all of the previously set variables values for a specific locale. Use this operation only when your
goal is to completely replace all variable values for a locale, including deleting previous
values of othe fields that you're not setting. Prefer to use a PATCH
request
when you only want to update one variable or a subset of variables.
See theme variables for more info.
Tags: Theme Authentication: APIKey
Required |
instance JSON Body |
The variables object to replace all previously stored values. |
---|---|---|
Required |
locale string |
The Locale of the variables object being replaced. |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X PUT https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/{locale}/variables/instance \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}'
Example Response
HTTP 204
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
validationErrors array |
A list of validation errors |
Example Response
HTTP 400
{
"message": "Your request failed to validate against the current variables schema.",
"statusCode": 400,
"apiErrorCode": "VALIDATION_FAILED",
"validationErrors": [
"object has missing required properties ([\"emailShareSubject\",\"facebookShareBody\",\"facebookShareSubject\",\"twitterShareBody\"])"
]
}
/api/v1/{tenant_alias}/theme/{locale}/variables/instance
Updates the previously stored values for the localized variables included in this request. Will not override, nullify or delete the other variable values that are not included. This method can be used to selectively set a single variable. See theme variables for more info.
Tags: Theme Authentication: APIKey
Required |
instance JSON Body |
The variables object that will update fields included here. |
---|---|---|
Required |
locale string |
The Locale of the variables object being updated. |
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X PATCH https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/{locale}/variables/instance \
-u :API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}'
Example Response
HTTP 200
{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
validationErrors array |
A list of validation errors |
Example Response
HTTP 400
{
"message": "Your request failed to validate against the current variables schema.",
"statusCode": 400,
"apiErrorCode": "VALIDATION_FAILED",
"validationErrors": [
"object has missing required properties ([\"emailShareSubject\",\"facebookShareBody\",\"facebookShareSubject\",\"twitterShareBody\"])"
]
}
/api/v1/{tenant_alias}/theme/{locale}/variables/instance
Delete all variables for a specified locale. See theme variables for more info.
Tags: Theme Authentication: APIKey
Required |
locale string |
The Locale of the variables object to delete. |
---|---|---|
Required |
tenant_alias string |
Tenant being referenced. E.g. |
Example Curl Request
curl -X DELETE https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/{locale}/variables/instance \
-u :API_KEY \
Example Response
HTTP 200
{
"jsOptions": {
"widget": {
"defaultWidgetType": "REFERRER_WIDGET"
},
"conversionUrls": [
"^https:\\/\\/example\\.com\\/thank\\-you([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
],
"widgetUrlMappings": [
{
"widgetType": "CONVERSION_WIDGET",
"showAsCTA": true,
"displayOnLoad": true,
"url": "^https:\\/\\/example\\.com\\/widgetPage\\/([^a-zA-Z0-9.\\-_~!$&'()*+,;=:@/]+?.*$|$)"
}
]
},
"widget": {
"REFERRER_WIDGET": {
"configuration": {
"themeMapping": "widget"
},
"content": {
"widgetCustomization": {
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#4486E1",
"heading": "Give ${{math programDetails.referredRewardDetails.credit ' / 100'}} and Get ${{math programDetails.referrerRewardDetails.credit ' / 100'}}!",
"headerDetails": "Give a friend ${{math programDetails.referredRewardDetails.credit ' / 100'}} credit off {{companyName}} and receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} for yourself when they pay their first bill.",
"shareCodeDetails": "Share the link below or use the code **{{user.referralCode}}**",
"registrationHeader": "Thanks for sending your first referral!<br>Give us your email to ensure you get rewarded when your referral is used."
},
"shareMessaging": {
"emailShareSubject": "Get ${{math programDetails.referredRewardDetails.credit ' / 100'}} off {{companyName}}",
"emailShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.emailShareLink}}",
"facebookShareImageURL": "",
"facebookShareSubject": "Facebook Title in SaaSquatch Portal",
"facebookShareBody": "Facebook Share body in SaaSquatch Portal",
"twitterShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{shareLinks.twitterShareLink}}",
"smsShareBody": "Sign up for a {{companyName}} account and we both get ${{math programDetails.referredRewardDetails.credit ' / 100'}} free credit. Use this link {{share-link 'SMS'}}"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
},
"CONVERSION_WIDGET": {
"configuration": {
"themeMapping": "conversion-widget"
},
"content": {
"widgetCustomization": {
"widgetHeaderImage": "{{assets 'images/conversion.png'}}",
"widgetFont": "\"Helvetica Neue\",Helvetica,Arial,sans-serif",
"headerColor": "#444",
"heading": "You were Successfully Referred to {{companyName}}",
"headerDetails": "Use the Referral Code<br><span id=\"squatch-share-code\">{{referredBy.referredByUser.referralCode}}</span><br>at checkout to receive your referral discount",
"buttonCopy": "COPY CODE"
}
},
"cta": {
"configuration": {
"themeMapping": "cta-widget"
},
"content": {
"buttonSide": "right",
"buttonPosition": "bottom",
"buttonColor": "#4486E1",
"buttonWidth": 230,
"buttonText": "Refer Friends For Rewards"
}
}
}
},
"email": {
"REFERRER_REWARD_LIMIT_REACHED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "You have hit the reward limit!",
"themeMapping": "emails/referrer-reward-limit"
},
"content": {
"shareCTA": "However, you can keep referring new users and giving ${{programDetails.referrerRewardDetails.credit}} off with your code. - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/reward-limit-header.png'}}",
"headerContent": "#Reward Limit\nYou have successfully referred the maximum!",
"bodyContent": "Thanks for spreading the word about {{companyName}}. You've referred so many new people that you've earned the maximum amount of available credit."
}
},
"REFERRAL_CONVERTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "Congrats! You have earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}",
"themeMapping": "emails/referral-converted"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-converted-header.png'}}",
"headerContent": "#Congratulations\nYour friend has signed up for a {{companyName}} Account!",
"bodyContent": "You have now earned ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}. Refer more friends to save even more!"
}
},
"REFERRAL_STARTED": {
"configuration": {
"fromName": "{{companyName}}",
"fromAddress": "referral@mail.saasquat.ch",
"subject": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} helped you get one step closer to free credit with {{companyName}}!",
"themeMapping": "emails/referral-started"
},
"content": {
"shareCTA": "Keep sharing your code and earn more discounts - **{{user.referralCode}}**",
"hasShareLink": true,
"shareButtonHeader": "Refer and Earn ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of Credit",
"headerImageUrl": "{{assets 'images/email/referral-started-header.png'}}",
"headerContent": "#Good News!\nYour friend has signed up for a free account with {{companyName}}!",
"bodyContent": "{{stringEmptyHandler newReferral.referredUser.firstName onEmpty='A friend'}} is currently trying out {{companyName}}. As a thank you from us, if they become a paying user, you will automatically receive ${{math programDetails.referrerRewardDetails.credit ' / 100'}} of free credit with {{companyName}}"
}
}
}
}
statusCode integer |
The HTTP status code of the error |
---|---|
message string |
The human-readable description of what went wrong. Use this to help you debug. |
apiErrorCode string |
A machine error code |
validationErrors array |
A list of validation errors |
Example Response
HTTP 400
{
"message": "Your request failed to validate against the current variables schema.",
"statusCode": 400,
"apiErrorCode": "VALIDATION_FAILED",
"validationErrors": [
"object has missing required properties ([\"emailShareSubject\",\"facebookShareBody\",\"facebookShareSubject\",\"twitterShareBody\"])"
]
}
/api/v1/{tenant_alias}/theme/email/{email_type}/preview
Generates preview content for a themed email. If the sendTo
parameter is set this content will be sent to the provided email address otherwise the content will be returned in the response.
Tags: Theme Authentication: APIKey
Required |
tenant_alias string |
Tenant being referenced. E.g. |
---|---|---|
Required |
email_type string |
The type of email to be previwed. E.g. |
locale string |
The user locale, used for Internationalization. |
|
sendTo string |
If an email address is set in the |
Example Curl Request
curl -X POST https://app.referralsaasquatch.com/api/v1/{tenant_alias}/theme/email/{email_type}/preview \
-u :API_KEY \
-H "Content-Type: application/json" \
-d ''
Example Response
HTTP 200
"<html> <head> ... </head> <body> <h1>Congratulations Mike</h1> Your friend John has accepted your referral. You will now receive 10% off your next bill. ... </body> </body>"
Example Response
HTTP 204
/api/v1/{tenant_alias}/discount/{code}
This method lets you look up the details of a referral code and to ensure that it is valid. Works with PCT_DISCOUNT
/api/v1/{tenant_alias}/discount
This method associates a new account with their referrer. Use this method when
someone signs up for a paid account to set the coupon code used for them. For Stripe and Recurly do not use this call.
Instead during sign-up, just pass the coupon/referral code in your subcribe call. Works with PCT_DISCOUNT
/api/v1/{tenant_alias}/account/{accountId}/discount
This method information about an account's discount, if any, and what that discount would look like with a couponCode
applied. Works with PCT_DISCOUNT