Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to the library will be documented in this file.
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.

## [ [6.1.1](https://github.com/infobip/infobip-api-java-client/releases/tag/6.1.1) ] - 2025-06-20

### Added
* Most recent feature set for [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms).
* Cursor-based pagination support in `getOutboundSmsMessageLogs` function with `useCursor` and `cursor` parameters.

### Changed
* `SmsLogsResponse` now includes cursor field to support cursor-based pagination.
* Updated Javadoc documentation for `SmsMessageDeliveryReporting`.

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

⚠️ **IMPORTANT NOTE:** This release contains compile time breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Simply add the following in your project's POM file under `dependencies` tag:
<dependency>
<groupId>com.infobip</groupId>
<artifactId>infobip-api-java-client</artifactId>
<version>6.1.0</version>
<version>6.1.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.infobip</groupId>
<artifactId>infobip-api-java-client</artifactId>
<version>6.1.0</version>
<version>6.1.1</version>
<packaging>jar</packaging>

<name>infobip-api-java-client</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/infobip/RequestFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
final class RequestFactory {

private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.1.0";
private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.1.1";

private final ApiKey apiKey;
private final BaseUrl baseUrl;
Expand Down
50 changes: 43 additions & 7 deletions src/main/java/com/infobip/api/SmsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ private RequestDefinition getOutboundSmsMessageLogsDefinition(
Integer limit,
String entityId,
String applicationId,
List<String> campaignReferenceId) {
List<String> campaignReferenceId,
Boolean useCursor,
String cursor) {
RequestDefinition.Builder builder = RequestDefinition.builder("GET", "/sms/3/logs")
.requiresAuthentication(true)
.accept("application/json");
Expand Down Expand Up @@ -381,6 +383,12 @@ private RequestDefinition getOutboundSmsMessageLogsDefinition(
builder.addQueryParameter(new Parameter("campaignReferenceId", parameterItem));
}
}
if (useCursor != null) {
builder.addQueryParameter(new Parameter("useCursor", useCursor));
}
if (cursor != null) {
builder.addQueryParameter(new Parameter("cursor", cursor));
}
return builder.build();
}

Expand All @@ -401,6 +409,8 @@ public class GetOutboundSmsMessageLogsRequest {
private String entityId;
private String applicationId;
private List<String> campaignReferenceId;
private Boolean useCursor;
private String cursor;

private GetOutboundSmsMessageLogsRequest() {}

Expand Down Expand Up @@ -547,6 +557,28 @@ public GetOutboundSmsMessageLogsRequest campaignReferenceId(List<String> campaig
return this;
}

/**
* Sets useCursor.
*
* @param useCursor Flag used to enable cursor-based pagination. When set to true, the system will use the cursor to fetch the next set of logs. (optional)
* @return GetOutboundSmsMessageLogsRequest
*/
public GetOutboundSmsMessageLogsRequest useCursor(Boolean useCursor) {
this.useCursor = useCursor;
return this;
}

/**
* Sets cursor.
*
* @param cursor Value which represents the current position in the data set. For the first request, this field shouldn&#39;t be defined. In subsequent requests, use the &#x60;nextCursor&#x60; value returned from the previous response to continue fetching data. (optional)
* @return GetOutboundSmsMessageLogsRequest
*/
public GetOutboundSmsMessageLogsRequest cursor(String cursor) {
this.cursor = cursor;
return this;
}

/**
* Executes the getOutboundSmsMessageLogs request.
*
Expand All @@ -567,7 +599,9 @@ public SmsLogsResponse execute() throws ApiException {
limit,
entityId,
applicationId,
campaignReferenceId);
campaignReferenceId,
useCursor,
cursor);
return apiClient.execute(
getOutboundSmsMessageLogsDefinition, new TypeReference<SmsLogsResponse>() {}.getType());
}
Expand All @@ -592,7 +626,9 @@ public okhttp3.Call executeAsync(ApiCallback<SmsLogsResponse> callback) {
limit,
entityId,
applicationId,
campaignReferenceId);
campaignReferenceId,
useCursor,
cursor);
return apiClient.executeAsync(
getOutboundSmsMessageLogsDefinition, new TypeReference<SmsLogsResponse>() {}.getType(), callback);
}
Expand Down Expand Up @@ -659,7 +695,7 @@ public okhttp3.Call executeAsync(ApiCallback<SmsBulkResponse> callback) {
/**
* Get scheduled SMS messages.
* <p>
* See all scheduled messages and their scheduled date and time. To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
* See all [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms) and their scheduled date and time. To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @return GetScheduledSmsMessagesRequest
Expand Down Expand Up @@ -720,7 +756,7 @@ public okhttp3.Call executeAsync(ApiCallback<SmsBulkStatusResponse> callback) {
/**
* Get scheduled SMS messages status.
* <p>
* See the status of scheduled messages. To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
* See the status of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @return GetScheduledSmsMessagesStatusRequest
Expand Down Expand Up @@ -842,7 +878,7 @@ public okhttp3.Call executeAsync(ApiCallback<SmsBulkResponse> callback) {
/**
* Reschedule SMS messages.
* <p>
* Change the date and time of already scheduled messages. To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
* Change the date and time of already [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @param smsBulkRequest (required)
Expand Down Expand Up @@ -970,7 +1006,7 @@ public okhttp3.Call executeAsync(ApiCallback<SmsBulkStatusResponse> callback) {
/**
* Update scheduled SMS messages status.
* <p>
* Change the status or completely cancel sending of scheduled messages. To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
* Change the status or completely cancel sending of [scheduled messages](https://www.infobip.com/docs/sms/sms-over-api#schedule-sms). To schedule a message, use the &#x60;sendAt&#x60; field when [sending a message](https://www.infobip.com/docs/api/channels/sms/sms-messaging/outbound-sms/send-sms-message).
*
* @param bulkId (required)
* @param smsUpdateStatusRequest (required)
Expand Down
146 changes: 146 additions & 0 deletions src/main/java/com/infobip/model/SmsCursorPageInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/*
* This class is auto generated from the Infobip OpenAPI specification
* through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR),
* powered by the OpenAPI Generator (https://openapi-generator.tech).
*
* Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide
* or contact us @ [email protected].
*/

package com.infobip.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;

/**
* Cursor information.
*/
public class SmsCursorPageInfo {

private Integer limit;

private String nextCursor;

/**
* Sets limit.
* <p>
* Field description:
* Requested limit.
*
* @param limit
* @return This {@link SmsCursorPageInfo instance}.
*/
public SmsCursorPageInfo limit(Integer limit) {
this.limit = limit;
return this;
}

/**
* Returns limit.
* <p>
* Field description:
* Requested limit.
*
* @return limit
*/
@JsonProperty("limit")
public Integer getLimit() {
return limit;
}

/**
* Sets limit.
* <p>
* Field description:
* Requested limit.
*
* @param limit
*/
@JsonProperty("limit")
public void setLimit(Integer limit) {
this.limit = limit;
}

/**
* Sets nextCursor.
* <p>
* Field description:
* The &#x60;cursor&#x60; value you will use in your next request to fetch the subsequent set of results.
*
* @param nextCursor
* @return This {@link SmsCursorPageInfo instance}.
*/
public SmsCursorPageInfo nextCursor(String nextCursor) {
this.nextCursor = nextCursor;
return this;
}

/**
* Returns nextCursor.
* <p>
* Field description:
* The &#x60;cursor&#x60; value you will use in your next request to fetch the subsequent set of results.
*
* @return nextCursor
*/
@JsonProperty("nextCursor")
public String getNextCursor() {
return nextCursor;
}

/**
* Sets nextCursor.
* <p>
* Field description:
* The &#x60;cursor&#x60; value you will use in your next request to fetch the subsequent set of results.
*
* @param nextCursor
*/
@JsonProperty("nextCursor")
public void setNextCursor(String nextCursor) {
this.nextCursor = nextCursor;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SmsCursorPageInfo smsCursorPageInfo = (SmsCursorPageInfo) o;
return Objects.equals(this.limit, smsCursorPageInfo.limit)
&& Objects.equals(this.nextCursor, smsCursorPageInfo.nextCursor);
}

@Override
public int hashCode() {
return Objects.hash(limit, nextCursor);
}

@Override
public String toString() {
String newLine = System.lineSeparator();
return new StringBuilder()
.append("class SmsCursorPageInfo {")
.append(newLine)
.append(" limit: ")
.append(toIndentedString(limit))
.append(newLine)
.append(" nextCursor: ")
.append(toIndentedString(nextCursor))
.append(newLine)
.append("}")
.toString();
}

private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
String lineSeparator = System.lineSeparator();
String lineSeparatorFollowedByIndentation = lineSeparator + " ";
return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation);
}
}
41 changes: 39 additions & 2 deletions src/main/java/com/infobip/model/SmsLogsResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class SmsLogsResponse {

private List<SmsLog> results = null;

private SmsCursorPageInfo cursor;

/**
* Sets results.
* <p>
Expand Down Expand Up @@ -78,6 +80,37 @@ public void setResults(List<SmsLog> results) {
this.results = results;
}

/**
* Sets cursor.
*
* @param cursor
* @return This {@link SmsLogsResponse instance}.
*/
public SmsLogsResponse cursor(SmsCursorPageInfo cursor) {
this.cursor = cursor;
return this;
}

/**
* Returns cursor.
*
* @return cursor
*/
@JsonProperty("cursor")
public SmsCursorPageInfo getCursor() {
return cursor;
}

/**
* Sets cursor.
*
* @param cursor
*/
@JsonProperty("cursor")
public void setCursor(SmsCursorPageInfo cursor) {
this.cursor = cursor;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -87,12 +120,13 @@ public boolean equals(Object o) {
return false;
}
SmsLogsResponse smsLogsResponse = (SmsLogsResponse) o;
return Objects.equals(this.results, smsLogsResponse.results);
return Objects.equals(this.results, smsLogsResponse.results)
&& Objects.equals(this.cursor, smsLogsResponse.cursor);
}

@Override
public int hashCode() {
return Objects.hash(results);
return Objects.hash(results, cursor);
}

@Override
Expand All @@ -104,6 +138,9 @@ public String toString() {
.append(" results: ")
.append(toIndentedString(results))
.append(newLine)
.append(" cursor: ")
.append(toIndentedString(cursor))
.append(newLine)
.append("}")
.toString();
}
Expand Down
Loading