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.
src/geniusreferrals_lib
.project
LICENSE
README.md

README.md

Getting started

How to Build

  • In order to successfully build and run your SDK files, you are required to have the following setup in your system:
  • Ensure that GOPATH environment variable is set in the system variables. If not, set it to your workspace directory where you will be adding your Go projects.
  • The generated code uses unirest-go http library. Therefore, you will need internet access to resolve this dependency. If Go is properly installed and configured, run the following command to pull the dependency:
go get github.com/apimatic/unirest-go

This will install unirest-go in the GOPATH you specified in the system variables.

Now follow the steps mentioned below to build your SDK:

  1. Open eclipse in the Go language perspective and click on the Import option in File menu.

Importing SDK into Eclipse - Step 1

  1. Select General -> Existing Projects into Workspace option from the tree list.

Importing SDK into Eclipse - Step 2

  1. In Select root directory, provide path to the unzipped archive for the generated code. Once the path is set and the Project becomes visible under Projects click Finish

Importing SDK into Eclipse - Step 3

  1. The Go library will be imported and its files will be visible in the Project Explorer

Importing SDK into Eclipse - Step 4

How to Use

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

1. Add a new Test Project

Create a new project in Eclipse by File -> New -> Go Project

Add a new project in Eclipse

Name the Project as Test and click Finish

Create a new Maven Project - Step 1

Create a new directory in the src directory of this project

Create a new Maven Project - Step 2

Name it test.com

Create a new Maven Project - Step 3

Now create a new file inside src/test.com

Create a new Maven Project - Step 4

Name it testsdk.go

Create a new Maven Project - Step 5

In this Go file, you can start adding code to initialize the client library. Sample code to initialize the client library and using its methods is given in the subsequent sections.

2. Configure the Test Project

You need to import your generated library in this project in order to make use of its functions. In order to import the library, you can add its path in the GOPATH for this project. Follow the below steps:

Right click on the project name and click on Properties

Adding dependency to the client library - Step 1

Choose Go Compiler from the side menu. Check Use project specific settings and uncheck Use same value as the GOPATH environment variable.. By default, the GOPATH value from the environment variables will be visible in Eclipse GOPATH. Do not remove this as this points to the unirest dependency.

Adding dependency to the client library - Step 2

Append the library path to this GOPATH

Adding dependency to the client library - Step 3

Once the path is appended, click on OK

3. Build the Test Project

Right click on the project name and click on Build Project

Build Project

4. Run the Test Project

If the build is successful, right click on your Go file and click on Run As -> Go Application

Run Project

Initialization

Authentication

In order to setup authentication 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

To configure these for your generated code, open the file "Configuration.go" and edit it's contents.

Class Reference

List of Controllers

Class: roots_pkg

Get instance

Factory for the ROOTS interface can be accessed from the package roots_pkg.

roots := roots_pkg.NewROOTS()

Method: GetRoot

The root of the API

func (me *ROOTS_IMPL) GetRoot()(interface{},error)

Example Usage

var result interface{}
result,_ = roots.GetRoot()

Back to List of Controllers

Class: authentications_pkg

Get instance

Factory for the AUTHENTICATIONS interface can be accessed from the package authentications_pkg.

authentications := authentications_pkg.NewAUTHENTICATIONS()

Method: GetAuthentication

Allow clients to test authentication on Genius Referrals platform.

func (me *AUTHENTICATIONS_IMPL) GetAuthentication()(interface{},error)

Example Usage

var result interface{}
result,_ = authentications.GetAuthentication()

Back to List of Controllers

Class: advocates_pkg

Get instance

Factory for the ADVOCATES interface can be accessed from the package advocates_pkg.

advocates := advocates_pkg.NewADVOCATES()

Method: DeleteAdvocate

Delete an advocate

func (me *ADVOCATES_IMPL) DeleteAdvocate(
            accountSlug string,
            advocateToken string)(,error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"

var result 
result,_ = advocates.DeleteAdvocate(accountSlug, advocateToken)

Method: PutAdvocate

Update an advocate.

func (me *ADVOCATES_IMPL) PutAdvocate(
            accountSlug string,
            advocateToken string,
            advocateForm *models_pkg.AdvocateForm)(,error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"
var advocateForm *models_pkg.AdvocateForm

var result 
result,_ = advocates.PutAdvocate(accountSlug, advocateToken, advocateForm)

Method: PostAdvocate

Create a new advocate.

func (me *ADVOCATES_IMPL) PostAdvocate(
            accountSlug string,
            advocateForm *models_pkg.AdvocateForm)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
var advocateForm *models_pkg.AdvocateForm

var result interface{}
result,_ = advocates.PostAdvocate(accountSlug, advocateForm)

Method: GetAdvocate

Get an advocate by a given token.

func (me *ADVOCATES_IMPL) GetAdvocate(
            accountSlug string,
            advocateToken string)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"

var result interface{}
result,_ = advocates.GetAdvocate(accountSlug, advocateToken)

Method: DeleteAdvocates

Delete all advocates

func (me *ADVOCATES_IMPL) DeleteAdvocates(accountSlug string)(,error)

Parameters

Parameter Tags Description
accountSlug Required The account identifier

Example Usage

accountSlug := "account_slug"

var result 
result,_ = advocates.DeleteAdvocates(accountSlug)

Method: GetAdvocates

Get the list of advocates

func (me *ADVOCATES_IMPL) GetAdvocates(
            accountSlug string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = advocates.GetAdvocates(accountSlug, page, limit, filter, sort)

Method: PatchAdvocate

Update partial elements of an advocate.

func (me *ADVOCATES_IMPL) PatchAdvocate(
            accountSlug string,
            advocateToken string,
            advocatePatchForm []*models_pkg.AdvocatePatchForm)(interface{},error)

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

accountSlug := "account_slug"
advocateToken := "advocate_token"
var advocatePatchForm []*models_pkg.AdvocatePatchForm

var result interface{}
result,_ = advocates.PatchAdvocate(accountSlug, advocateToken, advocatePatchForm)

Method: GetShareLinks

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.

func (me *ADVOCATES_IMPL) GetShareLinks(
            accountSlug string,
            advocateToken string)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"

var result interface{}
result,_ = advocates.GetShareLinks(accountSlug, advocateToken)

Method: PutPaymentMethod

Update a payment method.

func (me *ADVOCATES_IMPL) PutPaymentMethod(
            accountSlug string,
            advocateToken string,
            advocatePaymentMethodId int64,
            advocatePaymentMethodForm *models_pkg.PaymentMethodForm)(,error)

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

accountSlug := "account_slug"
advocateToken := "advocate_token"
advocatePaymentMethodId,_ := strconv.ParseInt("125", 10, 8)
var advocatePaymentMethodForm *models_pkg.PaymentMethodForm

var result 
result,_ = advocates.PutPaymentMethod(accountSlug, advocateToken, advocatePaymentMethodId, advocatePaymentMethodForm)

Method: GetPaymentMethod

Get an advocate's payment method

func (me *ADVOCATES_IMPL) GetPaymentMethod(
            accountSlug string,
            advocateToken string,
            advocatePaymentMethodId int64)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"
advocatePaymentMethodId,_ := strconv.ParseInt("125", 10, 8)

var result interface{}
result,_ = advocates.GetPaymentMethod(accountSlug, advocateToken, advocatePaymentMethodId)

Method: PostPaymentMethod

Create a new payment method.

func (me *ADVOCATES_IMPL) PostPaymentMethod(
            accountSlug string,
            advocateToken string,
            advocatePaymentMethodForm *models_pkg.PaymentMethodForm)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"
var advocatePaymentMethodForm *models_pkg.PaymentMethodForm

var result interface{}
result,_ = advocates.PostPaymentMethod(accountSlug, advocateToken, advocatePaymentMethodForm)

Method: GetBonusRedemptionMethod

Get bonuses redemption method.

func (me *ADVOCATES_IMPL) GetBonusRedemptionMethod(bonusesRedemptionMethodSlug string)(interface{},error)

Parameters

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

Example Usage

bonusesRedemptionMethodSlug := "bonuses_redemption_method_slug"

var result interface{}
result,_ = advocates.GetBonusRedemptionMethod(bonusesRedemptionMethodSlug)

Method: GetBonusRedemptionMethods

Get bonuses redemption methods.

func (me *ADVOCATES_IMPL) GetBonusRedemptionMethods()(interface{},error)

Example Usage

var result interface{}
result,_ = advocates.GetBonusRedemptionMethods()

Method: GetCurrencies

Get currencies.

func (me *ADVOCATES_IMPL) GetCurrencies()(interface{},error)

Example Usage

var result interface{}
result,_ = advocates.GetCurrencies()

Method: GetCurrency

Get a currency.

func (me *ADVOCATES_IMPL) GetCurrency(code string)(interface{},error)

Parameters

Parameter Tags Description
code Required The currency's code

Example Usage

code := "code"

var result interface{}
result,_ = advocates.GetCurrency(code)

Method: GetPaymentMethods

Get the advocate's payment methods.

func (me *ADVOCATES_IMPL) GetPaymentMethods(
            accountSlug string,
            advocateToken string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
advocateToken := "advocate_token"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = advocates.GetPaymentMethods(accountSlug, advocateToken, page, limit, filter, sort)

Back to List of Controllers

Class: accounts_pkg

Get instance

Factory for the ACCOUNTS interface can be accessed from the package accounts_pkg.

accounts := accounts_pkg.NewACCOUNTS()

Method: GetAccount

Get an account by a given slug.

func (me *ACCOUNTS_IMPL) GetAccount(accountSlug string)(interface{},error)

Parameters

Parameter Tags Description
accountSlug Required The account identifier

Example Usage

accountSlug := "account_slug"

var result interface{}
result,_ = accounts.GetAccount(accountSlug)

Method: GetAccounts

Get the list of accounts.

func (me *ACCOUNTS_IMPL) GetAccounts(
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = accounts.GetAccounts(page, limit, filter, sort)

Back to List of Controllers

Class: reports_pkg

Get instance

Factory for the REPORTS interface can be accessed from the package reports_pkg.

reports := reports_pkg.NewREPORTS()

Method: GetReferralsSummaryPerOrigin

Get referrals summary per referral origin.

func (me *REPORTS_IMPL) GetReferralsSummaryPerOrigin(advocateToken string)(interface{},error)

Parameters

Parameter Tags Description
advocateToken Required The advocate's token

Example Usage

advocateToken := "advocate_token"

var result interface{}
result,_ = reports.GetReferralsSummaryPerOrigin(advocateToken)

Method: GetBonusesSummaryPerOrigin

Get bonuses summary per referral origin.

func (me *REPORTS_IMPL) GetBonusesSummaryPerOrigin(advocateToken string)(interface{},error)

Parameters

Parameter Tags Description
advocateToken Required The advocate's token

Example Usage

advocateToken := "advocate_token"

var result interface{}
result,_ = reports.GetBonusesSummaryPerOrigin(advocateToken)

Method: GetTopAdvocates

Get top 10 advocates.

func (me *REPORTS_IMPL) GetTopAdvocates(
            accountSlug *string,
            campaignSlug *string,
            limit *int64,
            from *time.Time,
            to *time.Time)(interface{},error)

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

accountSlug := "account_slug"
campaignSlug := "campaign_slug"
limit,_ := strconv.ParseInt("10", 10, 8)
from := time.Now()
to := time.Now()

var result interface{}
result,_ = reports.GetTopAdvocates(accountSlug, campaignSlug, limit, from, to)

Method: GetShareDailyParticipation

Get share daily participation.

func (me *REPORTS_IMPL) GetShareDailyParticipation(
            accountSlug *string,
            campaignSlug *string,
            advocateToken *string,
            from *time.Time,
            to *time.Time)(interface{},error)

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

accountSlug := "account_slug"
campaignSlug := "campaign_slug"
advocateToken := "advocate_token"
from := time.Now()
to := time.Now()

var result interface{}
result,_ = reports.GetShareDailyParticipation(accountSlug, campaignSlug, advocateToken, from, to)

Method: GetReferralDailyParticipation

Get referral daily participation.

func (me *REPORTS_IMPL) GetReferralDailyParticipation(
            accountSlug *string,
            campaignSlug *string,
            advocateToken *string,
            from *time.Time,
            to *time.Time)(interface{},error)

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

accountSlug := "account_slug"
campaignSlug := "campaign_slug"
advocateToken := "advocate_token"
from := time.Now()
to := time.Now()

var result interface{}
result,_ = reports.GetReferralDailyParticipation(accountSlug, campaignSlug, advocateToken, from, to)

Method: GetClickDailyParticipation

Get click daily participation.

func (me *REPORTS_IMPL) GetClickDailyParticipation(
            accountSlug *string,
            campaignSlug *string,
            advocateToken *string,
            from *time.Time,
            to *time.Time)(interface{},error)

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

accountSlug := "account_slug"
campaignSlug := "campaign_slug"
advocateToken := "advocate_token"
from := time.Now()
to := time.Now()

var result interface{}
result,_ = reports.GetClickDailyParticipation(accountSlug, campaignSlug, advocateToken, from, to)

Method: GetBonusesDailyGiven

Get bonuses daily given.

func (me *REPORTS_IMPL) GetBonusesDailyGiven(
            accountSlug *string,
            campaignSlug *string,
            advocateToken *string,
            from *time.Time,
            to *time.Time)(interface{},error)

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

accountSlug := "account_slug"
campaignSlug := "campaign_slug"
advocateToken := "advocate_token"
from := time.Now()
to := time.Now()

var result interface{}
result,_ = reports.GetBonusesDailyGiven(accountSlug, campaignSlug, advocateToken, from, to)

Back to List of Controllers

Class: referrals_pkg

Get instance

Factory for the REFERRALS interface can be accessed from the package referrals_pkg.

referrals := referrals_pkg.NewREFERRALS()

Method: GetReferralOrigin

Get a referral origin by a given slug.

func (me *REFERRALS_IMPL) GetReferralOrigin(referralOriginSlug string)(interface{},error)

Parameters

Parameter Tags Description
referralOriginSlug Required The referral origin identifier

Example Usage

referralOriginSlug := "referral_origin_slug"

var result interface{}
result,_ = referrals.GetReferralOrigin(referralOriginSlug)

Method: GetReferralOrigins

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

func (me *REFERRALS_IMPL) GetReferralOrigins()(interface{},error)

Example Usage

var result interface{}
result,_ = referrals.GetReferralOrigins()

Method: GetReferral

Get a referral by a given id.

func (me *REFERRALS_IMPL) GetReferral(
            accountSlug string,
            advocateToken string,
            referralId string)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"
referralId := "referral_id"

var result interface{}
result,_ = referrals.GetReferral(accountSlug, advocateToken, referralId)

Method: DeleteReferral

Delete a referral.

func (me *REFERRALS_IMPL) DeleteReferral(
            accountSlug string,
            advocateToken string,
            referralId string)(,error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"
referralId := "referral_id"

var result 
result,_ = referrals.DeleteReferral(accountSlug, advocateToken, referralId)

Method: PostReferral

Create a new referral.

func (me *REFERRALS_IMPL) PostReferral(
            accountSlug string,
            advocateToken string,
            referralForm *models_pkg.ReferralForm)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
advocateToken := "advocate_token"
var referralForm *models_pkg.ReferralForm

var result interface{}
result,_ = referrals.PostReferral(accountSlug, advocateToken, referralForm)

Method: PutReferral

Update a referral.

func (me *REFERRALS_IMPL) PutReferral(
            accountSlug string,
            advocateToken string,
            referralId string,
            referralForm *models_pkg.ReferralForm)(,error)

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

accountSlug := "account_slug"
advocateToken := "advocate_token"
referralId := "referral_id"
var referralForm *models_pkg.ReferralForm

var result 
result,_ = referrals.PutReferral(accountSlug, advocateToken, referralId, referralForm)

Method: GetReferrals

Get the list of referrals for a given advocate.

func (me *REFERRALS_IMPL) GetReferrals(
            accountSlug string,
            advocateToken string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
advocateToken := "advocate_token"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = referrals.GetReferrals(accountSlug, advocateToken, page, limit, filter, sort)

Back to List of Controllers

Class: redemptionrequests_pkg

Get instance

Factory for the REDEMPTIONREQUESTS interface can be accessed from the package redemptionrequests_pkg.

redemptionRequests := redemptionrequests_pkg.NewREDEMPTIONREQUESTS()

Method: GetRedemptionRequestStatus

Get a redemption request status.

func (me *REDEMPTIONREQUESTS_IMPL) GetRedemptionRequestStatus(redemptionRequestStatusSlug string)(interface{},error)

Parameters

Parameter Tags Description
redemptionRequestStatusSlug Required The redemption request status identifier

Example Usage

redemptionRequestStatusSlug := "redemption_request_status_slug"

var result interface{}
result,_ = redemptionRequests.GetRedemptionRequestStatus(redemptionRequestStatusSlug)

Method: GetRedemptionRequestStatuses

Get redemption request statuses.

func (me *REDEMPTIONREQUESTS_IMPL) GetRedemptionRequestStatuses()(interface{},error)

Example Usage

var result interface{}
result,_ = redemptionRequests.GetRedemptionRequestStatuses()

Method: GetRedemptionRequestAction

Get a redemption request action.

func (me *REDEMPTIONREQUESTS_IMPL) GetRedemptionRequestAction(redemptionRequestActionSlug string)(interface{},error)

Parameters

Parameter Tags Description
redemptionRequestActionSlug Required The redemption request action identifier

Example Usage

redemptionRequestActionSlug := "redemption_request_action_slug"

var result interface{}
result,_ = redemptionRequests.GetRedemptionRequestAction(redemptionRequestActionSlug)

Method: GetRedemptionRequestActions

Get redemption request actions.

func (me *REDEMPTIONREQUESTS_IMPL) GetRedemptionRequestActions()(interface{},error)

Example Usage

var result interface{}
result,_ = redemptionRequests.GetRedemptionRequestActions()

Method: PatchRedemptionRequest

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.

func (me *REDEMPTIONREQUESTS_IMPL) PatchRedemptionRequest(
            accountSlug string,
            redemptionRequestId int64)(,error)

Parameters

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

Example Usage

accountSlug := "account_slug"
redemptionRequestId,_ := strconv.ParseInt("125", 10, 8)

var result 
result,_ = redemptionRequests.PatchRedemptionRequest(accountSlug, redemptionRequestId)

Method: PostRedemptionRequest

Create a redemption request.

func (me *REDEMPTIONREQUESTS_IMPL) PostRedemptionRequest(
            accountSlug string,
            redemptionRequestForm *models_pkg.RedemptionRequestForm)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
var redemptionRequestForm *models_pkg.RedemptionRequestForm

var result interface{}
result,_ = redemptionRequests.PostRedemptionRequest(accountSlug, redemptionRequestForm)

Method: GetRedemptionRequest

Get a redemption request by a given id.

func (me *REDEMPTIONREQUESTS_IMPL) GetRedemptionRequest(
            accountSlug string,
            redemptionRequestId string)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
redemptionRequestId := "redemption_request_id"

var result interface{}
result,_ = redemptionRequests.GetRedemptionRequest(accountSlug, redemptionRequestId)

Method: GetRedemptionRequests

Get the list of redemption requests.

func (me *REDEMPTIONREQUESTS_IMPL) GetRedemptionRequests(
            accountSlug string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = redemptionRequests.GetRedemptionRequests(accountSlug, page, limit, filter, sort)

Back to List of Controllers

Class: bonuses_pkg

Get instance

Factory for the BONUSES interface can be accessed from the package bonuses_pkg.

bonuses := bonuses_pkg.NewBONUSES()

Method: GetBonuses

Get the list of bonuses for a given account.

func (me *BONUSES_IMPL) GetBonuses(
            accountSlug string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = bonuses.GetBonuses(accountSlug, page, limit, filter, sort)

Method: PostBonus

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.

func (me *BONUSES_IMPL) PostBonus(
            accountSlug string,
            bonusesForm *models_pkg.BonusesForm)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
var bonusesForm *models_pkg.BonusesForm

var result interface{}
result,_ = bonuses.PostBonus(accountSlug, bonusesForm)

Method: GetBonusCheckup

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.

func (me *BONUSES_IMPL) GetBonusCheckup(
            accountSlug string,
            advocateToken string,
            reference string,
            paymentAmount float64)([]byte,error)

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

accountSlug := "account_slug"
advocateToken := "advocate_token"
reference := "reference"
paymentAmount := 217.245066297355

var result []byte
result,_ = bonuses.GetBonusCheckup(accountSlug, advocateToken, reference, paymentAmount)

Method: PostForceBonus

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

func (me *BONUSES_IMPL) PostForceBonus(
            accountSlug string,
            bonusForm *models_pkg.ForceBonusesForm)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
var bonusForm *models_pkg.ForceBonusesForm

var result interface{}
result,_ = bonuses.PostForceBonus(accountSlug, bonusForm)

Method: GetBonusTrace

Get a bonus request trace.

func (me *BONUSES_IMPL) GetBonusTrace(
            accountSlug string,
            traceId int64)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
traceId,_ := strconv.ParseInt("217", 10, 8)

var result interface{}
result,_ = bonuses.GetBonusTrace(accountSlug, traceId)

Method: DeleteBonus

Delete a bonus

func (me *BONUSES_IMPL) DeleteBonus(
            accountSlug string,
            bonusId int64)(,error)

Parameters

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

Example Usage

accountSlug := "account_slug"
bonusId,_ := strconv.ParseInt("217", 10, 8)

var result 
result,_ = bonuses.DeleteBonus(accountSlug, bonusId)

Method: GetBonus

Get a bonus by a given id.

func (me *BONUSES_IMPL) GetBonus(
            accountSlug string,
            bonusId int64)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
bonusId,_ := strconv.ParseInt("217", 10, 8)

var result interface{}
result,_ = bonuses.GetBonus(accountSlug, bonusId)

Method: GetBonusTraces

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.

func (me *BONUSES_IMPL) GetBonusTraces(
            accountSlug string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = bonuses.GetBonusTraces(accountSlug, page, limit, filter, sort)

Back to List of Controllers

Class: campaigns_pkg

Get instance

Factory for the CAMPAIGNS interface can be accessed from the package campaigns_pkg.

campaigns := campaigns_pkg.NewCAMPAIGNS()

Method: GetCampaign

Get a campaign by a given slug.

func (me *CAMPAIGNS_IMPL) GetCampaign(
            accountSlug string,
            campaignSlug string)(interface{},error)

Parameters

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

Example Usage

accountSlug := "account_slug"
campaignSlug := "campaign_slug"

var result interface{}
result,_ = campaigns.GetCampaign(accountSlug, campaignSlug)

Method: GetCampaigns

Get the list of campaings for a given account.

func (me *CAMPAIGNS_IMPL) GetCampaigns(
            accountSlug string,
            page *int64,
            limit *int64,
            filter *string,
            sort *string)(interface{},error)

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

accountSlug := "account_slug"
page,_ := strconv.ParseInt("1", 10, 8)
limit,_ := strconv.ParseInt("10", 10, 8)
filter := "filter"
sort := "sort"

var result interface{}
result,_ = campaigns.GetCampaigns(accountSlug, page, limit, filter, sort)

Back to List of Controllers