public class Saasquatch
extends java.lang.Object
Information on our Android SDK can be found on our Android SDK Overview.
Information about authentication for our mobile SDK can be found on our Open Endpoints page.
Modifier and Type | Class and Description |
---|---|
static interface |
Saasquatch.TaskCompleteListener
An object with a callback method to be executed when a task finishes.
|
Modifier and Type | Method and Description |
---|---|
static void |
applyReferralCode(java.lang.String tenant,
java.lang.String userId,
java.lang.String accountId,
java.lang.String referralCode,
java.lang.String secret,
Context context,
Saasquatch.TaskCompleteListener listener)
Applies a referral code to a user's account.
|
static void |
getUser(java.lang.String tenant,
java.lang.String userId,
java.lang.String accountId,
java.lang.String secret,
Context context,
Saasquatch.TaskCompleteListener listener)
Gets a user's information from Referral SaaSquatch.
|
static void |
getUserByReferralCode(java.lang.String tenant,
java.lang.String referralCode,
java.lang.String secret,
Context context,
Saasquatch.TaskCompleteListener listener)
Get a user's information by their referral code.
|
static void |
listReferralsForTenant(java.lang.String tenant,
java.lang.String secret,
java.lang.String referringAccountID,
java.lang.String referringUserID,
java.lang.String dateReferralPaid,
java.lang.String dateReferralEnded,
java.lang.String referredModerationStatus,
java.lang.String referrerModerationStatus,
java.lang.String limit,
java.lang.String offset,
Context context,
Saasquatch.TaskCompleteListener listener)
Returns the list of referrals for the tenant with options for filtering.
|
static void |
lookupReferralCode(java.lang.String tenant,
java.lang.String referralCode,
java.lang.String secret,
Context context,
Saasquatch.TaskCompleteListener listener)
Checks if a referral code exists and retrieves information about the code and it's reward.
|
static void |
registerUser(java.lang.String tenant,
java.lang.String userId,
java.lang.String accountId,
JSONObject userInfo,
Saasquatch.TaskCompleteListener listener)
Registers a user with Referral SaaSquatch.
|
public static void registerUser(java.lang.String tenant, java.lang.String userId, java.lang.String accountId, JSONObject userInfo, Saasquatch.TaskCompleteListener listener) throws java.lang.IllegalArgumentException, java.lang.NullPointerException
secret
, userId
, and accountId
values and can include several others.
For a complete description see the Referral SaaSquatch REST API docs. Here is an example:
JSONObject userInfo = new JSONObject();
try {
userInfo.put("secret", "978-0440212560");
userInfo.put("id", "10001110101");
userInfo.put("accountId", "10001110101");
userInfo.put("email", "claire@lallybroch.com";
userInfo.put("firstName", "Claire");
userInfo.put("lastName", "Fraser");
userInfo.put("locale", "en_US");
userInfo.put("referralCode", "CLAIREFRASER");
} catch (JSONException e) {
Log.e("MyActivity", e.printStackTrace());
}
tenant
- Identifies which tenant to connect to. For your app, you will get two tenant aliases -- one for test mode and one for live mode. Test mode alias are prefixed with test_, for example `test_abhoihnqwet`.userId
- A user ID from your system (must be unique for every user). We use this to uniquely track users, and lets us handle accounts that are shared between users.accountId
- We use this ID to link a group of users together. See Shared vs Solo Accounts to see what you should use here.userInfo
- the JSON representation of the user's information.listener
- an object with an onComplete callback to be executed when the task finishes.java.lang.IllegalArgumentException
- if the tenant, userId, or accountId contain bad JSON.java.lang.NullPointerException
- if any parameter is null.Saasquatch.TaskCompleteListener
public static void getUser(java.lang.String tenant, java.lang.String userId, java.lang.String accountId, java.lang.String secret, Context context, Saasquatch.TaskCompleteListener listener) throws java.lang.NullPointerException
tenant
- Identifies which tenant to connect to. For your app, you will get two tenant aliases -- one for test mode and one for live mode. Test mode alias are prefixed with test_, for example `test_abhoihnqwet`.userId
- A user ID from your system (must be unique for every user). We use this to uniquely track users, and lets us handle accounts that are shared between users.accountId
- We use this ID to link a group of users together. See Shared vs Solo Accounts to see what you should use here.secret
- the secret for the user.context
- the current context.listener
- an object with an onComplete callback to be executed when the task finishes.java.lang.NullPointerException
- if any parameter is null.Saasquatch.TaskCompleteListener
public static void getUserByReferralCode(java.lang.String tenant, java.lang.String referralCode, java.lang.String secret, Context context, Saasquatch.TaskCompleteListener listener) throws java.lang.NullPointerException
tenant
- Identifies which tenant to connect to. For your app, you will get two tenant aliases -- one for test mode and one for live mode. Test mode alias are prefixed with test_, for example `test_abhoihnqwet`.referralCode
- the referral code of the user to be retrieved.secret
- the secret for the user.context
- the current context.listener
- an object with an onComplete callback to be executed when the task finishes.java.lang.NullPointerException
- if tenant, referralCode, context or listener is null.Saasquatch.TaskCompleteListener
public static void lookupReferralCode(java.lang.String tenant, java.lang.String referralCode, java.lang.String secret, Context context, Saasquatch.TaskCompleteListener listener) throws java.lang.NullPointerException
tenant
- Identifies which tenant to connect to. For your app, you will get two tenant aliases -- one for test mode and one for live mode. Test mode alias are prefixed with test_, for example `test_abhoihnqwet`.referralCode
- the referral code to be validated.secret
- the secret for the user.context
- the current context.listener
- an object with an onComplete callback to be executed when the task finishes.java.lang.NullPointerException
- if tenant, referralCode, context or listener is null.Saasquatch.TaskCompleteListener
public static void applyReferralCode(java.lang.String tenant, java.lang.String userId, java.lang.String accountId, java.lang.String referralCode, java.lang.String secret, Context context, Saasquatch.TaskCompleteListener listener) throws java.lang.NullPointerException
tenant
- Identifies which tenant to connect to. For your app, you will get two tenant aliases -- one for test mode and one for live mode. Test mode alias are prefixed with test_, for example `test_abhoihnqwet`.userId
- A user ID from your system (must be unique for every user). We use this to uniquely track users, and lets us handle accounts that are shared between users.accountId
- We use this ID to link a group of users together. See Shared vs Solo Accounts to see what you should use here.referralCode
- the referral code to be applied.secret
- the secret for the user.context
- the current context.listener
- an object with an onComplete callback to be executed when the task finishes.java.lang.NullPointerException
- if any parameter is nullSaasquatch.TaskCompleteListener
public static void listReferralsForTenant(java.lang.String tenant, java.lang.String secret, java.lang.String referringAccountID, java.lang.String referringUserID, java.lang.String dateReferralPaid, java.lang.String dateReferralEnded, java.lang.String referredModerationStatus, java.lang.String referrerModerationStatus, java.lang.String limit, java.lang.String offset, Context context, Saasquatch.TaskCompleteListener listener) throws java.lang.NullPointerException
tenant
- Identifies which tenant to connect to. For your app, you will get two tenant aliases -- one for test mode and one for live mode. Test mode alias are prefixed with test_ , for example `test_abhoihnqwet`.secret
- The secret for the user.referringAccountID
- When included, filters the results to only referrals that were referred by users with this account id.referringUserID
- When included, filters the results to only referrals that were referred by users with this user id.dateReferralPaid
- 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
- 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
- When included, filters the result to only include referred users with that status. Statuses that are accepted: PENDING, APPROVED or DENIED.referrerModerationStatus
- When included, filters the result to only include referrers with that status. Statuses that are accepted: PENDING, APPROVED or DENIED.limit
- A limit on the number of results returned. Defaults to 10.offset
- When included offsets the first result returns in the list. Use this to paginate through a long list of results. Defaults to 0.context
- The current contextlistener
- an object with an onComplete callback to be executed when the task finishes.java.lang.NullPointerException
- if the tenant, secret, context or listener is null.Saasquatch.TaskCompleteListener