diff --git a/api/openapi.yaml b/api/openapi.yaml
index 7bb44f7..1879df9 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -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/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/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/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java
index d7454b8..66694e1 100644
--- a/src/main/java/com/onesignal/client/api/DefaultApi.java
+++ b/src/main/java/com/onesignal/client/api/DefaultApi.java
@@ -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 {
@@ -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,
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call copyTemplateToAppCall(String templateId, String appId, CopyTemplateRequest copyTemplateRequest, final ApiCallback _callback) throws ApiException {
@@ -371,6 +376,7 @@ private okhttp3.Call copyTemplateToAppValidateBeforeCall(String templateId, Stri
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public TemplateResource copyTemplateToApp(String templateId, String appId, CopyTemplateRequest copyTemplateRequest) throws ApiException {
@@ -391,6 +397,7 @@ public TemplateResource copyTemplateToApp(String templateId, String appId, CopyT
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public ApiResponse copyTemplateToAppWithHttpInfo(String templateId, String appId, CopyTemplateRequest copyTemplateRequest) throws ApiException {
@@ -413,6 +420,7 @@ public ApiResponse copyTemplateToAppWithHttpInfo(String templa
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call copyTemplateToAppAsync(String templateId, String appId, CopyTemplateRequest copyTemplateRequest, final ApiCallback _callback) throws ApiException {
@@ -439,6 +447,7 @@ public okhttp3.Call copyTemplateToAppAsync(String templateId, String appId, Copy
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createAliasCall(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException {
@@ -538,6 +547,7 @@ private okhttp3.Call createAliasValidateBeforeCall(String appId, String aliasLab
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public UserIdentityBody createAlias(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody) throws ApiException {
@@ -562,6 +572,7 @@ public UserIdentityBody createAlias(String appId, String aliasLabel, String alia
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public ApiResponse createAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody) throws ApiException {
@@ -588,6 +599,7 @@ public ApiResponse createAliasWithHttpInfo(String appId, Strin
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createAliasAsync(String appId, String aliasLabel, String aliasId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException {
@@ -613,6 +625,7 @@ public okhttp3.Call createAliasAsync(String appId, String aliasLabel, String ali
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createAliasBySubscriptionCall(String appId, String subscriptionId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException {
@@ -705,6 +718,7 @@ private okhttp3.Call createAliasBySubscriptionValidateBeforeCall(String appId, S
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public UserIdentityBody createAliasBySubscription(String appId, String subscriptionId, UserIdentityBody userIdentityBody) throws ApiException {
@@ -728,6 +742,7 @@ public UserIdentityBody createAliasBySubscription(String appId, String subscript
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public ApiResponse createAliasBySubscriptionWithHttpInfo(String appId, String subscriptionId, UserIdentityBody userIdentityBody) throws ApiException {
@@ -753,6 +768,7 @@ public ApiResponse createAliasBySubscriptionWithHttpInfo(Strin
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createAliasBySubscriptionAsync(String appId, String subscriptionId, UserIdentityBody userIdentityBody, final ApiCallback _callback) throws ApiException {
@@ -774,6 +790,7 @@ public okhttp3.Call createAliasBySubscriptionAsync(String appId, String subscrip
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createApiKeyCall(String appId, CreateApiKeyRequest createApiKeyRequest, final ApiCallback _callback) throws ApiException {
@@ -856,6 +873,7 @@ private okhttp3.Call createApiKeyValidateBeforeCall(String appId, CreateApiKeyRe
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public CreateApiKeyResponse createApiKey(String appId, CreateApiKeyRequest createApiKeyRequest) throws ApiException {
@@ -875,6 +893,7 @@ public CreateApiKeyResponse createApiKey(String appId, CreateApiKeyRequest creat
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public ApiResponse createApiKeyWithHttpInfo(String appId, CreateApiKeyRequest createApiKeyRequest) throws ApiException {
@@ -896,6 +915,7 @@ public ApiResponse createApiKeyWithHttpInfo(String appId,
| Status Code | Description | Response Headers |
| 200 | OK | - |
| 400 | Bad Request | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createApiKeyAsync(String appId, CreateApiKeyRequest createApiKeyRequest, final ApiCallback _callback) throws ApiException {
@@ -917,6 +937,7 @@ public okhttp3.Call createApiKeyAsync(String appId, CreateApiKeyRequest createAp
| 200 | OK | - |
| 400 | Bad Request | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws ApiException {
@@ -993,6 +1014,7 @@ private okhttp3.Call createAppValidateBeforeCall(App app, final ApiCallback _cal
| 200 | OK | - |
| 400 | Bad Request | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public App createApp(App app) throws ApiException {
@@ -1012,6 +1034,7 @@ public App createApp(App app) throws ApiException {
| 200 | OK | - |
| 400 | Bad Request | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public ApiResponse createAppWithHttpInfo(App app) throws ApiException {
@@ -1033,6 +1056,7 @@ public ApiResponse createAppWithHttpInfo(App app) throws ApiException {
| 200 | OK | - |
| 400 | Bad Request | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) throws ApiException {
@@ -1056,6 +1080,7 @@ public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) th
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public okhttp3.Call createCustomEventsCall(String appId, CustomEventsRequest customEventsRequest, final ApiCallback _callback) throws ApiException {
@@ -1140,6 +1165,7 @@ private okhttp3.Call createCustomEventsValidateBeforeCall(String appId, CustomEv
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public Object createCustomEvents(String appId, CustomEventsRequest customEventsRequest) throws ApiException {
@@ -1161,6 +1187,7 @@ public Object createCustomEvents(String appId, CustomEventsRequest customEventsR
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
*/
public ApiResponse