Pointloyalty Manager; 3.3.0
Java REST access API

com.pointloyalty.loyalty.rest.client
Class PointloyaltyRestClient

java.lang.Object
  extended by com.pointloyalty.loyalty.rest.client.PointloyaltyRestClient

public class PointloyaltyRestClient
extends java.lang.Object

REST API for the Pointloyalty Manager bonuses calculation system.
For start:


Field Summary
static java.lang.String HTTP_REST_URL
           
static java.lang.String HTTPS_REST_URL
           
static java.lang.String POINTLOLOYALTY_REST_URL
           
static int SSL_PORT
           
 
Constructor Summary
PointloyaltyRestClient()
           
 
Method Summary
static BonusFullDataBean[] addAction(LoginBean login, java.lang.String userDataId, ActionBean action)
          Sends one user action to PointLoyalty Manager system and calculate bonus points.
static BonusFullDataBean[] addActions(LoginBean login, java.lang.String userDataId, ActionBean[] actions)
          Sends a batch of user transactions to PointLoyalty Manager system for bonus calculation.
static void addBonusAdjustment(LoginBean login, java.lang.String userDataId, BonusAdjustmentBean adj)
          Sends a batch of bonus adjustments information to PointLoyalty Manager system.
static void addBonusAdjustments(LoginBean login, java.lang.String userDataId, BonusAdjustmentBean[] adjs)
          Sends a batch of bonus adjustments information to PointLoyalty Manager system.
static BonusFullDataBean[] addDemoActions(LoginBean login, ActionBean[] actions)
          Sends a batch of user transactions to demonstration account in PointLoyalty Manager system for bonus calculation.
static void addMember(LoginBean login, MemberBean member)
          Creates loyalty program member.
static void addMemberAccount(LoginBean login, MemberAccountBean memberAccount)
          Creates one member account for PointLoyalty Member Console.
static void addMemberAccounts(LoginBean login, MemberAccountBean[] memberAccounts)
          Creates members' accounts for PointLoyalty Member Console.
static void addMembers(LoginBean login, MemberBean[] members)
          Creates multiple loyalty program members.
static void deleteActions(LoginBean login, java.lang.String userDataId)
          Deletes member actions from the system.
static void deleteAllActions(LoginBean login, java.util.Date from, java.util.Date to)
          Deletes all actions, registered in the system with all calculated bonuses for these actions.
static void deleteAllBonusAdjustments(LoginBean login, java.util.Date from, java.util.Date to)
          Deletes all bonus adjustments, registered in the system.
static void deleteAllBonuses(LoginBean login, java.util.Date actionDateFrom, java.util.Date actionDateTo)
          Deletes all bonuses, calculated in the system.
static void deleteAllMemberAccounts(LoginBean login)
          Deletes all members accounts, registered in the system.
static void deleteAllMembers(LoginBean login)
          Deletes all members, registered in the system.
static void deleteBonus(LoginBean login, java.lang.String bonusInternalId)
          Deletes bonus calculated in the system.
static void deleteBonusAdjustments(LoginBean login, java.lang.String userDataId)
          Deletes bonuses adjustments registered in the system.
static void deleteBonuses(LoginBean login, java.lang.String[] bonusInternalIds)
          Deletes bonuses calculated in the system.
static void deleteMember(LoginBean login, java.lang.String memberId)
          Deletes loyalty program member registered in the system.
static void deleteMemberAccount(LoginBean login, java.lang.String personalId)
          Deletes member account for PointLoyalty Member Console.
static void deleteMemberAccounts(LoginBean login, java.lang.String[] personalIds)
          Deletes members accounts for PointLoyalty Member Console.
static void deleteMembers(LoginBean login, java.lang.String[] memberIds)
          Deletes loyalty program members registered in the system.
static ProgramOwnerDataBean[] getActiveOffers(LoginBean login)
          Gets all currently active offers.
static BonusAdjustmentBean[] getBonusAdjustments(LoginBean login, java.lang.String memberId, java.util.Date from, java.util.Date to)
          Gets all bonus adjustments registered for the customer within time interval.
static BonusFullDataBean[] getBonuses(LoginBean login, java.lang.String memberId, java.util.Date from, java.util.Date to)
          Gets all bonuses earned by the customer within time interval.
static ProgramOwnerDataBean[] getDemoOffers(LoginBean login)
          Gets all currently active offers in demonstration account.
static MemberActivityBean[] getMemberActivity(LoginBean login, java.lang.String memberId, java.util.Date from, java.util.Date to)
          Gets the history of customer(member) activity.
static boolean isCreatedAttributesTemplate(LoginBean login, java.lang.String action, java.lang.String[] attrs)
          Check if there is action template with attributes defined in the system.
static boolean isCreatedMembersTemplate(LoginBean login, java.lang.String[] attrs)
          Check if there are members' templates defined in the system.
static boolean isSsl()
          Gets connection type.
static boolean isValidClientAccount(LoginBean login)
          Check if there is valid program owner's account in PointLoyalty Manager for this login.
static boolean isValidMemberAccount(LoginBean login)
          Check if there is valid member's account in Member Console for this login.
static void useSsl(boolean useSsl)
          Force client to use SSL/HTTP connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSL_PORT

public static int SSL_PORT

HTTP_REST_URL

public static java.lang.String HTTP_REST_URL

HTTPS_REST_URL

public static java.lang.String HTTPS_REST_URL

POINTLOLOYALTY_REST_URL

public static java.lang.String POINTLOLOYALTY_REST_URL
Constructor Detail

PointloyaltyRestClient

public PointloyaltyRestClient()
Method Detail

useSsl

public static void useSsl(boolean useSsl)
Force client to use SSL/HTTP connection.

Parameters:
useSsl - Flag indicating connection type.

isSsl

public static boolean isSsl()
Gets connection type.

Returns:
Connection type. true - SSL connection, false - HTTP connection.

addActions

public static BonusFullDataBean[] addActions(LoginBean login,
                                             java.lang.String userDataId,
                                             ActionBean[] actions)
                                      throws PointLoyaltyRestException
Sends a batch of user transactions to PointLoyalty Manager system for bonus calculation. Pay attention that one action can cause calculating bonuses in multiple loyalty offers.

Parameters:
login - Account in PointLoyalty Manager system.
userDataId - Unique actions batch identifier. It can be used to identify actions to delete. Optional.
actions - Actions for processing.
Returns:
Calculated bonuses. Returns null if no bonuses are calculated for transmitted actions.
Throws:
PointLoyaltyRestException - If any errors occur.

addAction

public static BonusFullDataBean[] addAction(LoginBean login,
                                            java.lang.String userDataId,
                                            ActionBean action)
                                     throws PointLoyaltyRestException
Sends one user action to PointLoyalty Manager system and calculate bonus points. Pay attention that one action can cause calculating bonuses in multiple loyalty offers.

Parameters:
login - Account in PointLoyalty Manager system.
userDataId - Unique action identifier. It can be used to identify actions to delete. Optional.
action - Action for processing.
Returns:
Calculated bonuses. Returns null if no bonuses are calculated for transmitted action.
Throws:
PointLoyaltyRestException - If any errors occur.

addBonusAdjustment

public static void addBonusAdjustment(LoginBean login,
                                      java.lang.String userDataId,
                                      BonusAdjustmentBean adj)
                               throws PointLoyaltyRestException
Sends a batch of bonus adjustments information to PointLoyalty Manager system. Note, that all adjustments must be relevant to the same program and offer.

Parameters:
login - Account in PointLoyalty Manager system.
userDataId - Unique adjustments identifier. It can be used to identify adjustments to delete. Optional.
adj - Bonus adjustment.
Throws:
PointLoyaltyRestException - If any errors occur.

addBonusAdjustments

public static void addBonusAdjustments(LoginBean login,
                                       java.lang.String userDataId,
                                       BonusAdjustmentBean[] adjs)
                                throws PointLoyaltyRestException
Sends a batch of bonus adjustments information to PointLoyalty Manager system. Note, that all adjustments must be relevant to the same program and offer.

Parameters:
login - Account in PointLoyalty Manager system.
userDataId - Unique adjustments batch identifier. It can be used to identify adjustments to delete. Optional.
adjs - Bonuses adjustments.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteActions

public static void deleteActions(LoginBean login,
                                 java.lang.String userDataId)
                          throws PointLoyaltyRestException
Deletes member actions from the system.

Parameters:
login - Account in PointLoyalty Manager system.
userDataId - Unique actions batch identifier. Actions with this identifier should be already registered in the system.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteBonusAdjustments

public static void deleteBonusAdjustments(LoginBean login,
                                          java.lang.String userDataId)
                                   throws PointLoyaltyRestException
Deletes bonuses adjustments registered in the system.

Parameters:
login - Account in PointLoyalty Manager system.
userDataId - Unique adjustments batch identifier. Adjustments with this identifier should be already registered in the system.
Throws:
PointLoyaltyRestException - If any errors occur.

addMembers

public static void addMembers(LoginBean login,
                              MemberBean[] members)
                       throws PointLoyaltyRestException
Creates multiple loyalty program members.

Parameters:
login - Account in PointLoyalty Manager system.
members - Loyalty members data.
Throws:
PointLoyaltyRestException - If any errors occur.

addMember

public static void addMember(LoginBean login,
                             MemberBean member)
                      throws PointLoyaltyRestException
Creates loyalty program member.

Parameters:
login - Account in PointLoyalty Manager system.
member - Loyalty member data.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteMembers

public static void deleteMembers(LoginBean login,
                                 java.lang.String[] memberIds)
                          throws PointLoyaltyRestException
Deletes loyalty program members registered in the system.

Parameters:
login - Account in PointLoyalty Manager system.
memberIds - Loyalty program members identifiers.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteMember

public static void deleteMember(LoginBean login,
                                java.lang.String memberId)
                         throws PointLoyaltyRestException
Deletes loyalty program member registered in the system.

Parameters:
login - Account in PointLoyalty Manager system.
memberId - Loyalty program member identifier.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteBonuses

public static void deleteBonuses(LoginBean login,
                                 java.lang.String[] bonusInternalIds)
                          throws PointLoyaltyRestException
Deletes bonuses calculated in the system.

Parameters:
login - Account in PointLoyalty Manager system.
bonusInternalIds - PointLoyalty Manager internal bonuses identifiers.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteBonus

public static void deleteBonus(LoginBean login,
                               java.lang.String bonusInternalId)
                        throws PointLoyaltyRestException
Deletes bonus calculated in the system.

Parameters:
login - Account in PointLoyalty Manager system.
bonusInternalId - PointLoyalty Manager internal bonus identifier.
Throws:
PointLoyaltyRestException - If any errors occur.

getActiveOffers

public static ProgramOwnerDataBean[] getActiveOffers(LoginBean login)
                                              throws PointLoyaltyRestException
Gets all currently active offers.

Parameters:
login - Account in PointLoyalty Manager system.
Returns:
Loyalty offers.
Throws:
PointLoyaltyRestException - If any errors occur.

getMemberActivity

public static MemberActivityBean[] getMemberActivity(LoginBean login,
                                                     java.lang.String memberId,
                                                     java.util.Date from,
                                                     java.util.Date to)
                                              throws PointLoyaltyRestException
Gets the history of customer(member) activity. The history will include all registered customer actions and bonus adjustments made by the program owner.
Using from and to parameters it is possible to set the time interval for the request. Note that it is supported passing only one of these dates.

Parameters:
login - Account in PointLoyalty Manager system.
memberId - Customer(member) identifier.
from - Interval begin date (can be null).
to - Interval end date (can be null).
Returns:
All member actions registered within the interval.
Throws:
PointLoyaltyRestException - If any errors occur.

getDemoOffers

public static ProgramOwnerDataBean[] getDemoOffers(LoginBean login)
                                            throws PointLoyaltyRestException
Gets all currently active offers in demonstration account.
For demonstration purposes only.

Parameters:
login - Account in PointLoyalty Manager system.
Returns:
Loyalty offers.
Throws:
PointLoyaltyRestException - If any errors occur.

addDemoActions

public static BonusFullDataBean[] addDemoActions(LoginBean login,
                                                 ActionBean[] actions)
                                          throws PointLoyaltyRestException
Sends a batch of user transactions to demonstration account in PointLoyalty Manager system for bonus calculation. Pay attention that one action can cause calculating bonuses in multiple loyalty offers.
For demonstration purposes only.

Parameters:
login - Account in PointLoyalty Manager system.
actions - Actions for processing.
Returns:
Calculated bonuses.
Throws:
PointLoyaltyRestException - If any errors occur.

getBonuses

public static BonusFullDataBean[] getBonuses(LoginBean login,
                                             java.lang.String memberId,
                                             java.util.Date from,
                                             java.util.Date to)
                                      throws PointLoyaltyRestException
Gets all bonuses earned by the customer within time interval.
Using from and to parameters it is possible to set the time interval for the request. Note that it is supported passing only one of these dates.

Parameters:
login - Account in PointLoyalty Manager system.
memberId - Customer(member) identifier.
from - Interval begin date (can be null).
to - Interval end date (can be null).
Returns:
All bonuses earned by the customer within the interval.
Throws:
PointLoyaltyRestException - If any errors occur.

getBonusAdjustments

public static BonusAdjustmentBean[] getBonusAdjustments(LoginBean login,
                                                        java.lang.String memberId,
                                                        java.util.Date from,
                                                        java.util.Date to)
                                                 throws PointLoyaltyRestException
Gets all bonus adjustments registered for the customer within time interval.
Using from and to parameters it is possible to set the time interval for the request. Note that it is supported passing only one of these dates.

Parameters:
login - Account in PointLoyalty Manager system.
memberId - Customer(member) identifier.
from - Interval begin date (can be null).
to - Interval end date (can be null).
Returns:
All adjustments relevant to the customer within the time interval.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteAllBonuses

public static void deleteAllBonuses(LoginBean login,
                                    java.util.Date actionDateFrom,
                                    java.util.Date actionDateTo)
                             throws PointLoyaltyRestException
Deletes all bonuses, calculated in the system. By specifying the interval one can restrict the scope of deleting. Note that interval dates are action dates and not the bonus calculation dates.
It is possible to specify only one of these dates.

Parameters:
login - Account in PointLoyalty Manager system.
actionDateFrom - Interval begin date (can be null).
actionDateTo - Interval end date (can be null).
Throws:
PointLoyaltyRestException - If any errors occur.

deleteAllMembers

public static void deleteAllMembers(LoginBean login)
                             throws PointLoyaltyRestException
Deletes all members, registered in the system.

Parameters:
login - Account in PointLoyalty Manager system.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteAllActions

public static void deleteAllActions(LoginBean login,
                                    java.util.Date from,
                                    java.util.Date to)
                             throws PointLoyaltyRestException
Deletes all actions, registered in the system with all calculated bonuses for these actions.
Using from and to parameters it is possible to set the time interval for the request. Note that it is supported passing only one of these dates.

Parameters:
login - Account in PointLoyalty Manager system.
from - Interval begin date (can be null).
to - Interval end date (can be null).
Throws:
PointLoyaltyRestException - If any errors occur.

deleteAllBonusAdjustments

public static void deleteAllBonusAdjustments(LoginBean login,
                                             java.util.Date from,
                                             java.util.Date to)
                                      throws PointLoyaltyRestException
Deletes all bonus adjustments, registered in the system.
Using from and to parameters it is possible to set the time interval for the request. Note that it is supported passing only one of these dates.

Parameters:
login - Account in PointLoyalty Manager system.
from - Interval begin date (can be null).
to - Interval end date (can be null).
Throws:
PointLoyaltyRestException - If any errors occur.

addMemberAccount

public static void addMemberAccount(LoginBean login,
                                    MemberAccountBean memberAccount)
                             throws PointLoyaltyRestException
Creates one member account for PointLoyalty Member Console.

Parameters:
login - Account in PointLoyalty Manager system.
memberAccount - Member account data.
Throws:
PointLoyaltyRestException - If any errors occur.

addMemberAccounts

public static void addMemberAccounts(LoginBean login,
                                     MemberAccountBean[] memberAccounts)
                              throws PointLoyaltyRestException
Creates members' accounts for PointLoyalty Member Console.

Parameters:
login - Account in PointLoyalty Manager system.
memberAccounts - Members' accounts data.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteMemberAccount

public static void deleteMemberAccount(LoginBean login,
                                       java.lang.String personalId)
                                throws PointLoyaltyRestException
Deletes member account for PointLoyalty Member Console.

Parameters:
login - Account in PointLoyalty Manager system.
personalId - Loyalty program member account identifier.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteMemberAccounts

public static void deleteMemberAccounts(LoginBean login,
                                        java.lang.String[] personalIds)
                                 throws PointLoyaltyRestException
Deletes members accounts for PointLoyalty Member Console.

Parameters:
login - Account in PointLoyalty Manager system.
personalIds - Loyalty program member account identifiers.
Throws:
PointLoyaltyRestException - If any errors occur.

deleteAllMemberAccounts

public static void deleteAllMemberAccounts(LoginBean login)
                                    throws PointLoyaltyRestException
Deletes all members accounts, registered in the system.

Parameters:
login - Account in PointLoyalty Manager system.
Throws:
PointLoyaltyRestException - If any errors occur.

isValidClientAccount

public static boolean isValidClientAccount(LoginBean login)
                                    throws PointLoyaltyRestException
Check if there is valid program owner's account in PointLoyalty Manager for this login.

Parameters:
login - Account in PointLoyalty Manager system.
Returns:
true if account is valid.
Throws:
PointLoyaltyRestException - If any errors occur.

isValidMemberAccount

public static boolean isValidMemberAccount(LoginBean login)
                                    throws PointLoyaltyRestException
Check if there is valid member's account in Member Console for this login.

Parameters:
login - Account in Member Console.
Returns:
true if account is valid.
Throws:
PointLoyaltyRestException - If any errors occur.

isCreatedMembersTemplate

public static boolean isCreatedMembersTemplate(LoginBean login,
                                               java.lang.String[] attrs)
                                        throws PointLoyaltyRestException
Check if there are members' templates defined in the system.

Parameters:
login - Account in PointLoyalty Manager system.
attrs - Member attributes names.
Returns:
true if all of them are defined.
Throws:
PointLoyaltyRestException - If any errors occur.

isCreatedAttributesTemplate

public static boolean isCreatedAttributesTemplate(LoginBean login,
                                                  java.lang.String action,
                                                  java.lang.String[] attrs)
                                           throws PointLoyaltyRestException
Check if there is action template with attributes defined in the system.

Parameters:
login - Account in PointLoyalty Manager system.
action - Action name.
attrs - Action attributes' names.
Returns:
true if action with all attributes is defined.
Throws:
PointLoyaltyRestException - If any errors occur.

Pointloyalty Manager; 3.3.0
Java REST access API

Pointloyalty Manager, Loyalty solution software, ver. 3.3.0 (build 44)
2007-2009 Copyright © Pointloyalty, Inc. All Rights Reserved.