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.
GeniusReferrals.xcodeproj
GeniusReferrals
GeniusReferrals.podspec
LICENSE
PodFile
README.md

README.md

Getting started

How to Build

The generated code has dependencies over external libraries like UniRest. These dependencies are defined in the PodFile file that comes with the SDK. To resolve these dependencies, we use the Cocoapods package manager. Visit https://guides.cocoapods.org/using/getting-started.html to setup Cocoapods on your system. Open command prompt and type pod --version. This should display the current version of Cocoapods installed if the installation was successful.

Using command line, navigate to the directory containing the generated files (including PodFile) for the SDK. Run the command pod install. This should install all the required dependencies and create the pods directory in your project directory.

Installing dependencies using Cocoapods

Open the project workspace using the (GeniusReferrals.xcworkspace) file. Invoke the build process using Command(⌘)+B shortcut key or using the Build menu as shown below.

Building SDK using Xcode

How to Use

The generated code is a Cocoa Touch Static Library which can be used in any iOS project. The support for these generated libraries go all the way back to iOS 6.

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

1. Starting a new project

To start a new project, left-click on the Create a new Xcode project. Create Test Project - Step 1

Next, choose Single View Application and click Next. Create Test Project - Step 2

Provide Test-Project as the product name click Next. Create Test Project - Step 3

Choose the desired location of your project folder and click Create. Create Test Project - Step 4

2. Adding the static library dependency

To add this dependency open a terminal and navigate to your project folder. Next, input pod init and press enter. Add dependency - Step 1

Next, open the newly created PodFile in your favourite text editor. Add the following line : pod 'GeniusReferrals', :path => 'Vendor/GeniusReferrals' Add dependency - Step 2

Execute pod install from terminal to install the dependecy in your project. This would add the dependency to the newly created test project. Add dependency - Step 3

How to Test

Unit tests in this SDK can be run using Xcode.

First build the SDK as shown in the steps above and naivgate to the project directory and open the GeniusReferrals.xcworkspace file.

Go to the test explorer in Xcode as shown in the picture below and click on run tests from the menu. Run 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

Configuration variables can be set as following.

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

Class Reference

List of Controllers

Class: roots

Get singleton instance

Roots* roots = [[Roots alloc]init] ;

Method: getRootWithCompletionBlock

The root of the API

function getRootWithCompletionBlock:(CompletedGetRoot) onCompleted()

Example Usage

    [self.roots getRootWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: authentications

Get singleton instance

Authentications* authentications = [[Authentications alloc]init] ;

Method: getAuthenticationWithCompletionBlock

Allow clients to test authentication on Genius Referrals platform.

function getAuthenticationWithCompletionBlock:(CompletedGetAuthentication) onCompleted()

Example Usage

    [self.authentications getAuthenticationWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: advocates

Get singleton instance

Advocates* advocates = [[Advocates alloc]init] ;

Method: deleteAdvocateAsyncWithAccountSlug

Delete an advocate

function deleteAdvocateAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                completionBlock:(CompletedDeleteAdvocate) onCompleted(accountSlug advocateToken : advocateToken)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";

    [self.advocates deleteAdvocateAsyncWithAccountSlug: accountSlug advocateToken : advocateToken  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: putAdvocateAsyncWithAccountSlug

Update an advocate.

function putAdvocateAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                advocateForm:(AdvocateForm*) advocateForm
                completionBlock:(CompletedPutAdvocate) onCompleted(accountSlug advocateToken : advocateToken advocateForm : advocateForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    AdvocateForm* advocateForm = [[AdvocateForm alloc]init];

    [self.advocates putAdvocateAsyncWithAccountSlug: accountSlug advocateToken : advocateToken advocateForm : advocateForm  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: postAdvocateAsyncWithAccountSlug

Create a new advocate.

function postAdvocateAsyncWithAccountSlug:(NSString*) accountSlug
                advocateForm:(AdvocateForm*) advocateForm
                completionBlock:(CompletedPostAdvocate) onCompleted(accountSlug advocateForm : advocateForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    AdvocateForm* advocateForm = [[AdvocateForm alloc]init];

    [self.advocates postAdvocateAsyncWithAccountSlug: accountSlug advocateForm : advocateForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getAdvocateAsyncWithAccountSlug

Get an advocate by a given token.

function getAdvocateAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                completionBlock:(CompletedGetAdvocate) onCompleted(accountSlug advocateToken : advocateToken)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";

    [self.advocates getAdvocateAsyncWithAccountSlug: accountSlug advocateToken : advocateToken  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: deleteAdvocatesAsyncWithAccountSlug

Delete all advocates

function deleteAdvocatesAsyncWithAccountSlug:(NSString*) accountSlug
                completionBlock:(CompletedDeleteAdvocates) onCompleted(accountSlug)

Parameters

Parameter Tags Description
accountSlug Required The account identifier

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";

    [self.advocates deleteAdvocatesAsyncWithAccountSlug: accountSlug  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: getAdvocatesAsyncWithAccountSlug

Get the list of advocates

function getAdvocatesAsyncWithAccountSlug:(NSString*) accountSlug
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetAdvocates) onCompleted(accountSlug page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSNumber* page = 252;
    NSNumber* limit = 252;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.advocates getAdvocatesAsyncWithAccountSlug: accountSlug page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: patchAdvocateAsyncWithAccountSlug

Update partial elements of an advocate.

function patchAdvocateAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                advocatePatchForm:(NSArray<AdvocatePatchForm> *) advocatePatchForm
                completionBlock:(CompletedPatchAdvocate) onCompleted(accountSlug advocateToken : advocateToken advocatePatchForm : advocatePatchForm)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSArray<AdvocatePatchForm> * advocatePatchForm = (NSArray<AdvocatePatchForm>*) [AdvocatePatchForm arrayOfModelsFromDictionaries:
                [APIHelper jsonDeserializeArray: @"nil"] error: nil];

    [self.advocates patchAdvocateAsyncWithAccountSlug: accountSlug advocateToken : advocateToken advocatePatchForm : advocatePatchForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getShareLinksAsyncWithAccountSlug

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.

function getShareLinksAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                completionBlock:(CompletedGetShareLinks) onCompleted(accountSlug advocateToken : advocateToken)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";

    [self.advocates getShareLinksAsyncWithAccountSlug: accountSlug advocateToken : advocateToken  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: putPaymentMethodAsyncWithAccountSlug

Update a payment method.

function putPaymentMethodAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                advocatePaymentMethodId:(int) advocatePaymentMethodId
                advocatePaymentMethodForm:(PaymentMethodForm*) advocatePaymentMethodForm
                completionBlock:(CompletedPutPaymentMethod) onCompleted(accountSlug advocateToken : advocateToken advocatePaymentMethodId : advocatePaymentMethodId advocatePaymentMethodForm : advocatePaymentMethodForm)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    int advocatePaymentMethodId = 252;
    PaymentMethodForm* advocatePaymentMethodForm = [[PaymentMethodForm alloc]init];

    [self.advocates putPaymentMethodAsyncWithAccountSlug: accountSlug advocateToken : advocateToken advocatePaymentMethodId : advocatePaymentMethodId advocatePaymentMethodForm : advocatePaymentMethodForm  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: getPaymentMethodAsyncWithAccountSlug

Get an advocate's payment method

function getPaymentMethodAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                advocatePaymentMethodId:(int) advocatePaymentMethodId
                completionBlock:(CompletedGetPaymentMethod) onCompleted(accountSlug advocateToken : advocateToken advocatePaymentMethodId : advocatePaymentMethodId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    int advocatePaymentMethodId = 252;

    [self.advocates getPaymentMethodAsyncWithAccountSlug: accountSlug advocateToken : advocateToken advocatePaymentMethodId : advocatePaymentMethodId  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: postPaymentMethodAsyncWithAccountSlug

Create a new payment method.

function postPaymentMethodAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                advocatePaymentMethodForm:(PaymentMethodForm*) advocatePaymentMethodForm
                completionBlock:(CompletedPostPaymentMethod) onCompleted(accountSlug advocateToken : advocateToken advocatePaymentMethodForm : advocatePaymentMethodForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    PaymentMethodForm* advocatePaymentMethodForm = [[PaymentMethodForm alloc]init];

    [self.advocates postPaymentMethodAsyncWithAccountSlug: accountSlug advocateToken : advocateToken advocatePaymentMethodForm : advocatePaymentMethodForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusRedemptionMethodAsyncWithBonusesRedemptionMethodSlug

Get bonuses redemption method.

function getBonusRedemptionMethodAsyncWithBonusesRedemptionMethodSlug:(NSString*) bonusesRedemptionMethodSlug
                completionBlock:(CompletedGetBonusRedemptionMethod) onCompleted(bonusesRedemptionMethodSlug)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* bonusesRedemptionMethodSlug = @"bonuses_redemption_method_slug";

    [self.advocates getBonusRedemptionMethodAsyncWithBonusesRedemptionMethodSlug: bonusesRedemptionMethodSlug  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusRedemptionMethodsWithCompletionBlock

Get bonuses redemption methods.

function getBonusRedemptionMethodsWithCompletionBlock:(CompletedGetBonusRedemptionMethods) onCompleted()

Example Usage

    [self.advocates getBonusRedemptionMethodsWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getCurrenciesWithCompletionBlock

Get currencies.

function getCurrenciesWithCompletionBlock:(CompletedGetCurrencies) onCompleted()

Example Usage

    [self.advocates getCurrenciesWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getCurrencyAsyncWithCode

Get a currency.

function getCurrencyAsyncWithCode:(NSString*) code
                completionBlock:(CompletedGetCurrency) onCompleted(code)

Parameters

Parameter Tags Description
code Required The currency's code

Example Usage

    // Parameters for the API call
    NSString* code = @"code";

    [self.advocates getCurrencyAsyncWithCode: code  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getPaymentMethodsAsyncWithAccountSlug

Get the advocate's payment methods.

function getPaymentMethodsAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetPaymentMethods) onCompleted(accountSlug advocateToken : advocateToken page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSNumber* page = 252;
    NSNumber* limit = 252;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.advocates getPaymentMethodsAsyncWithAccountSlug: accountSlug advocateToken : advocateToken page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: accounts

Get singleton instance

Accounts* accounts = [[Accounts alloc]init] ;

Method: getAccountAsyncWithAccountSlug

Get an account by a given slug.

function getAccountAsyncWithAccountSlug:(NSString*) accountSlug
                completionBlock:(CompletedGetAccount) onCompleted(accountSlug)

Parameters

Parameter Tags Description
accountSlug Required The account identifier

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";

    [self.accounts getAccountAsyncWithAccountSlug: accountSlug  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getAccountsAsyncWithPage

Get the list of accounts.

function getAccountsAsyncWithPage:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetAccounts) onCompleted(page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSNumber* page = 252;
    NSNumber* limit = 252;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.accounts getAccountsAsyncWithPage: page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: reports

Get singleton instance

Reports* reports = [[Reports alloc]init] ;

Method: getReferralsSummaryPerOriginAsyncWithAdvocateToken

Get referrals summary per referral origin.

function getReferralsSummaryPerOriginAsyncWithAdvocateToken:(NSString*) advocateToken
                completionBlock:(CompletedGetReferralsSummaryPerOrigin) onCompleted(advocateToken)

Parameters

Parameter Tags Description
advocateToken Required The advocate's token

Example Usage

    // Parameters for the API call
    NSString* advocateToken = @"advocate_token";

    [self.reports getReferralsSummaryPerOriginAsyncWithAdvocateToken: advocateToken  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusesSummaryPerOriginAsyncWithAdvocateToken

Get bonuses summary per referral origin.

function getBonusesSummaryPerOriginAsyncWithAdvocateToken:(NSString*) advocateToken
                completionBlock:(CompletedGetBonusesSummaryPerOrigin) onCompleted(advocateToken)

Parameters

Parameter Tags Description
advocateToken Required The advocate's token

Example Usage

    // Parameters for the API call
    NSString* advocateToken = @"advocate_token";

    [self.reports getBonusesSummaryPerOriginAsyncWithAdvocateToken: advocateToken  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getTopAdvocatesAsyncWithAccountSlug

Get top 10 advocates.

function getTopAdvocatesAsyncWithAccountSlug:(NSString*) accountSlug
                campaignSlug:(NSString*) campaignSlug
                limit:(NSNumber*) limit
                from:(NSDate*) from
                to:(NSDate*) to
                completionBlock:(CompletedGetTopAdvocates) onCompleted(accountSlug campaignSlug : campaignSlug limit : limit from : from to : to)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* campaignSlug = @"campaign_slug";
    NSNumber* limit = 88;
    NSDate* from = [NSDate date];
    NSDate* to = [NSDate date];

    [self.reports getTopAdvocatesAsyncWithAccountSlug: accountSlug campaignSlug : campaignSlug limit : limit from : from to : to  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getShareDailyParticipationAsyncWithAccountSlug

Get share daily participation.

function getShareDailyParticipationAsyncWithAccountSlug:(NSString*) accountSlug
                campaignSlug:(NSString*) campaignSlug
                advocateToken:(NSString*) advocateToken
                from:(NSDate*) from
                to:(NSDate*) to
                completionBlock:(CompletedGetShareDailyParticipation) onCompleted(accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* campaignSlug = @"campaign_slug";
    NSString* advocateToken = @"advocate_token";
    NSDate* from = [NSDate date];
    NSDate* to = [NSDate date];

    [self.reports getShareDailyParticipationAsyncWithAccountSlug: accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getReferralDailyParticipationAsyncWithAccountSlug

Get referral daily participation.

function getReferralDailyParticipationAsyncWithAccountSlug:(NSString*) accountSlug
                campaignSlug:(NSString*) campaignSlug
                advocateToken:(NSString*) advocateToken
                from:(NSDate*) from
                to:(NSDate*) to
                completionBlock:(CompletedGetReferralDailyParticipation) onCompleted(accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* campaignSlug = @"campaign_slug";
    NSString* advocateToken = @"advocate_token";
    NSDate* from = [NSDate date];
    NSDate* to = [NSDate date];

    [self.reports getReferralDailyParticipationAsyncWithAccountSlug: accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getClickDailyParticipationAsyncWithAccountSlug

Get click daily participation.

function getClickDailyParticipationAsyncWithAccountSlug:(NSString*) accountSlug
                campaignSlug:(NSString*) campaignSlug
                advocateToken:(NSString*) advocateToken
                from:(NSDate*) from
                to:(NSDate*) to
                completionBlock:(CompletedGetClickDailyParticipation) onCompleted(accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* campaignSlug = @"campaign_slug";
    NSString* advocateToken = @"advocate_token";
    NSDate* from = [NSDate date];
    NSDate* to = [NSDate date];

    [self.reports getClickDailyParticipationAsyncWithAccountSlug: accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusesDailyGivenAsyncWithAccountSlug

Get bonuses daily given.

function getBonusesDailyGivenAsyncWithAccountSlug:(NSString*) accountSlug
                campaignSlug:(NSString*) campaignSlug
                advocateToken:(NSString*) advocateToken
                from:(NSDate*) from
                to:(NSDate*) to
                completionBlock:(CompletedGetBonusesDailyGiven) onCompleted(accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* campaignSlug = @"campaign_slug";
    NSString* advocateToken = @"advocate_token";
    NSDate* from = [NSDate date];
    NSDate* to = [NSDate date];

    [self.reports getBonusesDailyGivenAsyncWithAccountSlug: accountSlug campaignSlug : campaignSlug advocateToken : advocateToken from : from to : to  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: referrals

Get singleton instance

Referrals* referrals = [[Referrals alloc]init] ;

Method: getReferralOriginAsyncWithReferralOriginSlug

Get a referral origin by a given slug.

function getReferralOriginAsyncWithReferralOriginSlug:(NSString*) referralOriginSlug
                completionBlock:(CompletedGetReferralOrigin) onCompleted(referralOriginSlug)

Parameters

Parameter Tags Description
referralOriginSlug Required The referral origin identifier

Example Usage

    // Parameters for the API call
    NSString* referralOriginSlug = @"referral_origin_slug";

    [self.referrals getReferralOriginAsyncWithReferralOriginSlug: referralOriginSlug  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getReferralOriginsWithCompletionBlock

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

function getReferralOriginsWithCompletionBlock:(CompletedGetReferralOrigins) onCompleted()

Example Usage

    [self.referrals getReferralOriginsWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getReferralAsyncWithAccountSlug

Get a referral by a given id.

function getReferralAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                referralId:(NSString*) referralId
                completionBlock:(CompletedGetReferral) onCompleted(accountSlug advocateToken : advocateToken referralId : referralId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSString* referralId = @"referral_id";

    [self.referrals getReferralAsyncWithAccountSlug: accountSlug advocateToken : advocateToken referralId : referralId  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: deleteReferralAsyncWithAccountSlug

Delete a referral.

function deleteReferralAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                referralId:(NSString*) referralId
                completionBlock:(CompletedDeleteReferral) onCompleted(accountSlug advocateToken : advocateToken referralId : referralId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSString* referralId = @"referral_id";

    [self.referrals deleteReferralAsyncWithAccountSlug: accountSlug advocateToken : advocateToken referralId : referralId  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: postReferralAsyncWithAccountSlug

Create a new referral.

function postReferralAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                referralForm:(ReferralForm*) referralForm
                completionBlock:(CompletedPostReferral) onCompleted(accountSlug advocateToken : advocateToken referralForm : referralForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    ReferralForm* referralForm = [[ReferralForm alloc]init];

    [self.referrals postReferralAsyncWithAccountSlug: accountSlug advocateToken : advocateToken referralForm : referralForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: putReferralAsyncWithAccountSlug

Update a referral.

function putReferralAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                referralId:(NSString*) referralId
                referralForm:(ReferralForm*) referralForm
                completionBlock:(CompletedPutReferral) onCompleted(accountSlug advocateToken : advocateToken referralId : referralId referralForm : referralForm)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSString* referralId = @"referral_id";
    ReferralForm* referralForm = [[ReferralForm alloc]init];

    [self.referrals putReferralAsyncWithAccountSlug: accountSlug advocateToken : advocateToken referralId : referralId referralForm : referralForm  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: getReferralsAsyncWithAccountSlug

Get the list of referrals for a given advocate.

function getReferralsAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetReferrals) onCompleted(accountSlug advocateToken : advocateToken page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSNumber* page = 88;
    NSNumber* limit = 88;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.referrals getReferralsAsyncWithAccountSlug: accountSlug advocateToken : advocateToken page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: redemptionrequests

Get singleton instance

RedemptionRequests* redemptionRequests = [[RedemptionRequests alloc]init] ;

Method: getRedemptionRequestStatusAsyncWithRedemptionRequestStatusSlug

Get a redemption request status.

function getRedemptionRequestStatusAsyncWithRedemptionRequestStatusSlug:(NSString*) redemptionRequestStatusSlug
                completionBlock:(CompletedGetRedemptionRequestStatus) onCompleted(redemptionRequestStatusSlug)

Parameters

Parameter Tags Description
redemptionRequestStatusSlug Required The redemption request status identifier

Example Usage

    // Parameters for the API call
    NSString* redemptionRequestStatusSlug = @"redemption_request_status_slug";

    [self.redemptionRequests getRedemptionRequestStatusAsyncWithRedemptionRequestStatusSlug: redemptionRequestStatusSlug  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getRedemptionRequestStatusesWithCompletionBlock

Get redemption request statuses.

function getRedemptionRequestStatusesWithCompletionBlock:(CompletedGetRedemptionRequestStatuses) onCompleted()

Example Usage

    [self.redemptionRequests getRedemptionRequestStatusesWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getRedemptionRequestActionAsyncWithRedemptionRequestActionSlug

Get a redemption request action.

function getRedemptionRequestActionAsyncWithRedemptionRequestActionSlug:(NSString*) redemptionRequestActionSlug
                completionBlock:(CompletedGetRedemptionRequestAction) onCompleted(redemptionRequestActionSlug)

Parameters

Parameter Tags Description
redemptionRequestActionSlug Required The redemption request action identifier

Example Usage

    // Parameters for the API call
    NSString* redemptionRequestActionSlug = @"redemption_request_action_slug";

    [self.redemptionRequests getRedemptionRequestActionAsyncWithRedemptionRequestActionSlug: redemptionRequestActionSlug  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getRedemptionRequestActionsWithCompletionBlock

Get redemption request actions.

function getRedemptionRequestActionsWithCompletionBlock:(CompletedGetRedemptionRequestActions) onCompleted()

Example Usage

    [self.redemptionRequests getRedemptionRequestActionsWithCompletionBlock:  ^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: patchRedemptionRequestAsyncWithAccountSlug

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.

function patchRedemptionRequestAsyncWithAccountSlug:(NSString*) accountSlug
                redemptionRequestId:(int) redemptionRequestId
                completionBlock:(CompletedPatchRedemptionRequest) onCompleted(accountSlug redemptionRequestId : redemptionRequestId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    int redemptionRequestId = 88;

    [self.redemptionRequests patchRedemptionRequestAsyncWithAccountSlug: accountSlug redemptionRequestId : redemptionRequestId  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: postRedemptionRequestAsyncWithAccountSlug

Create a redemption request.

function postRedemptionRequestAsyncWithAccountSlug:(NSString*) accountSlug
                redemptionRequestForm:(RedemptionRequestForm*) redemptionRequestForm
                completionBlock:(CompletedPostRedemptionRequest) onCompleted(accountSlug redemptionRequestForm : redemptionRequestForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    RedemptionRequestForm* redemptionRequestForm = [[RedemptionRequestForm alloc]init];

    [self.redemptionRequests postRedemptionRequestAsyncWithAccountSlug: accountSlug redemptionRequestForm : redemptionRequestForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getRedemptionRequestAsyncWithAccountSlug

Get a redemption request by a given id.

function getRedemptionRequestAsyncWithAccountSlug:(NSString*) accountSlug
                redemptionRequestId:(NSString*) redemptionRequestId
                completionBlock:(CompletedGetRedemptionRequest) onCompleted(accountSlug redemptionRequestId : redemptionRequestId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* redemptionRequestId = @"redemption_request_id";

    [self.redemptionRequests getRedemptionRequestAsyncWithAccountSlug: accountSlug redemptionRequestId : redemptionRequestId  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getRedemptionRequestsAsyncWithAccountSlug

Get the list of redemption requests.

function getRedemptionRequestsAsyncWithAccountSlug:(NSString*) accountSlug
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetRedemptionRequests) onCompleted(accountSlug page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSNumber* page = 88;
    NSNumber* limit = 88;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.redemptionRequests getRedemptionRequestsAsyncWithAccountSlug: accountSlug page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: bonuses

Get singleton instance

Bonuses* bonuses = [[Bonuses alloc]init] ;

Method: getBonusesAsyncWithAccountSlug

Get the list of bonuses for a given account.

function getBonusesAsyncWithAccountSlug:(NSString*) accountSlug
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetBonuses) onCompleted(accountSlug page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSNumber* page = 88;
    NSNumber* limit = 88;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.bonuses getBonusesAsyncWithAccountSlug: accountSlug page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: postBonusAsyncWithAccountSlug

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.

function postBonusAsyncWithAccountSlug:(NSString*) accountSlug
                bonusesForm:(BonusesForm*) bonusesForm
                completionBlock:(CompletedPostBonus) onCompleted(accountSlug bonusesForm : bonusesForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    BonusesForm* bonusesForm = [[BonusesForm alloc]init];

    [self.bonuses postBonusAsyncWithAccountSlug: accountSlug bonusesForm : bonusesForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusCheckupAsyncWithAccountSlug

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.

function getBonusCheckupAsyncWithAccountSlug:(NSString*) accountSlug
                advocateToken:(NSString*) advocateToken
                reference:(NSString*) reference
                paymentAmount:(double) paymentAmount
                completionBlock:(CompletedGetBonusCheckup) onCompleted(accountSlug advocateToken : advocateToken reference : reference paymentAmount : paymentAmount)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* advocateToken = @"advocate_token";
    NSString* reference = @"reference";
    double paymentAmount = 47.2523227996437;

    [self.bonuses getBonusCheckupAsyncWithAccountSlug: accountSlug advocateToken : advocateToken reference : reference paymentAmount : paymentAmount  completionBlock:^(BOOL success, HttpContext* context, NSData* response, NSError* error) { 
       //Add code here
    }];

Method: postForceBonusAsyncWithAccountSlug

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

function postForceBonusAsyncWithAccountSlug:(NSString*) accountSlug
                bonusForm:(ForceBonusesForm*) bonusForm
                completionBlock:(CompletedPostForceBonus) onCompleted(accountSlug bonusForm : bonusForm)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    ForceBonusesForm* bonusForm = [[ForceBonusesForm alloc]init];

    [self.bonuses postForceBonusAsyncWithAccountSlug: accountSlug bonusForm : bonusForm  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusTraceAsyncWithAccountSlug

Get a bonus request trace.

function getBonusTraceAsyncWithAccountSlug:(NSString*) accountSlug
                traceId:(int) traceId
                completionBlock:(CompletedGetBonusTrace) onCompleted(accountSlug traceId : traceId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    int traceId = 47;

    [self.bonuses getBonusTraceAsyncWithAccountSlug: accountSlug traceId : traceId  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: deleteBonusAsyncWithAccountSlug

Delete a bonus

function deleteBonusAsyncWithAccountSlug:(NSString*) accountSlug
                bonusId:(int) bonusId
                completionBlock:(CompletedDeleteBonus) onCompleted(accountSlug bonusId : bonusId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    int bonusId = 47;

    [self.bonuses deleteBonusAsyncWithAccountSlug: accountSlug bonusId : bonusId  completionBlock:^(BOOL success, HttpContext* context, NSError* error) { 
       //Add code here
    }];

Method: getBonusAsyncWithAccountSlug

Get a bonus by a given id.

function getBonusAsyncWithAccountSlug:(NSString*) accountSlug
                bonusId:(int) bonusId
                completionBlock:(CompletedGetBonus) onCompleted(accountSlug bonusId : bonusId)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    int bonusId = 47;

    [self.bonuses getBonusAsyncWithAccountSlug: accountSlug bonusId : bonusId  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getBonusTracesAsyncWithAccountSlug

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.

function getBonusTracesAsyncWithAccountSlug:(NSString*) accountSlug
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetBonusTraces) onCompleted(accountSlug page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSNumber* page = 47;
    NSNumber* limit = 47;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.bonuses getBonusTracesAsyncWithAccountSlug: accountSlug page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers

Class: campaigns

Get singleton instance

Campaigns* campaigns = [[Campaigns alloc]init] ;

Method: getCampaignAsyncWithAccountSlug

Get a campaign by a given slug.

function getCampaignAsyncWithAccountSlug:(NSString*) accountSlug
                campaignSlug:(NSString*) campaignSlug
                completionBlock:(CompletedGetCampaign) onCompleted(accountSlug campaignSlug : campaignSlug)

Parameters

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

Example Usage

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSString* campaignSlug = @"campaign_slug";

    [self.campaigns getCampaignAsyncWithAccountSlug: accountSlug campaignSlug : campaignSlug  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Method: getCampaignsAsyncWithAccountSlug

Get the list of campaings for a given account.

function getCampaignsAsyncWithAccountSlug:(NSString*) accountSlug
                page:(NSNumber*) page
                limit:(NSNumber*) limit
                filter:(NSString*) filter
                sort:(NSString*) sort
                completionBlock:(CompletedGetCampaigns) onCompleted(accountSlug page : page limit : limit filter : filter sort : sort)

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

    // Parameters for the API call
    NSString* accountSlug = @"account_slug";
    NSNumber* page = 47;
    NSNumber* limit = 47;
    NSString* filter = @"filter";
    NSString* sort = @"sort";

    [self.campaigns getCampaignsAsyncWithAccountSlug: accountSlug page : page limit : limit filter : filter sort : sort  completionBlock:^(BOOL success, HttpContext* context, id response, NSError* error) { 
       //Add code here
    }];

Back to List of Controllers