diff --git a/README.md b/README.md
index ba698be..203f462 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# onesignal-java-client
OneSignal
-- API version: 5.7.0
+- API version: 5.8.0
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
@@ -19,14 +19,14 @@ Building the API client library requires:
com.onesignalonesignal-java-client
- 5.7.0
+ 5.8.0
```
### Gradle
```groovy
-implementation "com.onesignal:onesignal-java-client:5.7.0"
+implementation "com.onesignal:onesignal-java-client:5.8.0"
```
## Configuration
diff --git a/api/openapi.yaml b/api/openapi.yaml
index 7bb44f7..bfe287c 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -8,7 +8,7 @@ info:
customer engagement strategies. Learn more at onesignal.com
termsOfService: https://onesignal.com/tos
title: OneSignal
- version: 5.7.0
+ version: 5.8.0
servers:
- url: https://api.onesignal.com
paths:
@@ -64,7 +64,27 @@ paths:
example: 0
type: integer
style: form
+ - description: "Time-offset pagination cursor for sequential pulls of all messages.\
+ \ Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`)\
+ \ or the opaque Base64 cursor token returned as `next_time_offset` in a\
+ \ prior response. When set, results are sorted ascending by send_after\
+ \ and the standard `offset` parameter cannot be used. Repeat the request\
+ \ with each `next_time_offset` until an empty notifications array is returned."
+ explode: true
+ in: query
+ name: time_offset
+ required: false
+ schema:
+ example: 2025-01-01T00:00:00.000Z
+ type: string
+ style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -106,6 +126,12 @@ paths:
$ref: '#/components/schemas/Notification'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -163,6 +189,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -213,6 +245,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -295,6 +333,12 @@ paths:
type: object
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -329,6 +373,12 @@ paths:
description: View the details of all of your current OneSignal apps
operationId: get_apps
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -361,6 +411,12 @@ paths:
$ref: '#/components/schemas/App'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -399,6 +455,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -442,6 +504,12 @@ paths:
$ref: '#/components/schemas/App'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -500,6 +568,12 @@ paths:
type: integer
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"201":
content:
application/json:
@@ -549,6 +623,12 @@ paths:
$ref: '#/components/schemas/Segment'
required: false
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"201":
content:
application/json:
@@ -607,6 +687,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -713,6 +799,12 @@ paths:
type: string
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -767,6 +859,12 @@ paths:
$ref: '#/components/schemas/StartLiveActivityRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"201":
content:
application/json:
@@ -820,6 +918,12 @@ paths:
$ref: '#/components/schemas/UpdateLiveActivityRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -865,6 +969,12 @@ paths:
$ref: '#/components/schemas/User'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -937,6 +1047,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
description: OK
"400":
@@ -989,6 +1105,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1051,6 +1173,12 @@ paths:
$ref: '#/components/schemas/UpdateUserRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"202":
content:
application/json:
@@ -1109,6 +1237,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1172,6 +1306,12 @@ paths:
$ref: '#/components/schemas/UserIdentityBody'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1244,6 +1384,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1314,6 +1460,12 @@ paths:
$ref: '#/components/schemas/SubscriptionBody'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"201":
content:
application/json:
@@ -1377,6 +1529,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"202":
description: ACCEPTED
"400":
@@ -1433,6 +1591,12 @@ paths:
$ref: '#/components/schemas/SubscriptionBody'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
description: OK
"400":
@@ -1485,6 +1649,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1533,6 +1703,12 @@ paths:
$ref: '#/components/schemas/UserIdentityBody'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1596,6 +1772,12 @@ paths:
$ref: '#/components/schemas/TransferSubscriptionRequestBody'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1672,6 +1854,12 @@ paths:
$ref: '#/components/schemas/SubscriptionBody'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"202":
content:
application/json:
@@ -1731,6 +1919,12 @@ paths:
type: string
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"202":
content:
application/json:
@@ -1831,6 +2025,12 @@ paths:
title: export_subscriptions_request_body
type: object
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1880,6 +2080,12 @@ paths:
type: string
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1956,6 +2162,12 @@ paths:
type: string
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -1988,6 +2200,12 @@ paths:
$ref: '#/components/schemas/CreateTemplateRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2033,6 +2251,12 @@ paths:
type: string
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2076,6 +2300,12 @@ paths:
type: string
style: form
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2125,6 +2355,12 @@ paths:
$ref: '#/components/schemas/UpdateTemplateRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2170,6 +2406,12 @@ paths:
$ref: '#/components/schemas/CopyTemplateRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2202,6 +2444,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2240,6 +2488,12 @@ paths:
$ref: '#/components/schemas/CreateApiKeyRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2281,6 +2535,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2325,6 +2585,12 @@ paths:
$ref: '#/components/schemas/UpdateApiKeyRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2367,6 +2633,12 @@ paths:
type: string
style: simple
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -2406,6 +2678,12 @@ paths:
$ref: '#/components/schemas/CustomEventsRequest'
required: true
responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
"200":
content:
application/json:
@@ -3000,8 +3278,10 @@ components:
NotificationSlice:
example:
offset: 6
+ time_offset: time_offset
total_count: 0
limit: 1
+ next_time_offset: next_time_offset
notifications:
- null
- null
@@ -3012,6 +3292,14 @@ components:
type: integer
limit:
type: integer
+ time_offset:
+ description: "The time_offset cursor specified in the request, if any."
+ type: string
+ next_time_offset:
+ description: An opaque Base64 cursor token representing the next page of
+ messages to fetch. Present when time_offset was provided in the request. Pass
+ this value as time_offset on the next request to continue paginating.
+ type: string
notifications:
items:
$ref: '#/components/schemas/NotificationWithMeta'
@@ -3685,9 +3973,12 @@ components:
errors: ""
properties:
id:
- description: Notification identifier when the request created a notification.
- An empty string means no notification was created; read `errors` for details
- (HTTP may still be 200).
+ description: "Notification identifier when the request created a notification.\
+ \ An empty string means no notification was created; read `errors` for\
+ \ details (HTTP may still be 200). All OneSignal server SDKs expose message-sent\
+ \ / message-not-sent narrowing helpers (named idiomatically per language\
+ \ — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer\
+ \ them over comparing `id` directly."
type: string
external_id:
description: Optional correlation / idempotency-related value from the API
diff --git a/build.gradle b/build.gradle
index d375b39..6874aeb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.vanniktech.maven.publish'
group = 'com.onesignal'
-version = '5.7.0'
+version = '5.8.0'
buildscript {
repositories {
diff --git a/build.sbt b/build.sbt
index aeec0a3..37c0d74 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.onesignal",
name := "onesignal-java-client",
- version := "5.7.0",
+ version := "5.8.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
diff --git a/docs/CreateNotificationSuccessResponse.md b/docs/CreateNotificationSuccessResponse.md
index ff1e64e..1e59d72 100644
--- a/docs/CreateNotificationSuccessResponse.md
+++ b/docs/CreateNotificationSuccessResponse.md
@@ -7,7 +7,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**id** | **String** | Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). | [optional] |
+|**id** | **String** | Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). All OneSignal server SDKs expose message-sent / message-not-sent narrowing helpers (named idiomatically per language — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer them over comparing `id` directly. | [optional] |
|**externalId** | **String** | Optional correlation / idempotency-related value from the API response. This is not the end-user External ID used for targeting recipients (that lives under `include_aliases.external_id`). | [optional] |
|**errors** | **Object** | Polymorphic field: may be an array of human-readable strings and/or an object (for example with `invalid_aliases`, `invalid_external_user_ids`, or `invalid_player_ids`) depending on the API response; HTTP may still be 200 with partial success. Typed SDKs model this loosely so both shapes deserialize. | [optional] |
diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md
index 3b1e532..dbd6d6a 100644
--- a/docs/DefaultApi.md
+++ b/docs/DefaultApi.md
@@ -160,6 +160,7 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **copyTemplateToApp**
@@ -235,6 +236,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **createAlias**
@@ -315,6 +317,7 @@ public class Example {
| **404** | Not Found | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createAliasBySubscription**
@@ -393,6 +396,7 @@ public class Example {
| **404** | Not Found | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createApiKey**
@@ -466,6 +470,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **createApp**
@@ -538,6 +543,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createCustomEvents**
@@ -613,6 +619,7 @@ public class Example {
| **400** | Bad Request | - |
| **401** | Unauthorized | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createNotification**
@@ -770,6 +777,7 @@ public class Example {
| **200** | OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response with a non-empty `id` for the notification. If the 200 response contains `invalid_aliases`, that marks devices that exist in the provided app_id but are no longer subscribed. If `id` is an empty string, no notification was created: check the `errors` array (for example messages such as \"All included players are not subscribed\") even though HTTP status is still 200. This can happen when alias keys are wrong, External IDs do not resolve to subscribed users, or other validation issues. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createSegment**
@@ -845,6 +853,7 @@ public class Example {
| **400** | Bad Request | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createSubscription**
@@ -926,6 +935,7 @@ public class Example {
| **404** | Not Found | - |
| **409** | Operation is not permitted due to user having the maximum number of subscriptions assigned | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **createTemplate**
@@ -998,6 +1008,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **422** | Unprocessable Entity | - |
+| **0** | Unexpected error | - |
# **createUser**
@@ -1089,6 +1100,7 @@ if (e.getCode() == 409) {
| **400** | Bad Request | - |
| **409** | Multiple User Identity Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **deleteAlias**
@@ -1169,6 +1181,7 @@ public class Example {
| **404** | Not Found | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **deleteApiKey**
@@ -1242,6 +1255,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **deleteSegment**
@@ -1317,6 +1331,7 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **deleteSubscription**
@@ -1392,6 +1407,7 @@ null (empty response body)
| **404** | Not Found | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **deleteTemplate**
@@ -1466,6 +1482,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **404** | Not Found | - |
+| **0** | Unexpected error | - |
# **deleteUser**
@@ -1542,6 +1559,7 @@ null (empty response body)
| **400** | Bad Request | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **exportEvents**
@@ -1617,6 +1635,7 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **exportSubscriptions**
@@ -1691,6 +1710,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getAliases**
@@ -1768,6 +1788,7 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getAliasesBySubscription**
@@ -1842,6 +1863,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **404** | Not Found | - |
+| **0** | Unexpected error | - |
# **getApp**
@@ -1914,6 +1936,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getApps**
@@ -1982,6 +2005,7 @@ This endpoint does not need any parameter.
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getNotification**
@@ -2057,6 +2081,7 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getNotificationHistory**
@@ -2132,10 +2157,11 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getNotifications**
-> NotificationSlice getNotifications(appId, limit, offset, kind)
+> NotificationSlice getNotifications(appId, limit, offset, kind, timeOffset)
View notifications
@@ -2165,8 +2191,9 @@ public class Example {
Integer limit = 10; // Integer | How many notifications to return. Max is 50. Default is 50.
Integer offset = 0; // Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
Integer kind = 0; // Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
+ String timeOffset = "2025-01-01T00:00:00.000Z"; // String | Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned.
try {
- NotificationSlice result = apiInstance.getNotifications(appId, limit, offset, kind);
+ NotificationSlice result = apiInstance.getNotifications(appId, limit, offset, kind, timeOffset);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getNotifications");
@@ -2190,6 +2217,7 @@ public class Example {
| **limit** | **Integer**| How many notifications to return. Max is 50. Default is 50. | [optional] |
| **offset** | **Integer**| Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] |
| **kind** | **Integer**| Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] [enum: 0, 1, 3] |
+| **timeOffset** | **String**| Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. | [optional] |
### Return type
@@ -2210,6 +2238,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getOutcomes**
@@ -2292,6 +2321,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getSegments**
@@ -2368,6 +2398,7 @@ public class Example {
| **201** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **getUser**
@@ -2445,6 +2476,7 @@ public class Example {
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **rotateApiKey**
@@ -2518,6 +2550,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **startLiveActivity**
@@ -2594,6 +2627,7 @@ public class Example {
| **201** | Created | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **transferSubscription**
@@ -2672,6 +2706,7 @@ public class Example {
| **404** | Not Found | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **unsubscribeEmailWithToken**
@@ -2748,6 +2783,7 @@ public class Example {
| **202** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **updateApiKey**
@@ -2823,6 +2859,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **updateApp**
@@ -2897,6 +2934,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **updateLiveActivity**
@@ -2973,6 +3011,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **updateSubscription**
@@ -3050,6 +3089,7 @@ null (empty response body)
| **404** | Not Found | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **updateSubscriptionByToken**
@@ -3128,6 +3168,7 @@ public class Example {
| **202** | ACCEPTED | - |
| **400** | Bad Request | - |
| **404** | Not Found | - |
+| **0** | Unexpected error | - |
# **updateTemplate**
@@ -3203,6 +3244,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **updateUser**
@@ -3282,6 +3324,7 @@ public class Example {
| **400** | Bad Request | - |
| **409** | Conflict | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
# **viewApiKeys**
@@ -3353,6 +3396,7 @@ public class Example {
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
+| **0** | Unexpected error | - |
# **viewTemplate**
@@ -3427,6 +3471,7 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **404** | Not Found | - |
+| **0** | Unexpected error | - |
# **viewTemplates**
@@ -3505,4 +3550,5 @@ public class Example {
| **200** | OK | - |
| **400** | Bad Request | - |
| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
diff --git a/docs/NotificationSlice.md b/docs/NotificationSlice.md
index 5392a03..8ce0674 100644
--- a/docs/NotificationSlice.md
+++ b/docs/NotificationSlice.md
@@ -10,6 +10,8 @@
|**totalCount** | **Integer** | | [optional] |
|**offset** | **Integer** | | [optional] |
|**limit** | **Integer** | | [optional] |
+|**timeOffset** | **String** | The time_offset cursor specified in the request, if any. | [optional] |
+|**nextTimeOffset** | **String** | An opaque Base64 cursor token representing the next page of messages to fetch. Present when time_offset was provided in the request. Pass this value as time_offset on the next request to continue paginating. | [optional] |
|**notifications** | [**List<NotificationWithMeta>**](NotificationWithMeta.md) | | [optional] |
diff --git a/pom.xml b/pom.xml
index dd77452..0b42312 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
onesignal-java-clientjaronesignal-java-client
- 5.7.0
+ 5.8.0https://github.com/OneSignal/onesignal-java-apiOneSignal Java API Client
diff --git a/src/main/java/com/onesignal/client/ApiCallback.java b/src/main/java/com/onesignal/client/ApiCallback.java
index 0998f9e..d0aefb7 100644
--- a/src/main/java/com/onesignal/client/ApiCallback.java
+++ b/src/main/java/com/onesignal/client/ApiCallback.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java
index dda403c..8c66644 100644
--- a/src/main/java/com/onesignal/client/ApiClient.java
+++ b/src/main/java/com/onesignal/client/ApiClient.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -133,7 +133,7 @@ private void init() {
json = new JSON();
// Set default User-Agent.
- setUserAgent("OpenAPI-Generator/5.7.0/java");
+ setUserAgent("OpenAPI-Generator/5.8.0/java");
authentications = new HashMap();
}
diff --git a/src/main/java/com/onesignal/client/ApiException.java b/src/main/java/com/onesignal/client/ApiException.java
index bf23db5..e52f50f 100644
--- a/src/main/java/com/onesignal/client/ApiException.java
+++ b/src/main/java/com/onesignal/client/ApiException.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/ApiResponse.java b/src/main/java/com/onesignal/client/ApiResponse.java
index 37e3f0c..3913d3f 100644
--- a/src/main/java/com/onesignal/client/ApiResponse.java
+++ b/src/main/java/com/onesignal/client/ApiResponse.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/Configuration.java b/src/main/java/com/onesignal/client/Configuration.java
index d632f10..7195f1b 100644
--- a/src/main/java/com/onesignal/client/Configuration.java
+++ b/src/main/java/com/onesignal/client/Configuration.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java
index 36f3d87..dfcf2f4 100644
--- a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java
+++ b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java
index 69885ff..16b0684 100644
--- a/src/main/java/com/onesignal/client/JSON.java
+++ b/src/main/java/com/onesignal/client/JSON.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/NotificationHelpers.java b/src/main/java/com/onesignal/client/NotificationHelpers.java
index a7b9e8a..1087228 100644
--- a/src/main/java/com/onesignal/client/NotificationHelpers.java
+++ b/src/main/java/com/onesignal/client/NotificationHelpers.java
@@ -103,6 +103,34 @@ public static CreateNotificationWithRetryResult createNotificationWithRetry(Defa
}
}
+ /**
+ * Whether a POST /notifications 200 response is the "message sent" branch.
+ *
+ *
POST /notifications returns 200 in two cases that share the
+ * {@link CreateNotificationSuccessResponse} shape: a notification was
+ * created (non-empty {@code id}), or none was (empty {@code id}, with
+ * {@code errors} carrying the reason). Prefer this guard over inspecting
+ * {@code id} directly.
+ *
+ * @param response a create-notification success response
+ * @return {@code true} when a notification was created
+ */
+ public static boolean isMessageSent(CreateNotificationSuccessResponse response) {
+ return response != null && response.getId() != null && !response.getId().isEmpty();
+ }
+
+ /**
+ * Whether a POST /notifications 200 response is the "message not sent"
+ * branch -- no notification was created ({@code id} absent or empty);
+ * inspect {@code errors} for why.
+ *
+ * @param response a create-notification success response
+ * @return {@code true} when no notification was created
+ */
+ public static boolean isMessageNotSent(CreateNotificationSuccessResponse response) {
+ return !isMessageSent(response);
+ }
+
private static String headerValue(Map> headers, String name) {
if (headers == null) {
return null;
diff --git a/src/main/java/com/onesignal/client/Pair.java b/src/main/java/com/onesignal/client/Pair.java
index d01a567..6610e07 100644
--- a/src/main/java/com/onesignal/client/Pair.java
+++ b/src/main/java/com/onesignal/client/Pair.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/ProgressRequestBody.java b/src/main/java/com/onesignal/client/ProgressRequestBody.java
index dc6c4f5..b560f35 100644
--- a/src/main/java/com/onesignal/client/ProgressRequestBody.java
+++ b/src/main/java/com/onesignal/client/ProgressRequestBody.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/ProgressResponseBody.java b/src/main/java/com/onesignal/client/ProgressResponseBody.java
index d2b6979..0ac357f 100644
--- a/src/main/java/com/onesignal/client/ProgressResponseBody.java
+++ b/src/main/java/com/onesignal/client/ProgressResponseBody.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/StringUtil.java b/src/main/java/com/onesignal/client/StringUtil.java
index 0f7a15f..dc43516 100644
--- a/src/main/java/com/onesignal/client/StringUtil.java
+++ b/src/main/java/com/onesignal/client/StringUtil.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java
index d7454b8..6c0a1b1 100644
--- a/src/main/java/com/onesignal/client/api/DefaultApi.java
+++ b/src/main/java/com/onesignal/client/api/DefaultApi.java
@@ -2,7 +2,7 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
- * The version of the OpenAPI document: 5.7.0
+ * The version of the OpenAPI document: 5.8.0
* Contact: devrel@onesignal.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -125,6 +125,7 @@ public void setCustomBaseUrl(String customBaseUrl) {
400
Bad Request
-
404
Not Found
-
429
Rate Limit Exceeded
-
+
0
Unexpected error
-
*/
public okhttp3.Call cancelNotificationCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException {
@@ -154,7 +155,7 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId,
Map localVarFormParams = new HashMap();
// Adds client sdk version header
- localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.7.0");
+ localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.8.0");
if (appId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId));
@@ -213,6 +214,7 @@ private okhttp3.Call cancelNotificationValidateBeforeCall(String appId, String n
400
Bad Request
-
404
Not Found
-
429
Rate Limit Exceeded
-
+
0
Unexpected error
-
*/
public GenericSuccessBoolResponse cancelNotification(String appId, String notificationId) throws ApiException {
@@ -234,6 +236,7 @@ public GenericSuccessBoolResponse cancelNotification(String appId, String notifi
400
Bad Request
-
404
Not Found
-
429
Rate Limit Exceeded
-
+
0
Unexpected error
-
*/
public ApiResponse cancelNotificationWithHttpInfo(String appId, String notificationId) throws ApiException {
@@ -257,6 +260,7 @@ public ApiResponse cancelNotificationWithHttpInfo(St
400
Bad Request
-
404
Not Found
-
429
Rate Limit Exceeded
-
+
0
Unexpected error
-
*/
public okhttp3.Call cancelNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException {
@@ -279,6 +283,7 @@ public okhttp3.Call cancelNotificationAsync(String appId, String notificationId,