@@ -39,7 +39,7 @@ Add this dependency to your project's POM:
39
39
<dependency >
40
40
<groupId >one.talon</groupId >
41
41
<artifactId >talon-one-client</artifactId >
42
- <version >3.1.0 </version >
42
+ <version >3.2.1 </version >
43
43
<scope >compile</scope >
44
44
</dependency >
45
45
```
@@ -49,7 +49,7 @@ Add this dependency to your project's POM:
49
49
Add this dependency to your project's build file:
50
50
51
51
``` groovy
52
- compile "one.talon:talon-one-client:3.0.0 "
52
+ compile "one.talon:talon-one-client:3.2.1 "
53
53
```
54
54
55
55
### Others
@@ -62,13 +62,15 @@ mvn clean package
62
62
63
63
Then manually install the following JARs:
64
64
65
- * ` target/talon-one-client-3.0.0 .jar `
65
+ * ` target/talon-one-client-3.2.1 .jar `
66
66
* ` target/lib/*.jar `
67
67
68
68
## Getting Started
69
69
70
70
Please follow the [ installation] ( #installation ) instruction and execute the following Java code:
71
71
72
+ ### Integration API
73
+
72
74
``` java
73
75
package com.example.consumer ;
74
76
@@ -79,49 +81,68 @@ import one.talon.model.*;
79
81
80
82
public class TalonApiTest {
81
83
public static void main (String [] args ) {
84
+ ApiClient iApiClient = new ApiClient (" api_key_v1" );
85
+ IntegrationApi iApi = new IntegrationApi (iApiClient );
86
+
87
+ // Setup: basePath, apiKeyPrefix and apiKey
88
+ iApi. getApiClient(). setBasePath(" https://mycompany.talon.one" );
89
+ iApi. getApiClient(). setApiKeyPrefix(" ApiKey-v1" );
90
+ iApi. getApiClient(). setApiKey(" dbc644d33aa74d582bd9479c59e16f970fe13bf34a208c39d6c7fa7586968468" );
82
91
83
- // Management API
92
+ try {
93
+ // Integration API example to send a session update
94
+ NewCustomerSession customerSession = new NewCustomerSession ();
95
+ customerSession. setProfileId(" Cool_Dude" );
96
+ customerSession. setState(" open" );
97
+ customerSession. setTotal(42.0 );
98
+
99
+ // Create/update a customer session using `updateCustomerSession` function
100
+ IntegrationState ie = iApi. updateCustomerSession(" deetdoot" , customerSession);
101
+ System . out. println(ie. toString());
102
+ } catch (Exception e) {
103
+ System . out. println(e);
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Management API
110
+
111
+ ``` java
112
+ package com.example.consumer ;
113
+
114
+ import one.talon.ApiClient ;
115
+ import one.talon.api.IntegrationApi ;
116
+ import one.talon.api.ManagementApi ;
117
+ import one.talon.model.* ;
118
+
119
+ public class TalonApiTest {
120
+ public static void main (String [] args ) {
121
+ // Management API example to load application with id 7
84
122
ApiClient mApiClient = new ApiClient (" manager_auth" );
85
123
ManagementApi mApi = new ManagementApi (mApiClient);
86
- mApi. getApiClient(). setBasePath(" http://localhost" );
124
+
125
+ // Setup: basePath and bearer prefix
126
+ mApi. getApiClient(). setBasePath(" https://mycompany.talon.one" );
87
127
mApi. getApiClient(). setApiKeyPrefix(" Bearer" );
128
+
88
129
LoginParams lp = new LoginParams ();
89
- lp. setEmail(" demo @talon.one" );
130
+ lp. setEmail(" admin @talon.one" );
90
131
lp. setPassword(" yourpassword" );
91
132
92
133
try {
134
+ // Acquire session token
93
135
Session s = mApi. createSession(lp);
94
136
mApi. getApiClient(). setApiKey(s. getToken());
95
- Account acc = mApi. getAccount(1 );
96
- System . out. println(acc. toString());
97
-
98
- System . out. println(mApi. getRuleset(1 , 1 , 1 ));
99
- } catch (Exception e) {
100
- System . out. println(e);
101
- }
102
-
103
- // Integration API
104
- ApiClient iApiClient = new ApiClient (" integration_auth" );
105
- IntegrationApi iApi = new IntegrationApi (iApiClient );
106
- // setup: applicationId, applicationKey, basePath, apiKeyPrefix and apiKey
107
- iApi. getApiClient(). setApplicationId(" 1" );
108
- iApi. getApiClient(). setApplicationKey(" 2f276f93baf3d415" );
109
- iApi. getApiClient(). setBasePath(" http://localhost" );
110
- iApi. getApiClient(). setApiKeyPrefix(" ApiKey-v1" );
111
- iApi. getApiClient(). setApiKey(" dbc644d33aa74d582bd9479c59e16f970fe13bf34a208c39d6c7fa7586968468" );
112
- // regarding 'Content-Signature' signing the request body is in process of deprecation
113
- // therefore enforced to do in the client side
114
137
115
- try {
116
- NewCustomerProfile body = new NewCustomerProfile ();
117
- IntegrationState ie = iApi. updateCustomerProfile(" testCustomerProfile" , body);
118
- System . out. println(ie. toString());
138
+ // Calling `getApplication` function with the desired id (7)
139
+ Application application = mApi. getApplication(7 );
140
+ System . out. println(application. toString());
119
141
} catch (Exception e) {
120
142
System . out. println(e);
121
143
}
122
144
}
123
145
}
124
-
125
146
```
126
147
127
148
## Documentation for API Endpoints
@@ -130,8 +151,12 @@ All URIs are relative to *http://localhost*
130
151
131
152
Class | Method | HTTP request | Description
132
153
------------ | ------------- | ------------- | -------------
154
+ * IntegrationApi* | [ ** createCouponReservation** ] ( docs/IntegrationApi.md#createCouponReservation ) | ** POST** /v1/coupon_reservations/{couponValue} | Create a new coupon reservation
133
155
* IntegrationApi* | [ ** createReferral** ] ( docs/IntegrationApi.md#createReferral ) | ** POST** /v1/referrals | Create a referral code for an advocate
156
+ * IntegrationApi* | [ ** deleteCouponReservation** ] ( docs/IntegrationApi.md#deleteCouponReservation ) | ** DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations
134
157
* IntegrationApi* | [ ** deleteCustomerData** ] ( docs/IntegrationApi.md#deleteCustomerData ) | ** DELETE** /v1/customer_data/{integrationId} | Delete the personal data of a customer.
158
+ * IntegrationApi* | [ ** getReservedCoupons** ] ( docs/IntegrationApi.md#getReservedCoupons ) | ** GET** /v1/coupon_reservations/coupons/{integrationId} | Get all valid reserved coupons
159
+ * IntegrationApi* | [ ** getReservedCustomers** ] ( docs/IntegrationApi.md#getReservedCustomers ) | ** GET** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved
135
160
* IntegrationApi* | [ ** trackEvent** ] ( docs/IntegrationApi.md#trackEvent ) | ** POST** /v1/events | Track an Event
136
161
* IntegrationApi* | [ ** updateCustomerProfile** ] ( docs/IntegrationApi.md#updateCustomerProfile ) | ** PUT** /v1/customer_profiles/{integrationId} | Update a Customer Profile
137
162
* IntegrationApi* | [ ** updateCustomerSession** ] ( docs/IntegrationApi.md#updateCustomerSession ) | ** PUT** /v1/customer_sessions/{customerSessionId} | Update a Customer Session
@@ -254,6 +279,7 @@ Class | Method | HTTP request | Description
254
279
- [ Coupon] ( docs/Coupon.md )
255
280
- [ CouponConstraints] ( docs/CouponConstraints.md )
256
281
- [ CouponRejectionReason] ( docs/CouponRejectionReason.md )
282
+ - [ CouponReservations] ( docs/CouponReservations.md )
257
283
- [ CouponSearch] ( docs/CouponSearch.md )
258
284
- [ CouponValue] ( docs/CouponValue.md )
259
285
- [ CreateApplicationAPIKey] ( docs/CreateApplicationAPIKey.md )
@@ -297,6 +323,7 @@ Class | Method | HTTP request | Description
297
323
- [ InlineResponse20025] ( docs/InlineResponse20025.md )
298
324
- [ InlineResponse20026] ( docs/InlineResponse20026.md )
299
325
- [ InlineResponse20027] ( docs/InlineResponse20027.md )
326
+ - [ InlineResponse20028] ( docs/InlineResponse20028.md )
300
327
- [ InlineResponse2003] ( docs/InlineResponse2003.md )
301
328
- [ InlineResponse2004] ( docs/InlineResponse2004.md )
302
329
- [ InlineResponse2005] ( docs/InlineResponse2005.md )
@@ -318,6 +345,8 @@ Class | Method | HTTP request | Description
318
345
- [ LoyaltyPoints] ( docs/LoyaltyPoints.md )
319
346
- [ LoyaltyProgram] ( docs/LoyaltyProgram.md )
320
347
- [ LoyaltyProgramBalance] ( docs/LoyaltyProgramBalance.md )
348
+ - [ LoyaltyProgramLedgers] ( docs/LoyaltyProgramLedgers.md )
349
+ - [ LoyaltySubLedger] ( docs/LoyaltySubLedger.md )
321
350
- [ ManagerConfig] ( docs/ManagerConfig.md )
322
351
- [ Meta] ( docs/Meta.md )
323
352
- [ MiscUpdateUserLatestFeature] ( docs/MiscUpdateUserLatestFeature.md )
@@ -378,6 +407,12 @@ Class | Method | HTTP request | Description
378
407
## Documentation for Authorization
379
408
380
409
Authentication schemes defined for the API:
410
+ ### api_key_v1
411
+
412
+ - ** Type** : API key
413
+ - ** API key parameter name** : Authorization
414
+ - ** Location** : HTTP header
415
+
381
416
### integration_auth
382
417
383
418
- ** Type** : API key
0 commit comments