Skip to content

Commit 664a534

Browse files
committed
Fixed whatsapp issues, updated CHANGELOG.md
1 parent 762b91b commit 664a534

File tree

78 files changed

+3701
-1926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3701
-1926
lines changed

CHANGELOG.md

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to the library will be documented in this file.
55
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.
77

8-
## [ [6.1.0](https://github.com/infobip/infobip-api-java-client/releases/tag/6.1.0) ] - 2025-04-07
8+
## [ [6.1.0](https://github.com/infobip/infobip-api-java-client/releases/tag/6.1.0) ] - 2025-04-09
99

1010
⚠️ **IMPORTANT NOTE:** This release contains compile time breaking changes.
1111
All changes, including breaking changes, are addressed and explained in the list bellow.
@@ -38,6 +38,13 @@ If you find out that something was not addressed properly, please submit an issu
3838
* **Updated** `CallsSearchResponse.lastUsageDate` field type from `String``LocalDate`.
3939
* **Removed** `EmailWebhookTrackReport` and `EmailWebhookTrackResponse` in favor of a unified class: `EmailWebhookTrackingPayload`.
4040
* **Updated** `FormsRequest.formType` field type from `FormType``String`.
41+
* **Removed** `CallSipTrunkLocation` enum class, now processed as a `String`.
42+
* **Updated** `WhatsAppTemplateEditPublicApiRequest` `category` field: `CategoryEnum` inner enum replaced by the existing `WhatsAppCategory` class enum value.
43+
* **Updated** `WhatsAppTemplatePublicApiRequest` `category` field: `CategoryEnum` inner enum replaced by the existing `WhatsAppCategory` class enum value.
44+
* **Replaced** `WhatsAppWebhookAddress` `type` enum with `String` to support more options.
45+
* **Fixed** `WhatsAppWebhookContact` `birthday` field type: changed from `OffsetDateTime` to `LocalDate`.
46+
* **Removed** `WhatsAppWebhookPaymentNotification` `CurrencyEnum` inner enum class, replaced by the existing `WhatsAppPaymentStatus` class.
47+
* **Removed** `WhatsAppTemplateAllowedOrderPaymentDetails` class, replaced by the unified `WhatsAppInteractiveAllowedOrderPaymentDetails` class.
4148
* Fixed Javadoc.
4249

4350
### Removed
@@ -54,24 +61,24 @@ If you find out that something was not addressed properly, please submit an issu
5461

5562
### Added
5663
* Most recent feature set for:
57-
* [Infobip Messages API](https://www.infobip.com/docs/api/platform/messages-api).
58-
* Footer support for Messages API Message. For additional details check Messages API documentation.
59-
* Add calendar event button support for Messages API Message. For additional details check Messages API documentation.
60-
* Card options for Carousel and Rich Link body types in Messages API Message. For additional details check Messages API documentation.
61-
* [Infobip Voice API](https://www.infobip.com/docs/api/channels/voice).
62-
* Support for Calls Configuration.
63-
* [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms).
64-
* [Infobip 2FA API](https://www.infobip.com/docs/api/platform/2fa).
65-
* [Infobip Email API](https://www.infobip.com/docs/api/channels/email).
66-
* Support for Email IP Management instead of set of deprecated Email IP endpoints. Check [Email API documentation](https://www.infobip.com/docs/api/channels/email) for additional details.
67-
* [Infobip WhatsApp API](https://www.infobip.com/docs/api/channels/whatsapp).
68-
* [Infobip Viber API](https://www.infobip.com/docs/api/channels/viber).
69-
* [Infobip WebRTC API](https://www.infobip.com/docs/api/channels/webrtc-calls).
70-
* [Infobip Moments](https://www.infobip.com/docs/api/customer-engagement/moments).
71-
* [Infobip MMS API](https://www.infobip.com/docs/api/channels/mms).
72-
* Introduced `/mms/2/messages (V2)` replacing the `/mms/1/advanced (V1)` endpoint.
73-
* Introduced `/mms/2/reports (V2)` replacing `/mms/1/reports (V1)` endpoint.
74-
* Introduced `/mms/2/logs (V2)` replacing `/mms/1/logs (V1)` endpoint.
64+
* [Infobip Messages API](https://www.infobip.com/docs/api/platform/messages-api).
65+
* Footer support for Messages API Message. For additional details check Messages API documentation.
66+
* Add calendar event button support for Messages API Message. For additional details check Messages API documentation.
67+
* Card options for Carousel and Rich Link body types in Messages API Message. For additional details check Messages API documentation.
68+
* [Infobip Voice API](https://www.infobip.com/docs/api/channels/voice).
69+
* Support for Calls Configuration.
70+
* [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms).
71+
* [Infobip 2FA API](https://www.infobip.com/docs/api/platform/2fa).
72+
* [Infobip Email API](https://www.infobip.com/docs/api/channels/email).
73+
* Support for Email IP Management instead of set of deprecated Email IP endpoints. Check [Email API documentation](https://www.infobip.com/docs/api/channels/email) for additional details.
74+
* [Infobip WhatsApp API](https://www.infobip.com/docs/api/channels/whatsapp).
75+
* [Infobip Viber API](https://www.infobip.com/docs/api/channels/viber).
76+
* [Infobip WebRTC API](https://www.infobip.com/docs/api/channels/webrtc-calls).
77+
* [Infobip Moments](https://www.infobip.com/docs/api/customer-engagement/moments).
78+
* [Infobip MMS API](https://www.infobip.com/docs/api/channels/mms).
79+
* Introduced `/mms/2/messages (V2)` replacing the `/mms/1/advanced (V1)` endpoint.
80+
* Introduced `/mms/2/reports (V2)` replacing `/mms/1/reports (V1)` endpoint.
81+
* Introduced `/mms/2/logs (V2)` replacing `/mms/1/logs (V1)` endpoint.
7582
* **Added** new Calls error code type: `MACHINE_DETECTED`.
7683
* **Added** support for `CallsProviderSipTrunkUpdateRequest`.
7784
* **Created** `RawJsonDeserializer` to handle raw JSON deserialization.
@@ -91,9 +98,9 @@ If you find out that something was not addressed properly, please submit an issu
9198

9299
- Voice API
93100
- Adjusted IVR models in script processing. Scenario scripting is now implemented as a raw string to increase usability of the feature. Scripts should be passed as strings to the IVR request model in all upcoming SDK versions.
94-
- **Updated** `CallsUpdateScenarioRequest.script` field type from `List<CallsScriptInner>``String`.
95-
- **Updated** `CallsSearchResponse.script` and `else` fields type from `List<Object>``String`.
96-
- **Updated** `CallsUpdateScenarioResponse.script` field type from `Object``String`.
101+
- **Updated** `CallsUpdateScenarioRequest.script` field type from `List<CallsScriptInner>``String`.
102+
- **Updated** `CallsSearchResponse.script` and `else` fields type from `List<Object>``String`.
103+
- **Updated** `CallsUpdateScenarioResponse.script` field type from `Object``String`.
97104
- **Updated** `CallsGetVoicesResponses.voices` field type from `List<CallsVoice>``List<CallsSynthesisVoice>`.
98105
- **Updated** `CallsSearchResponse.lastUsageDate` field type from `OffsetDateTime``String`.
99106
- **Updated** `CallsSpeechCaptureRequest.language` field type from `CallsLanguage``CallTranscriptionLanguage`.
@@ -161,31 +168,31 @@ If you find out that something was not addressed properly, please submit an issu
161168
- **Removed** `fcmServerKey` field from `WebRtcAndroidPushNotificationConfig`.
162169

163170
### Removed:
164-
- Deprecated functions for sending Viber `Image`, `File`, and `Text` messages have been removed. Use `ViberApi.sendViberMessages` to send messages.
165-
- All the Calls IVR script related class and from now on all the scripts are processed as `String`:
166-
- `CallsCallApi`
167-
- `CallsCapture`
168-
- `CallsCollect`
169-
- `CallsDial`
170-
- `CallsDialToMany`
171-
- `CallsDialToWebRTC`
172-
- `CallsDialToConversations`
173-
- `CallsForEach`
174-
- `CallsGoTo`
175-
- `CallsHangup`
176-
- `CallsIfThenElse`
177-
- `CallsMachineDetection`
178-
- `CallsPause`
179-
- `CallsPlay`
180-
- `CallsPlayFromRecording`
181-
- `CallsRecord`
182-
- `CallsRepeatUntil`
183-
- `CallsRepeatWhile`
184-
- `CallsSay`
185-
- `CallsSendSms`
186-
- `CallsSetVariable`
187-
- `CallsSwitchCase`
188-
- `CallsWhileDo`
171+
- Deprecated functions for sending Viber `Image`, `File`, and `Text` messages have been removed. Use `ViberApi.sendViberMessages` to send messages.
172+
- All the Calls IVR script related class and from now on all the scripts are processed as `String`:
173+
- `CallsCallApi`
174+
- `CallsCapture`
175+
- `CallsCollect`
176+
- `CallsDial`
177+
- `CallsDialToMany`
178+
- `CallsDialToWebRTC`
179+
- `CallsDialToConversations`
180+
- `CallsForEach`
181+
- `CallsGoTo`
182+
- `CallsHangup`
183+
- `CallsIfThenElse`
184+
- `CallsMachineDetection`
185+
- `CallsPause`
186+
- `CallsPlay`
187+
- `CallsPlayFromRecording`
188+
- `CallsRecord`
189+
- `CallsRepeatUntil`
190+
- `CallsRepeatWhile`
191+
- `CallsSay`
192+
- `CallsSendSms`
193+
- `CallsSetVariable`
194+
- `CallsSwitchCase`
195+
- `CallsWhileDo`
189196

190197
These changes align the SDK with the current API specification, ensuring consistency and reliability in future updates.
191198

src/main/java/com/infobip/api/WhatsAppApi.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package com.infobip.api;
1111

1212
import com.fasterxml.jackson.core.type.TypeReference;
13-
import com.google.common.annotations.Beta;
1413
import com.infobip.ApiCallback;
1514
import com.infobip.ApiClient;
1615
import com.infobip.ApiException;
@@ -141,7 +140,6 @@ public okhttp3.Call executeAsync(ApiCallback<WhatsAppSenderRegistrationResponse>
141140
* @return AddWhatsappSenderRequest
142141
* @see <a href="https://www.infobip.com/docs/whatsapp">Learn more about WhatsApp channel and use cases</a>
143142
*/
144-
@Beta
145143
public AddWhatsappSenderRequest addWhatsappSender(
146144
Long businessAccountId, WhatsAppPhoneNumberRequest whatsAppPhoneNumberRequest) {
147145
return new AddWhatsappSenderRequest(businessAccountId, whatsAppPhoneNumberRequest);
@@ -1344,7 +1342,6 @@ public okhttp3.Call executeAsync(ApiCallback<Void> callback) {
13441342
* @return RetryWhatsappSenderVerificationRequest
13451343
* @see <a href="https://www.infobip.com/docs/whatsapp">Learn more about WhatsApp channel and use cases</a>
13461344
*/
1347-
@Beta
13481345
public RetryWhatsappSenderVerificationRequest retryWhatsappSenderVerification(
13491346
String sender, WhatsAppOtpRequest whatsAppOtpRequest) {
13501347
return new RetryWhatsappSenderVerificationRequest(sender, whatsAppOtpRequest);
@@ -2394,7 +2391,6 @@ public okhttp3.Call executeAsync(ApiCallback<WhatsAppSingleMessageInfo> callback
23942391
* @return SendWhatsappInteractiveOrderDetailsMessageRequest
23952392
* @see <a href="https://www.infobip.com/docs/whatsapp">Learn more about WhatsApp channel and use cases</a>
23962393
*/
2397-
@Beta
23982394
public SendWhatsappInteractiveOrderDetailsMessageRequest sendWhatsappInteractiveOrderDetailsMessage(
23992395
WhatsAppInteractiveOrderDetailsMessage whatsAppInteractiveOrderDetailsMessage) {
24002396
return new SendWhatsappInteractiveOrderDetailsMessageRequest(whatsAppInteractiveOrderDetailsMessage);
@@ -2464,7 +2460,6 @@ public okhttp3.Call executeAsync(ApiCallback<WhatsAppSingleMessageInfo> callback
24642460
* @return SendWhatsappInteractiveOrderStatusMessageRequest
24652461
* @see <a href="https://www.infobip.com/docs/whatsapp">Learn more about WhatsApp channel and use cases</a>
24662462
*/
2467-
@Beta
24682463
public SendWhatsappInteractiveOrderStatusMessageRequest sendWhatsappInteractiveOrderStatusMessage(
24692464
WhatsAppInteractiveOrderStatusMessage whatsAppInteractiveOrderStatusMessage) {
24702465
return new SendWhatsappInteractiveOrderStatusMessageRequest(whatsAppInteractiveOrderStatusMessage);
@@ -2667,7 +2662,6 @@ public okhttp3.Call executeAsync(ApiCallback<Void> callback) {
26672662
* @return VerifyWhatsappSenderRequest
26682663
* @see <a href="https://www.infobip.com/docs/whatsapp">Learn more about WhatsApp channel and use cases</a>
26692664
*/
2670-
@Beta
26712665
public VerifyWhatsappSenderRequest verifyWhatsappSender(
26722666
String sender, WhatsAppVerifyCodeRequest whatsAppVerifyCodeRequest) {
26732667
return new VerifyWhatsappSenderRequest(sender, whatsAppVerifyCodeRequest);

src/main/java/com/infobip/model/CallRoutingDestination.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public abstract class CallRoutingDestination {
3030

3131
private Integer priority;
3232

33+
private Integer weight;
34+
3335
protected final CallRoutingDestinationType type;
3436

3537
/**
@@ -39,8 +41,6 @@ public CallRoutingDestination(String type) {
3941
this.type = CallRoutingDestinationType.fromValue(type);
4042
}
4143

42-
private Integer weight;
43-
4444
/**
4545
* Sets priority.
4646
* <p>
@@ -81,18 +81,6 @@ public void setPriority(Integer priority) {
8181
this.priority = priority;
8282
}
8383

84-
/**
85-
* Returns type.
86-
* <p>
87-
* The field is required.
88-
*
89-
* @return type
90-
*/
91-
@JsonProperty("type")
92-
public CallRoutingDestinationType getType() {
93-
return type;
94-
}
95-
9684
/**
9785
* Sets weight.
9886
* <p>
@@ -133,6 +121,18 @@ public void setWeight(Integer weight) {
133121
this.weight = weight;
134122
}
135123

124+
/**
125+
* Returns type.
126+
* <p>
127+
* The field is required.
128+
*
129+
* @return type
130+
*/
131+
@JsonProperty("type")
132+
public CallRoutingDestinationType getType() {
133+
return type;
134+
}
135+
136136
@Override
137137
public boolean equals(Object o) {
138138
if (this == o) {
@@ -143,13 +143,13 @@ public boolean equals(Object o) {
143143
}
144144
CallRoutingDestination callRoutingDestination = (CallRoutingDestination) o;
145145
return Objects.equals(this.priority, callRoutingDestination.priority)
146-
&& Objects.equals(this.type, callRoutingDestination.type)
147-
&& Objects.equals(this.weight, callRoutingDestination.weight);
146+
&& Objects.equals(this.weight, callRoutingDestination.weight)
147+
&& Objects.equals(this.type, callRoutingDestination.type);
148148
}
149149

150150
@Override
151151
public int hashCode() {
152-
return Objects.hash(priority, type, weight);
152+
return Objects.hash(priority, weight, type);
153153
}
154154

155155
@Override
@@ -161,12 +161,12 @@ public String toString() {
161161
.append(" priority: ")
162162
.append(toIndentedString(priority))
163163
.append(newLine)
164-
.append(" type: ")
165-
.append(toIndentedString(type))
166-
.append(newLine)
167164
.append(" weight: ")
168165
.append(toIndentedString(weight))
169166
.append(newLine)
167+
.append(" type: ")
168+
.append(toIndentedString(type))
169+
.append(newLine)
170170
.append("}")
171171
.toString();
172172
}

src/main/java/com/infobip/model/CallRoutingPhoneEndpoint.java

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
public class CallRoutingPhoneEndpoint extends CallRoutingEndpoint {
1919

20+
private String from;
21+
2022
private String phoneNumber;
2123

2224
/**
@@ -26,11 +28,51 @@ public CallRoutingPhoneEndpoint() {
2628
super("PHONE");
2729
}
2830

31+
/**
32+
* Sets from.
33+
* <p>
34+
* Field description:
35+
* Phone number in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Defaults to &#x60;from&#x60; value used in inbound call.
36+
*
37+
* @param from
38+
* @return This {@link CallRoutingPhoneEndpoint instance}.
39+
*/
40+
public CallRoutingPhoneEndpoint from(String from) {
41+
this.from = from;
42+
return this;
43+
}
44+
45+
/**
46+
* Returns from.
47+
* <p>
48+
* Field description:
49+
* Phone number in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Defaults to &#x60;from&#x60; value used in inbound call.
50+
*
51+
* @return from
52+
*/
53+
@JsonProperty("from")
54+
public String getFrom() {
55+
return from;
56+
}
57+
58+
/**
59+
* Sets from.
60+
* <p>
61+
* Field description:
62+
* Phone number in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Defaults to &#x60;from&#x60; value used in inbound call.
63+
*
64+
* @param from
65+
*/
66+
@JsonProperty("from")
67+
public void setFrom(String from) {
68+
this.from = from;
69+
}
70+
2971
/**
3072
* Sets phoneNumber.
3173
* <p>
3274
* Field description:
33-
* Phone number in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Defaults to &#x60;to&#x60; value used in inbound call.
75+
* Phone number in the [E.164] format. Defaults to &#x60;to&#x60; value used in inbound call.
3476
*
3577
* @param phoneNumber
3678
* @return This {@link CallRoutingPhoneEndpoint instance}.
@@ -44,7 +86,7 @@ public CallRoutingPhoneEndpoint phoneNumber(String phoneNumber) {
4486
* Returns phoneNumber.
4587
* <p>
4688
* Field description:
47-
* Phone number in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Defaults to &#x60;to&#x60; value used in inbound call.
89+
* Phone number in the [E.164] format. Defaults to &#x60;to&#x60; value used in inbound call.
4890
*
4991
* @return phoneNumber
5092
*/
@@ -57,7 +99,7 @@ public String getPhoneNumber() {
5799
* Sets phoneNumber.
58100
* <p>
59101
* Field description:
60-
* Phone number in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Defaults to &#x60;to&#x60; value used in inbound call.
102+
* Phone number in the [E.164] format. Defaults to &#x60;to&#x60; value used in inbound call.
61103
*
62104
* @param phoneNumber
63105
*/
@@ -75,12 +117,14 @@ public boolean equals(Object o) {
75117
return false;
76118
}
77119
CallRoutingPhoneEndpoint callRoutingPhoneEndpoint = (CallRoutingPhoneEndpoint) o;
78-
return Objects.equals(this.phoneNumber, callRoutingPhoneEndpoint.phoneNumber) && super.equals(o);
120+
return Objects.equals(this.from, callRoutingPhoneEndpoint.from)
121+
&& Objects.equals(this.phoneNumber, callRoutingPhoneEndpoint.phoneNumber)
122+
&& super.equals(o);
79123
}
80124

81125
@Override
82126
public int hashCode() {
83-
return Objects.hash(phoneNumber, super.hashCode());
127+
return Objects.hash(from, phoneNumber, super.hashCode());
84128
}
85129

86130
@Override
@@ -92,6 +136,9 @@ public String toString() {
92136
.append(" ")
93137
.append(toIndentedString(super.toString()))
94138
.append(newLine)
139+
.append(" from: ")
140+
.append(toIndentedString(from))
141+
.append(newLine)
95142
.append(" phoneNumber: ")
96143
.append(toIndentedString(phoneNumber))
97144
.append(newLine)

0 commit comments

Comments
 (0)