No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
GeniusReferralsLib
gradle/wrapper
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Getting started

How to Build

The generated code uses a few Gradle dependencies e.g., Jackson, Volley, and Apache HttpClient. The reference to these dependencies is already added in the build.gradle file will be installed automatically. Therefore, you will need internet access for a successful build.

  • In order to open the client library in Android Studio click on Open an Existing Android Project.

Importing SDK into Android Studio - Step 1

  • Browse to locate the folder containing the source code. Select the location of the GeniusReferrals gradle project and click Ok.

Importing SDK into Android Studio - Step 2

  • Upon successful import, the project can be built by clicking on Build > Make Project or pressing Ctrl + F9.

Importing SDK into Android Studio - Step 3

How to Use

The following section explains how to use the GeniusReferrals library in a new project.

1. Starting a new project

For starting a new project, click on Create New Android Studio Project.

Add a new project in Android Studio - Step 1

Here, configure the new project by adding the name, domain and location of the sample application followed by clicking Next.

Create a new Android Studio Project - Step 2

Following this, select the Phone and Tablet ```` option as shown in the illustration below and click Next ```.

Create a new Android Studio Project - Step 3

In the following step, choose Empty Activity as the activity type and click Next.

Create a new Android Studio Project - Step 4

In this step, provide an Activity Name and Layout Name and click Finish. This would take you to the newly created project.

Create a new Android Studio Project - Step 4

2. Add reference of the library project

In order to add a dependency to this sample application, click on the android button shown in the project explorer on the left side as shown in the picture. Click on Project in the drop down that emerges.

Adding dependency to the client library - Step 1

Right click the sample application in the project explorer and click on New > Module as shown in the picture.

Adding dependency to the client library - Step 2

Choose Import Gradle Project and click Next.

Adding dependency to the client library - Step 3

Click on Finish which would take you back to the sample application with the refernced SDK.

Adding dependency to the client library - Step 4

In the following step naigate to the SampleApplication > app > build.gradle file and add the following line compile project(path: ':GeniusReferrals') to the dependencies section as shown in the illustration below.

Adding dependency to the client library - Step 5

Finally, press Sync Now in the warning visible as shown in the picture below.

Adding dependency to the client library - Step 6

3. Write sample code

Once the SampleApplication is created, a file named SampleApplication > app > src > main > java > MainActivity will be visible in the Project Explorer with an onCreate method. This is the entry point for the execution of the created project. Here, you can add code to initialize the client library and instantiate a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.

How to Test

The generated code and the server can be tested using automatically generated test cases. JUnit is used as the testing framework and test runner.

In Android Studio, for running the tests do the following:

  1. Right click on SampleApplication > GeniusReferralsLib > androidTest > java) from the project explorer.
  2. Select "Run All Tests" or use "Ctrl + Shift + F10" to run the Tests.

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
contentType The content type
xAuthToken Your API Token, you can get your token here https://www.geniusreferrals.com/en/settings/api-access

API client can be initialized as following. The appContext being passed is the Android application Context.

// Configuration parameters and credentials
String contentType = "application/json"; // The content type
String xAuthToken = "3b9d11374b602fb47b987dff90f1c5940a1f377f"; // Your API Token, you can get your token here https://www.geniusreferrals.com/en/settings/api-access

com.geniusreferrals.api.Configuration.initialize(appContext);
GeniusReferralsClient client = new GeniusReferralsClient(contentType, xAuthToken);

Class Reference

List of Controllers

Class: RootsController

Get singleton instance

The singleton instance of the RootsController class can be accessed from the API Client.

RootsController roots = client.getRoots();

Method: getRootAsync

The root of the API

void getRootAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
roots.getRootAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: AuthenticationsController

Get singleton instance

The singleton instance of the AuthenticationsController class can be accessed from the API Client.

AuthenticationsController authentications = client.getAuthentications();

Method: getAuthenticationAsync

Allow clients to test authentication on Genius Referrals platform.

void getAuthenticationAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
authentications.getAuthenticationAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: AdvocatesController

Get singleton instance

The singleton instance of the AdvocatesController class can be accessed from the API Client.

AdvocatesController advocates = client.getAdvocates();

Method: deleteAdvocateAsync

Delete an advocate

void deleteAdvocateAsync(
        final String accountSlug,
        final String advocateToken,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
// Invoking the API call with sample inputs
advocates.deleteAdvocateAsync(accountSlug, advocateToken, new APICallBack<void>() {
    public void onSuccess(HttpContext context, void response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: putAdvocateAsync

Update an advocate.

void putAdvocateAsync(
        final String accountSlug,
        final String advocateToken,
        final AdvocateForm advocateForm,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
advocateForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    String advocateToken = "advocate_token";
    AdvocateForm advocateForm = new AdvocateForm();
    // Invoking the API call with sample inputs
    advocates.putAdvocateAsync(accountSlug, advocateToken, advocateForm, new APICallBack<void>() {
        public void onSuccess(HttpContext context, void response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: postAdvocateAsync

Create a new advocate.

void postAdvocateAsync(
        final String accountSlug,
        final AdvocateForm advocateForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    AdvocateForm advocateForm = new AdvocateForm();
    // Invoking the API call with sample inputs
    advocates.postAdvocateAsync(accountSlug, advocateForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getAdvocateAsync

Get an advocate by a given token.

void getAdvocateAsync(
        final String accountSlug,
        final String advocateToken,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
// Invoking the API call with sample inputs
advocates.getAdvocateAsync(accountSlug, advocateToken, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deleteAdvocatesAsync

Delete all advocates

void deleteAdvocatesAsync(
        final String accountSlug,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier

Example Usage

String accountSlug = "account_slug";
// Invoking the API call with sample inputs
advocates.deleteAdvocatesAsync(accountSlug, new APICallBack<void>() {
    public void onSuccess(HttpContext context, void response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getAdvocatesAsync

Get the list of advocates

void getAdvocatesAsync(
        final String accountSlug,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: name, lastname, email, advocate_token, bonus_exchange_method_slug, campaign_slug, can_refer, is_referral, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: name, lastname, email, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort='last_name|first_name|-hire_date'

Example Usage

String accountSlug = "account_slug";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
advocates.getAdvocatesAsync(accountSlug, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: patchAdvocateAsync

Update partial elements of an advocate.

void patchAdvocateAsync(
        final String accountSlug,
        final String advocateToken,
        final List<AdvocatePatchForm> advocatePatchForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
advocatePatchForm Required Collection The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    String advocateToken = "advocate_token";
    List<AdvocatePatchForm> advocatePatchForm = new ArrayList<AdvocatePatchForm>();
    // Invoking the API call with sample inputs
    advocates.patchAdvocateAsync(accountSlug, advocateToken, advocatePatchForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getShareLinksAsync

Get the advocates share links. These are the links that advocates use to share your services online. Share links are wrapped per campaign and widget package.

void getShareLinksAsync(
        final String accountSlug,
        final String advocateToken,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
// Invoking the API call with sample inputs
advocates.getShareLinksAsync(accountSlug, advocateToken, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: putPaymentMethodAsync

Update a payment method.

void putPaymentMethodAsync(
        final String accountSlug,
        final String advocateToken,
        final int advocatePaymentMethodId,
        final PaymentMethodForm advocatePaymentMethodForm,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The advocate's token
advocateToken Required The advocate's token
advocatePaymentMethodId Required The payment method's identifier
advocatePaymentMethodForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    String advocateToken = "advocate_token";
    int advocatePaymentMethodId = 24;
    PaymentMethodForm advocatePaymentMethodForm = new PaymentMethodForm();
    // Invoking the API call with sample inputs
    advocates.putPaymentMethodAsync(accountSlug, advocateToken, advocatePaymentMethodId, advocatePaymentMethodForm, new APICallBack<void>() {
        public void onSuccess(HttpContext context, void response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getPaymentMethodAsync

Get an advocate's payment method

void getPaymentMethodAsync(
        final String accountSlug,
        final String advocateToken,
        final int advocatePaymentMethodId,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
advocatePaymentMethodId Required The payment method's identifier

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
int advocatePaymentMethodId = 24;
// Invoking the API call with sample inputs
advocates.getPaymentMethodAsync(accountSlug, advocateToken, advocatePaymentMethodId, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: postPaymentMethodAsync

Create a new payment method.

void postPaymentMethodAsync(
        final String accountSlug,
        final String advocateToken,
        final PaymentMethodForm advocatePaymentMethodForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
advocatePaymentMethodForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    String advocateToken = "advocate_token";
    PaymentMethodForm advocatePaymentMethodForm = new PaymentMethodForm();
    // Invoking the API call with sample inputs
    advocates.postPaymentMethodAsync(accountSlug, advocateToken, advocatePaymentMethodForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getBonusRedemptionMethodAsync

Get bonuses redemption method.

void getBonusRedemptionMethodAsync(
        final String bonusesRedemptionMethodSlug,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
bonusesRedemptionMethodSlug Required The bonus redemption method's identifier

Example Usage

String bonusesRedemptionMethodSlug = "bonuses_redemption_method_slug";
// Invoking the API call with sample inputs
advocates.getBonusRedemptionMethodAsync(bonusesRedemptionMethodSlug, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getBonusRedemptionMethodsAsync

Get bonuses redemption methods.

void getBonusRedemptionMethodsAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
advocates.getBonusRedemptionMethodsAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getCurrenciesAsync

Get currencies.

void getCurrenciesAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
advocates.getCurrenciesAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getCurrencyAsync

Get a currency.

void getCurrencyAsync(
        final String code,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
code Required The currency's code

Example Usage

String code = "code";
// Invoking the API call with sample inputs
advocates.getCurrencyAsync(code, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getPaymentMethodsAsync

Get the advocate's payment methods.

void getPaymentMethodsAsync(
        final String accountSlug,
        final String advocateToken,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: username, is_active. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: username, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort=last_name|first_name|-hire_date

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
advocates.getPaymentMethodsAsync(accountSlug, advocateToken, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: AccountsController

Get singleton instance

The singleton instance of the AccountsController class can be accessed from the API Client.

AccountsController accounts = client.getAccounts();

Method: getAccountAsync

Get an account by a given slug.

void getAccountAsync(
        final String accountSlug,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier

Example Usage

String accountSlug = "account_slug";
// Invoking the API call with sample inputs
accounts.getAccountAsync(accountSlug, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getAccountsAsync

Get the list of accounts.

void getAccountsAsync(
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: name. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: name, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort=last_name|first_name|-hire_date

Example Usage

Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
accounts.getAccountsAsync(page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: ReportsController

Get singleton instance

The singleton instance of the ReportsController class can be accessed from the API Client.

ReportsController reports = client.getReports();

Method: getReferralsSummaryPerOriginAsync

Get referrals summary per referral origin.

void getReferralsSummaryPerOriginAsync(
        final String advocateToken,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
advocateToken Required The advocate's token

Example Usage

String advocateToken = "advocate_token";
// Invoking the API call with sample inputs
reports.getReferralsSummaryPerOriginAsync(advocateToken, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getBonusesSummaryPerOriginAsync

Get bonuses summary per referral origin.

void getBonusesSummaryPerOriginAsync(
        final String advocateToken,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
advocateToken Required The advocate's token

Example Usage

String advocateToken = "advocate_token";
// Invoking the API call with sample inputs
reports.getBonusesSummaryPerOriginAsync(advocateToken, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getTopAdvocatesAsync

Get top 10 advocates.

void getTopAdvocatesAsync(
        final String accountSlug,
        final String campaignSlug,
        final Integer limit,
        final Date from,
        final Date to,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Optional The account identifier
campaignSlug Optional The campaign identifier
limit Optional DefaultValue Maximum number of results to return in the response. Default (10)
from Optional The datetime were the range of the search starts
to Optional The datetime were the range of the search stops

Example Usage

String accountSlug = "account_slug";
String campaignSlug = "campaign_slug";
Integer limit = 10;
Date from = new Date();
Date to = new Date();
// Invoking the API call with sample inputs
reports.getTopAdvocatesAsync(accountSlug, campaignSlug, limit, from, to, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getShareDailyParticipationAsync

Get share daily participation.

void getShareDailyParticipationAsync(
        final String accountSlug,
        final String campaignSlug,
        final String advocateToken,
        final Date from,
        final Date to,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Optional The account identifier
campaignSlug Optional The campaign identifier
advocateToken Optional The advocate's token
from Optional The datetime were the range of the search starts
to Optional The datetime were the range of the search stops

Example Usage

String accountSlug = "account_slug";
String campaignSlug = "campaign_slug";
String advocateToken = "advocate_token";
Date from = new Date();
Date to = new Date();
// Invoking the API call with sample inputs
reports.getShareDailyParticipationAsync(accountSlug, campaignSlug, advocateToken, from, to, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getReferralDailyParticipationAsync

Get referral daily participation.

void getReferralDailyParticipationAsync(
        final String accountSlug,
        final String campaignSlug,
        final String advocateToken,
        final Date from,
        final Date to,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Optional The account identifier
campaignSlug Optional The campaign identifier
advocateToken Optional The advocate's token
from Optional The datetime were the range of the search starts
to Optional The datetime were the range of the search stops

Example Usage

String accountSlug = "account_slug";
String campaignSlug = "campaign_slug";
String advocateToken = "advocate_token";
Date from = new Date();
Date to = new Date();
// Invoking the API call with sample inputs
reports.getReferralDailyParticipationAsync(accountSlug, campaignSlug, advocateToken, from, to, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getClickDailyParticipationAsync

Get click daily participation.

void getClickDailyParticipationAsync(
        final String accountSlug,
        final String campaignSlug,
        final String advocateToken,
        final Date from,
        final Date to,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Optional The account identifier
campaignSlug Optional The campaign identifier
advocateToken Optional The advocate's token
from Optional The datetime were the range of the search starts
to Optional The datetime were the range of the search stops

Example Usage

String accountSlug = "account_slug";
String campaignSlug = "campaign_slug";
String advocateToken = "advocate_token";
Date from = new Date();
Date to = new Date();
// Invoking the API call with sample inputs
reports.getClickDailyParticipationAsync(accountSlug, campaignSlug, advocateToken, from, to, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getBonusesDailyGivenAsync

Get bonuses daily given.

void getBonusesDailyGivenAsync(
        final String accountSlug,
        final String campaignSlug,
        final String advocateToken,
        final Date from,
        final Date to,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Optional The account identifier
campaignSlug Optional The campaign identifier
advocateToken Optional The advocate identifier
from Optional The datetime were the range of the search starts
to Optional The datetime were the range of the search stops

Example Usage

String accountSlug = "account_slug";
String campaignSlug = "campaign_slug";
String advocateToken = "advocate_token";
Date from = new Date();
Date to = new Date();
// Invoking the API call with sample inputs
reports.getBonusesDailyGivenAsync(accountSlug, campaignSlug, advocateToken, from, to, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: ReferralsController

Get singleton instance

The singleton instance of the ReferralsController class can be accessed from the API Client.

ReferralsController referrals = client.getReferrals();

Method: getReferralOriginAsync

Get a referral origin by a given slug.

void getReferralOriginAsync(
        final String referralOriginSlug,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
referralOriginSlug Required The referral origin identifier

Example Usage

String referralOriginSlug = "referral_origin_slug";
// Invoking the API call with sample inputs
referrals.getReferralOriginAsync(referralOriginSlug, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getReferralOriginsAsync

Get referral origins. This is needed when creating (POST) a new referral, as referral_origin_slug refers to one of this origins.

void getReferralOriginsAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
referrals.getReferralOriginsAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getReferralAsync

Get a referral by a given id.

void getReferralAsync(
        final String accountSlug,
        final String advocateToken,
        final String referralId,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
referralId Required The referral id

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
String referralId = "referral_id";
// Invoking the API call with sample inputs
referrals.getReferralAsync(accountSlug, advocateToken, referralId, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deleteReferralAsync

Delete a referral.

void deleteReferralAsync(
        final String accountSlug,
        final String advocateToken,
        final String referralId,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
referralId Required The referral identifier

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
String referralId = "referral_id";
// Invoking the API call with sample inputs
referrals.deleteReferralAsync(accountSlug, advocateToken, referralId, new APICallBack<void>() {
    public void onSuccess(HttpContext context, void response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: postReferralAsync

Create a new referral.

void postReferralAsync(
        final String accountSlug,
        final String advocateToken,
        final ReferralForm referralForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
referralForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    String advocateToken = "advocate_token";
    ReferralForm referralForm = new ReferralForm();
    // Invoking the API call with sample inputs
    referrals.postReferralAsync(accountSlug, advocateToken, referralForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: putReferralAsync

Update a referral.

void putReferralAsync(
        final String accountSlug,
        final String advocateToken,
        final String referralId,
        final ReferralForm referralForm,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
referralId Required The referral id
referralForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    String advocateToken = "advocate_token";
    String referralId = "referral_id";
    ReferralForm referralForm = new ReferralForm();
    // Invoking the API call with sample inputs
    referrals.putReferralAsync(accountSlug, advocateToken, referralId, referralForm, new APICallBack<void>() {
        public void onSuccess(HttpContext context, void response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getReferralsAsync

Get the list of referrals for a given advocate.

void getReferralsAsync(
        final String accountSlug,
        final String advocateToken,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The advocate's token
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: url, referral_origin_slug, created. Use the following delimiters to build your filters params. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort='last_name|first_name|-hire_date'

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
referrals.getReferralsAsync(accountSlug, advocateToken, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: RedemptionRequestsController

Get singleton instance

The singleton instance of the RedemptionRequestsController class can be accessed from the API Client.

RedemptionRequestsController redemptionRequests = client.getRedemptionRequests();

Method: getRedemptionRequestStatusAsync

Get a redemption request status.

void getRedemptionRequestStatusAsync(
        final String redemptionRequestStatusSlug,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
redemptionRequestStatusSlug Required The redemption request status identifier

Example Usage

String redemptionRequestStatusSlug = "redemption_request_status_slug";
// Invoking the API call with sample inputs
redemptionRequests.getRedemptionRequestStatusAsync(redemptionRequestStatusSlug, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getRedemptionRequestStatusesAsync

Get redemption request statuses.

void getRedemptionRequestStatusesAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
redemptionRequests.getRedemptionRequestStatusesAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getRedemptionRequestActionAsync

Get a redemption request action.

void getRedemptionRequestActionAsync(
        final String redemptionRequestActionSlug,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
redemptionRequestActionSlug Required The redemption request action identifier

Example Usage

String redemptionRequestActionSlug = "redemption_request_action_slug";
// Invoking the API call with sample inputs
redemptionRequests.getRedemptionRequestActionAsync(redemptionRequestActionSlug, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getRedemptionRequestActionsAsync

Get redemption request actions.

void getRedemptionRequestActionsAsync(final APICallBack<DynamicResponse> callBack)

Example Usage

// Invoking the API call with sample inputs
redemptionRequests.getRedemptionRequestActionsAsync(new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: patchRedemptionRequestAsync

Redeem a redemption request. After the redemption request is created it needs to be redeemed. This will deduct the amount of the advocate unclaimed balance and move the request to the completed state.

void patchRedemptionRequestAsync(
        final String accountSlug,
        final int redemptionRequestId,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
redemptionRequestId Required The redemption request id

Example Usage

String accountSlug = "account_slug";
int redemptionRequestId = 24;
// Invoking the API call with sample inputs
redemptionRequests.patchRedemptionRequestAsync(accountSlug, redemptionRequestId, new APICallBack<void>() {
    public void onSuccess(HttpContext context, void response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: postRedemptionRequestAsync

Create a redemption request.

void postRedemptionRequestAsync(
        final String accountSlug,
        final RedemptionRequestForm redemptionRequestForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
redemptionRequestForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    RedemptionRequestForm redemptionRequestForm = new RedemptionRequestForm();
    // Invoking the API call with sample inputs
    redemptionRequests.postRedemptionRequestAsync(accountSlug, redemptionRequestForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getRedemptionRequestAsync

Get a redemption request by a given id.

void getRedemptionRequestAsync(
        final String accountSlug,
        final String redemptionRequestId,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
redemptionRequestId Required The redemption request identifier

Example Usage

String accountSlug = "account_slug";
String redemptionRequestId = "redemption_request_id";
// Invoking the API call with sample inputs
redemptionRequests.getRedemptionRequestAsync(accountSlug, redemptionRequestId, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getRedemptionRequestsAsync

Get the list of redemption requests.

void getRedemptionRequestsAsync(
        final String accountSlug,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: redemption_request_id, name, lastname, email, request_status_slug, request_action_slug, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: name, lastname, email, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort='last_name|first_name|-hire_date'

Example Usage

String accountSlug = "account_slug";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
redemptionRequests.getRedemptionRequestsAsync(accountSlug, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: BonusesController

Get singleton instance

The singleton instance of the BonusesController class can be accessed from the API Client.

BonusesController bonuses = client.getBonuses();

Method: getBonusesAsync

Get the list of bonuses for a given account.

void getBonusesAsync(
        final String accountSlug,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: name, lastname, email, campaign_slug, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: name, lastname, email, created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort='last_name|first_name|-hire_date'

Example Usage

String accountSlug = "account_slug";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
bonuses.getBonusesAsync(accountSlug, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: postBonusAsync

Make an attempt to give a bonus for to the advocate's referrer. The system processes the given advocate (referral) and creates a bonus for the advocate's referrer if is needed. All restrictions set on the campaigns for this account will be check out before giving the bonus to the advocate's referrer.

void postBonusAsync(
        final String accountSlug,
        final BonusesForm bonusesForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
bonusesForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    BonusesForm bonusesForm = new BonusesForm();
    // Invoking the API call with sample inputs
    bonuses.postBonusAsync(accountSlug, bonusesForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getBonusCheckupAsync

Check if there is a bonus to be given to the advocate. Allows the clients to check if there is a bonus to be given, it simulates the behaivor of a POST request to /accounts/{account_slug}/bonuses resource. This resource is idempotent.

void getBonusCheckupAsync(
        final String accountSlug,
        final String advocateToken,
        final String reference,
        final double paymentAmount,
        final APICallBack<InputStream> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
advocateToken Required The referral's token. Usually the one that completed the purchase, or trigger an event.
reference Required The reference number for this request. Usually the order_id, payment_id, or timestamp.
paymentAmount Required The payment amount the referrals has made. Required for a percentage based campaign.

Example Usage

String accountSlug = "account_slug";
String advocateToken = "advocate_token";
String reference = "reference";
double paymentAmount = 24.4691052588025;
// Invoking the API call with sample inputs
bonuses.getBonusCheckupAsync(accountSlug, advocateToken, reference, paymentAmount, new APICallBack<InputStream>() {
    public void onSuccess(HttpContext context, InputStream response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: postForceBonusAsync

Force the system to give a bonus to an advocate. The system will not take into account the restriccions specified on the campaigns.

void postForceBonusAsync(
        final String accountSlug,
        final ForceBonusesForm bonusForm,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
bonusForm Required The body of the request

Example Usage

try {
    String accountSlug = "account_slug";
    ForceBonusesForm bonusForm = new ForceBonusesForm();
    // Invoking the API call with sample inputs
    bonuses.postForceBonusAsync(accountSlug, bonusForm, new APICallBack<DynamicResponse>() {
        public void onSuccess(HttpContext context, DynamicResponse response) {
            // TODO success callback handler
        }
        public void onFailure(HttpContext context, Throwable error) {
            // TODO failure callback handler
        }
    });
} catch(JsonProcessingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Method: getBonusTraceAsync

Get a bonus request trace.

void getBonusTraceAsync(
        final String accountSlug,
        final int traceId,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
traceId Required The trace id

Example Usage

String accountSlug = "account_slug";
int traceId = 24;
// Invoking the API call with sample inputs
bonuses.getBonusTraceAsync(accountSlug, traceId, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: deleteBonusAsync

Delete a bonus

void deleteBonusAsync(
        final String accountSlug,
        final int bonusId,
        final APICallBack<Object> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
bonusId Required The bonus id

Example Usage

String accountSlug = "account_slug";
int bonusId = 24;
// Invoking the API call with sample inputs
bonuses.deleteBonusAsync(accountSlug, bonusId, new APICallBack<void>() {
    public void onSuccess(HttpContext context, void response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getBonusAsync

Get a bonus by a given id.

void getBonusAsync(
        final String accountSlug,
        final int bonusId,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
bonusId Required The bonus id

Example Usage

String accountSlug = "account_slug";
int bonusId = 24;
// Invoking the API call with sample inputs
bonuses.getBonusAsync(accountSlug, bonusId, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getBonusTracesAsync

Get the list of bonuses traces (audit trail). Every time the system tries to give a bonus the an advocate a new trace is created.

void getBonusTracesAsync(
        final String accountSlug,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: reference, result, bonus_amount, advocate_token, advocate_referrer_token, campaign_slug, from, to, created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: created. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort='last_name|first_name|-hire_date'

Example Usage

String accountSlug = "account_slug";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
bonuses.getBonusTracesAsync(accountSlug, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers

Class: CampaignsController

Get singleton instance

The singleton instance of the CampaignsController class can be accessed from the API Client.

CampaignsController campaigns = client.getCampaigns();

Method: getCampaignAsync

Get a campaign by a given slug.

void getCampaignAsync(
        final String accountSlug,
        final String campaignSlug,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
campaignSlug Required The campaign identifier

Example Usage

String accountSlug = "account_slug";
String campaignSlug = "campaign_slug";
// Invoking the API call with sample inputs
campaigns.getCampaignAsync(accountSlug, campaignSlug, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Method: getCampaignsAsync

Get the list of campaings for a given account.

void getCampaignsAsync(
        final String accountSlug,
        final Integer page,
        final Integer limit,
        final String filter,
        final String sort,
        final APICallBack<DynamicResponse> callBack)

Parameters

Parameter Tags Description
accountSlug Required The account identifier
page Optional DefaultValue Page number, e.g. 1 would start at the first result, and 10 would start at the tenth result.
limit Optional DefaultValue Maximum number of results to return in the response. Default (10), threshold (100)
filter Optional Allowed fields: name, description, start_date, end_date, is_active (true|false), created. Use the following delimiters to build your filters params. The vertical bar ('|') to separate individual filter phrases and a double colon ('::') to separate the names and values. The delimiter of the double colon (':') separates the property name from the comparison value, enabling the comparison value to contain spaces. Example: www.example.com/users?filter='name::todd|city::denver|title::grand poobah'
sort Optional Allowed fields: campaign_slug, created, start_date, end_date, is_active. Use sort query-string parameter that contains a delimited set of property names. For each property name, sort in ascending order, and for each property prefixed with a dash ('-') sort in descending order. Separate each property name with a vertical bar ('|'), which is consistent with the separation of the name|value pairs in filtering, above. For example, if we want to retrieve users in order of their last name (ascending), first name (ascending) and hire date (descending), the request might look like this www.example.com/users?sort='last_name|first_name|-hire_date'

Example Usage

String accountSlug = "account_slug";
Integer page = 1;
Integer limit = 10;
String filter = "filter";
String sort = "sort";
// Invoking the API call with sample inputs
campaigns.getCampaignsAsync(accountSlug, page, limit, filter, sort, new APICallBack<DynamicResponse>() {
    public void onSuccess(HttpContext context, DynamicResponse response) {
        // TODO success callback handler
    }
    public void onFailure(HttpContext context, Throwable error) {
        // TODO failure callback handler
    }
});

Back to List of Controllers