Skip to content

Commit

Permalink
v4.3.0: Multiple personal coupons creation endpoint, Loyalty related …
Browse files Browse the repository at this point in the history
…counters and Export Endpoints (#18)

## Summary

### Management API

#### Introduce [`createCouponsForMultipleRecipients`](https://github.com/talon-one/TalonOneJavaSdk/blob/7d13f26c14b1436376a1608f52f9c8bef96e448b/docs/ManagementApi.md#createCouponsForMultipleRecipients)

An endpoint/operation to allow creation of multiple coupons of the same configuration for up to 1,000 recipients at once.

#### Expose our export endpoints as integral part of the SDK

All of our CSV export operations are accessible via the Web Application from the corresponding entity pages (refer to our [Help Center](https://help.talon.one/hc/en-us/articles/360010114599-Import-and-Export-Coupons#ExportExistingCodes) for an example regarding Coupons).

Now these are also available operations as part of the SDK (links to our developer docs):
 - [Coupons Export](https://developers.talon.one/Management-API/API-Reference#exportCoupons)
 - [Customer Sessions Export](https://developers.talon.one/Management-API/API-Reference#exportCustomerSessions)
 - [Effects Export](https://developers.talon.one/Management-API/API-Reference#exportEffects)
 - [Customer Loyalty Balance Export](https://developers.talon.one/Management-API/API-Reference#exportLoyaltyBalance)

Example code snippet demonstrating consuming and printing the lines of a _Customer Loyalty Balance Export_ using the `java.nio.file.Files` package:
```java
import java.io.File;
import java.nio.file.Files;

import one.talon.ApiClient;
import one.talon.api.ManagementApi;
import one.talon.model.*;

// ...preparing api client...
// An example could be seen at the repository's README file: https://github.com/talon-one/TalonOneJavaSdk#management-api

try {
    String programID = "1"; // loyalty program identifier
    File response = api.exportLoyaltyBalance(programID);
    List<String> contents = Files.readAllLines(response.toPath());
    System.out.println(contents);
} catch (Exception e) {
    System.out.println(e);
}
```

#### Expose [`destroySession`](https://github.com/talon-one/TalonOneJavaSdk/blob/7d13f26c14b1436376a1608f52f9c8bef96e448b/docs/ManagementApi.md#destroysession)

Expose an already existed endpoint to allow destroying a bearer token used in the context of the management-api.
This endpoint imitates a "logout" operation and will make the attached token invalid for consequent requests.

#### Introduce loyalty effects related counters on Campaign entities

As part of the newly added budgets to campaigns (see relevant [Help Center Section](https://help.talon.one/hc/en-us/articles/360010114779-Campaign-Budget#LoyaltyLimits)), we now count and expose four new counters on campaigns with regard to loyalty:

 - `createdLoyaltyPointsCount` : Total number of loyalty points created by rules in this campaign
 - `createdLoyaltyPointsEffectCount` : Total number of loyalty point creation effects triggered by rules in this campaign
 - `redeemedLoyaltyPointsCount` : Total number of loyalty points redeemed by rules in this campaign
 - `redeemedLoyaltyPointsEffectCount` : Total number of loyalty point redemption effects triggered by rules in this campaign

#### ⚠️⚠️ Breaking Change: Fix Campaign's `discountCount` type from Integer to BigDecimal

Campaign's `discountCount` counter property was all along calculated as a floating decimal number by our system.

From this release on the returned values will be floating decimals and not cut-off integers:

```diff
-**discountCount** | **Integer** | Total amount of discounts redeemed in the campaign. |  [optional]
+**discountCount** | [**BigDecimal**](BigDecimal.md) | Total amount of discounts redeemed in the campaign. |  [optional]
```

### Integration API

#### ⚠️ A reminder of The Deprecation Notice: Integration API@v1 endpoints
The deprecation was introduced already in the last release of the SDK, here is a kind reminder of the deprecation notices for Integration API@v1 endpoints:

 - [Update a Customer Session (V1)](https://github.com/talon-one/TalonOneJavaSdk/blob/85dc9bf8acf75cf02f6504af7d0228a049dae569/docs/IntegrationApi.md#updateCustomerSession)
 - [Update a Customer Profile (V1)](https://github.com/talon-one/TalonOneJavaSdk/blob/85dc9bf8acf75cf02f6504af7d0228a049dae569/docs/IntegrationApi.md#updateCustomerProfile)

These endpoints will be flagged deprecated on _15.07.2021_, meaning support for requests to these endpoints will end on that date. **We will not remove the endpoints**, and they will still be accessible for you to use.

We highly encourage migrating to the correspondent v2 endpoints for easier and more granular integration, as well as new features support (See [our developer docs section](https://developers.talon.one/Getting-Started/APIV2) about API V2.0).

### Misc: Bump junit from 4.13 to 4.13.1

As per [Pull Request #17](#17), we have bumped the version of the `junit` library dependency to `4.13.1`, after an alert regarding a security vulnerability with the former `4.13`.

## Commit Summary:

* Initial Commit
* Fix management api export endpoints
  • Loading branch information
altJake authored Dec 14, 2020
1 parent 6815663 commit 3ce141f
Show file tree
Hide file tree
Showing 103 changed files with 5,480 additions and 2,181 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>one.talon</groupId>
<artifactId>talon-one-client</artifactId>
<version>4.2.0</version>
<version>4.3.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -59,7 +59,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "one.talon:talon-one-client:4.2.0"
compile "one.talon:talon-one-client:4.3.0"
```

### Others
Expand All @@ -72,13 +72,12 @@ mvn clean package

Then manually install the following JARs:

* `target/talon-one-client-4.2.0.jar`
* `target/talon-one-client-4.3.0.jar`
* `target/lib/*.jar`

## Getting Started

Please follow the [installation](#installation) instruction and execute the following Java code:

### Integration API

#### V2
Expand Down Expand Up @@ -267,6 +266,7 @@ Class | Method | HTTP request | Description
*ManagementApi* | [**createAttribute**](docs/ManagementApi.md#createAttribute) | **POST** /v1/attributes | Define a new custom attribute
*ManagementApi* | [**createCampaign**](docs/ManagementApi.md#createCampaign) | **POST** /v1/applications/{applicationId}/campaigns | Create a Campaign
*ManagementApi* | [**createCoupons**](docs/ManagementApi.md#createCoupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Create Coupons
*ManagementApi* | [**createCouponsForMultipleRecipients**](docs/ManagementApi.md#createCouponsForMultipleRecipients) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients | Create Coupons for Multiple Recipients
*ManagementApi* | [**createPasswordRecoveryEmail**](docs/ManagementApi.md#createPasswordRecoveryEmail) | **POST** /v1/password_recovery_emails | Request a password reset
*ManagementApi* | [**createRuleset**](docs/ManagementApi.md#createRuleset) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets | Create a Ruleset
*ManagementApi* | [**createSession**](docs/ManagementApi.md#createSession) | **POST** /v1/sessions | Create a Session
Expand All @@ -275,6 +275,11 @@ Class | Method | HTTP request | Description
*ManagementApi* | [**deleteCoupons**](docs/ManagementApi.md#deleteCoupons) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Delete Coupons
*ManagementApi* | [**deleteReferral**](docs/ManagementApi.md#deleteReferral) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Delete one Referral
*ManagementApi* | [**deleteRuleset**](docs/ManagementApi.md#deleteRuleset) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Delete a Ruleset
*ManagementApi* | [**destroySession**](docs/ManagementApi.md#destroySession) | **DELETE** /v1/sessions | Destroy a Session
*ManagementApi* | [**exportCoupons**](docs/ManagementApi.md#exportCoupons) | **GET** /v1/applications/{applicationId}/export_coupons | Export Coupons to a CSV file.
*ManagementApi* | [**exportCustomerSessions**](docs/ManagementApi.md#exportCustomerSessions) | **GET** /v1/applications/{applicationId}/export_customer_sessions | Export Customer Sessions to a CSV file.
*ManagementApi* | [**exportEffects**](docs/ManagementApi.md#exportEffects) | **GET** /v1/applications/{applicationId}/export_effects | Export triggered Effects to a CSV file.
*ManagementApi* | [**exportLoyaltyBalance**](docs/ManagementApi.md#exportLoyaltyBalance) | **GET** /v1/loyalty_programs/{programID}/export_customer_balance | Export customer loyalty balance to a CSV file
*ManagementApi* | [**getAccessLogs**](docs/ManagementApi.md#getAccessLogs) | **GET** /v1/applications/{applicationId}/access_logs | Get access logs for application (with total count)
*ManagementApi* | [**getAccessLogsWithoutTotalCount**](docs/ManagementApi.md#getAccessLogsWithoutTotalCount) | **GET** /v1/applications/{applicationId}/access_logs/no_total | Get access logs for application
*ManagementApi* | [**getAccount**](docs/ManagementApi.md#getAccount) | **GET** /v1/accounts/{accountId} | Get Account Details
Expand All @@ -296,6 +301,7 @@ Class | Method | HTTP request | Description
*ManagementApi* | [**getApplications**](docs/ManagementApi.md#getApplications) | **GET** /v1/applications | List Applications
*ManagementApi* | [**getAttribute**](docs/ManagementApi.md#getAttribute) | **GET** /v1/attributes/{attributeId} | Get a custom attribute
*ManagementApi* | [**getAttributes**](docs/ManagementApi.md#getAttributes) | **GET** /v1/attributes | List custom attributes
*ManagementApi* | [**getAudiences**](docs/ManagementApi.md#getAudiences) | **GET** /v1/audiences | Get all audiences
*ManagementApi* | [**getCampaign**](docs/ManagementApi.md#getCampaign) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId} | Get a Campaign
*ManagementApi* | [**getCampaignAnalytics**](docs/ManagementApi.md#getCampaignAnalytics) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns
*ManagementApi* | [**getCampaignByAttributes**](docs/ManagementApi.md#getCampaignByAttributes) | **POST** /v1/applications/{applicationId}/campaigns_search | Get a list of all campaigns that match the given attributes
Expand All @@ -314,7 +320,6 @@ Class | Method | HTTP request | Description
*ManagementApi* | [**getCustomersByAttributes**](docs/ManagementApi.md#getCustomersByAttributes) | **POST** /v1/customer_search/no_total | Get a list of the customer profiles that match the given attributes
*ManagementApi* | [**getEventTypes**](docs/ManagementApi.md#getEventTypes) | **GET** /v1/event_types | List Event Types
*ManagementApi* | [**getExports**](docs/ManagementApi.md#getExports) | **GET** /v1/exports | Get Exports
*ManagementApi* | [**getImports**](docs/ManagementApi.md#getImports) | **GET** /v1/imports | Get Imports
*ManagementApi* | [**getLoyaltyPoints**](docs/ManagementApi.md#getLoyaltyPoints) | **GET** /v1/loyalty_programs/{programID}/profile/{integrationID} | get the Loyalty Ledger for this integrationID
*ManagementApi* | [**getLoyaltyProgram**](docs/ManagementApi.md#getLoyaltyProgram) | **GET** /v1/loyalty_programs/{programID} | Get a loyalty program
*ManagementApi* | [**getLoyaltyPrograms**](docs/ManagementApi.md#getLoyaltyPrograms) | **GET** /v1/loyalty_programs | List all loyalty Programs
Expand Down Expand Up @@ -387,7 +392,6 @@ Class | Method | HTTP request | Description
- [CampaignSetLeafNode](docs/CampaignSetLeafNode.md)
- [CampaignSetNode](docs/CampaignSetNode.md)
- [CartItem](docs/CartItem.md)
- [CartItemAdjustment](docs/CartItemAdjustment.md)
- [Change](docs/Change.md)
- [ChangeProfilePassword](docs/ChangeProfilePassword.md)
- [CodeGeneratorSettings](docs/CodeGeneratorSettings.md)
Expand Down Expand Up @@ -428,7 +432,6 @@ Class | Method | HTTP request | Description
- [FeedNotification](docs/FeedNotification.md)
- [FuncArgDef](docs/FuncArgDef.md)
- [FunctionDef](docs/FunctionDef.md)
- [ImportCoupons](docs/ImportCoupons.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [InlineResponse2001](docs/InlineResponse2001.md)
- [InlineResponse20010](docs/InlineResponse20010.md)
Expand Down Expand Up @@ -499,13 +502,13 @@ Class | Method | HTTP request | Description
- [NewCampaignGroup](docs/NewCampaignGroup.md)
- [NewCampaignSet](docs/NewCampaignSet.md)
- [NewCoupons](docs/NewCoupons.md)
- [NewCouponsForMultipleRecipients](docs/NewCouponsForMultipleRecipients.md)
- [NewCustomerProfile](docs/NewCustomerProfile.md)
- [NewCustomerSession](docs/NewCustomerSession.md)
- [NewCustomerSessionV2](docs/NewCustomerSessionV2.md)
- [NewEvent](docs/NewEvent.md)
- [NewEventType](docs/NewEventType.md)
- [NewFeatureFlags](docs/NewFeatureFlags.md)
- [NewImport](docs/NewImport.md)
- [NewInvitation](docs/NewInvitation.md)
- [NewInviteEmail](docs/NewInviteEmail.md)
- [NewLoyaltyProgram](docs/NewLoyaltyProgram.md)
Expand All @@ -519,6 +522,7 @@ Class | Method | HTTP request | Description
- [NewUser](docs/NewUser.md)
- [NewWebhook](docs/NewWebhook.md)
- [Notification](docs/Notification.md)
- [ProfileAudiencesChanges](docs/ProfileAudiencesChanges.md)
- [RedeemReferralEffectProps](docs/RedeemReferralEffectProps.md)
- [Referral](docs/Referral.md)
- [ReferralCreatedEffectProps](docs/ReferralCreatedEffectProps.md)
Expand All @@ -528,7 +532,9 @@ Class | Method | HTTP request | Description
- [Role](docs/Role.md)
- [RoleAssign](docs/RoleAssign.md)
- [RoleMembership](docs/RoleMembership.md)
- [RollbackAddedLoyaltyPointsEffectProps](docs/RollbackAddedLoyaltyPointsEffectProps.md)
- [RollbackCouponEffectProps](docs/RollbackCouponEffectProps.md)
- [RollbackDeductedLoyaltyPointsEffectProps](docs/RollbackDeductedLoyaltyPointsEffectProps.md)
- [RollbackDiscountEffectProps](docs/RollbackDiscountEffectProps.md)
- [Rule](docs/Rule.md)
- [Ruleset](docs/Ruleset.md)
Expand Down
Loading

0 comments on commit 3ce141f

Please sign in to comment.