Skip to content

Commit 8641500

Browse files
authored
feat: add v5.16.0 package updates (#136)
Channels: Current ### πŸš€ New Features - feat: [EMA-11574] Add support for fetching email reputation stats (OneSignal/API-Client-Libraries#464) ### πŸ› Bug Fixes - fix: Use a plain `$ref` for email reputation window properties (OneSignal/API-Client-Libraries#465)
2 parents 019bc60 + 130b611 commit 8641500

13 files changed

Lines changed: 875 additions & 63 deletions

β€ŽREADME.mdβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> **Building with an AI agent or LLM?** See [AGENTS.md](https://github.com/OneSignal/onesignal-java-api/blob/main/AGENTS.md) for an agent-oriented integration guide β€” authentication, calling conventions, idempotent retries, and the full API reference.
44
55
OneSignal
6-
- API version: 5.15.0
6+
- API version: 5.16.0
77

88
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
99

@@ -21,14 +21,14 @@ Building the API client library requires:
2121
<dependency>
2222
<groupId>com.onesignal</groupId>
2323
<artifactId>onesignal-java-client</artifactId>
24-
<version>5.15.0</version>
24+
<version>5.16.0</version>
2525
</dependency>
2626
```
2727

2828
### Gradle
2929

3030
```groovy
31-
implementation "com.onesignal:onesignal-java-client:5.15.0"
31+
implementation "com.onesignal:onesignal-java-client:5.16.0"
3232
```
3333

3434
## Configuration

β€Žapi/openapi.yamlβ€Ž

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ info:
88
customer engagement strategies. Learn more at onesignal.com
99
termsOfService: https://onesignal.com/tos
1010
title: OneSignal
11-
version: 5.15.0
11+
version: 5.16.0
1212
servers:
1313
- url: https://api.onesignal.com
1414
paths:
@@ -968,6 +968,59 @@ paths:
968968
- rest_api_key: []
969969
summary: View Outcomes
970970
x-accepts: application/json
971+
/apps/{app_id}/email_analytics/delivery_metrics:
972+
get:
973+
description: "The email bounce and spam complaint rates received for the app\
974+
\ over the last 24 hours, 7 days, and 30 days.\nRates are expressed as fractions\
975+
\ of successfully delivered emails (for example, `0.02` means 2%). A window\
976+
\ reports `0` for both rates when the app has not successfully delivered any\
977+
\ email in that period.\n"
978+
operationId: get_email_reputation
979+
parameters:
980+
- description: Your OneSignal App ID in UUID v4 format.
981+
explode: false
982+
in: path
983+
name: app_id
984+
required: true
985+
schema:
986+
example: YOUR_APP_ID
987+
type: string
988+
style: simple
989+
responses:
990+
"200":
991+
content:
992+
application/json:
993+
schema:
994+
$ref: '#/components/schemas/EmailReputationResponse'
995+
description: OK
996+
default:
997+
content:
998+
application/json:
999+
schema:
1000+
$ref: '#/components/schemas/GenericError'
1001+
description: Unexpected error
1002+
"400":
1003+
content:
1004+
application/json:
1005+
schema:
1006+
$ref: '#/components/schemas/GenericError'
1007+
description: Bad Request
1008+
"404":
1009+
content:
1010+
application/json:
1011+
schema:
1012+
$ref: '#/components/schemas/GenericError'
1013+
description: Not Found
1014+
"429":
1015+
content:
1016+
application/json:
1017+
schema:
1018+
$ref: '#/components/schemas/RateLimitError'
1019+
description: Rate Limit Exceeded
1020+
security:
1021+
- rest_api_key: []
1022+
summary: Get email reputation statistics
1023+
x-accepts: application/json
9711024
/apps/{app_id}/activities/activity/{activity_type}:
9721025
post:
9731026
description: Remotely start a Live Activity on iOS devices via OneSignal’s REST
@@ -5148,6 +5201,49 @@ components:
51485201
`false`.
51495202
type: integer
51505203
type: object
5204+
EmailReputationResponse:
5205+
description: "App-wide email bounce and spam complaint rates, broken out by\
5206+
\ time window. `last_24_hours`, `last_7_days`, and `last_30_days` each hold\
5207+
\ the bounce and complaint rates for email delivered in that window."
5208+
example:
5209+
last_7_days:
5210+
bounce_rate: 0.02
5211+
complaint_rate: 0.001
5212+
last_24_hours:
5213+
bounce_rate: 0.02
5214+
complaint_rate: 0.001
5215+
last_30_days:
5216+
bounce_rate: 0.02
5217+
complaint_rate: 0.001
5218+
properties:
5219+
last_24_hours:
5220+
$ref: '#/components/schemas/EmailReputationWindow'
5221+
last_7_days:
5222+
$ref: '#/components/schemas/EmailReputationWindow'
5223+
last_30_days:
5224+
$ref: '#/components/schemas/EmailReputationWindow'
5225+
type: object
5226+
EmailReputationWindow:
5227+
description: "Email reputation rates for a single time window. Each rate is\
5228+
\ a fraction of successfully delivered emails (for example, `0.02` means 2%).\
5229+
\ Both rates are `0` when no email was successfully delivered in the window."
5230+
example:
5231+
bounce_rate: 0.02
5232+
complaint_rate: 0.001
5233+
properties:
5234+
bounce_rate:
5235+
description: The fraction of successfully delivered emails that hard or
5236+
soft bounced during the window.
5237+
example: 0.02
5238+
format: double
5239+
type: number
5240+
complaint_rate:
5241+
description: The fraction of successfully delivered emails that recipients
5242+
reported as spam during the window.
5243+
example: 0.001
5244+
format: double
5245+
type: number
5246+
type: object
51515247
GenericSuccessBoolResponse:
51525248
example:
51535249
success: true

β€Žbuild.gradleβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless'
55
apply plugin: 'com.vanniktech.maven.publish'
66

77
group = 'com.onesignal'
8-
version = '5.15.0'
8+
version = '5.16.0'
99

1010
buildscript {
1111
repositories {

β€Žbuild.sbtβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.onesignal",
44
name := "onesignal-java-client",
5-
version := "5.15.0",
5+
version := "5.16.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

β€Ždocs/DefaultApi.mdβ€Ž

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ All URIs are relative to *https://api.onesignal.com*
3131
| [**getAliasesBySubscription**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
3232
| [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app |
3333
| [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps |
34+
| [**getEmailReputation**](DefaultApi.md#getEmailReputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics |
3435
| [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification |
3536
| [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History |
3637
| [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications |
@@ -2250,6 +2251,80 @@ This endpoint does not need any parameter.
22502251
| **429** | Rate Limit Exceeded | - |
22512252
| **0** | Unexpected error | - |
22522253

2254+
<a name="getEmailReputation"></a>
2255+
# **getEmailReputation**
2256+
> EmailReputationResponse getEmailReputation(appId)
2257+
2258+
Get email reputation statistics
2259+
2260+
The email bounce and spam complaint rates received for the app over the last 24 hours, 7 days, and 30 days. Rates are expressed as fractions of successfully delivered emails (for example, &#x60;0.02&#x60; means 2%). A window reports &#x60;0&#x60; for both rates when the app has not successfully delivered any email in that period.
2261+
2262+
### Example
2263+
```java
2264+
// Import classes:
2265+
import com.onesignal.client.ApiClient;
2266+
import com.onesignal.client.ApiException;
2267+
import com.onesignal.client.Configuration;
2268+
import com.onesignal.client.auth.*;
2269+
import com.onesignal.client.model.*;
2270+
import com.onesignal.client.api.DefaultApi;
2271+
2272+
public class Example {
2273+
public static void main(String[] args) {
2274+
ApiClient defaultClient = Configuration.getDefaultApiClient();
2275+
defaultClient.setBasePath("https://api.onesignal.com");
2276+
2277+
// Configure HTTP bearer authorization: rest_api_key
2278+
HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
2279+
rest_api_key.setBearerToken("YOUR_REST_API_KEY");
2280+
2281+
DefaultApi apiInstance = new DefaultApi(defaultClient);
2282+
String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format.
2283+
try {
2284+
EmailReputationResponse result = apiInstance.getEmailReputation(appId);
2285+
System.out.println(result);
2286+
} catch (ApiException e) {
2287+
System.err.println("Exception when calling DefaultApi#getEmailReputation");
2288+
System.err.println("Status code: " + e.getCode());
2289+
// getErrorMessages() flattens any error-envelope shape to a List<String>;
2290+
// the raw body remains on getResponseBody().
2291+
System.err.println("Error messages: " + e.getErrorMessages());
2292+
System.err.println("Reason: " + e.getResponseBody());
2293+
System.err.println("Response headers: " + e.getResponseHeaders());
2294+
e.printStackTrace();
2295+
}
2296+
}
2297+
}
2298+
```
2299+
2300+
### Parameters
2301+
2302+
| Name | Type | Description | Notes |
2303+
|------------- | ------------- | ------------- | -------------|
2304+
| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | |
2305+
2306+
### Return type
2307+
2308+
[**EmailReputationResponse**](EmailReputationResponse.md)
2309+
2310+
### Authorization
2311+
2312+
[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration)
2313+
2314+
### HTTP request headers
2315+
2316+
- **Content-Type**: Not defined
2317+
- **Accept**: application/json
2318+
2319+
### HTTP response details
2320+
| Status code | Description | Response headers |
2321+
|-------------|-------------|------------------|
2322+
| **200** | OK | - |
2323+
| **400** | Bad Request | - |
2324+
| **404** | Not Found | - |
2325+
| **429** | Rate Limit Exceeded | - |
2326+
| **0** | Unexpected error | - |
2327+
22532328
<a name="getNotification"></a>
22542329
# **getNotification**
22552330
> NotificationWithMeta getNotification(appId, notificationId)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# EmailReputationResponse
4+
5+
App-wide email bounce and spam complaint rates, broken out by time window. `last_24_hours`, `last_7_days`, and `last_30_days` each hold the bounce and complaint rates for email delivered in that window.
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**last24Hours** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
12+
|**last7Days** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
13+
|**last30Days** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
14+
15+
16+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
# EmailReputationWindow
4+
5+
Email reputation rates for a single time window. Each rate is a fraction of successfully delivered emails (for example, `0.02` means 2%). Both rates are `0` when no email was successfully delivered in the window.
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**bounceRate** | **Double** | The fraction of successfully delivered emails that hard or soft bounced during the window. | [optional] |
12+
|**complaintRate** | **Double** | The fraction of successfully delivered emails that recipients reported as spam during the window. | [optional] |
13+
14+
15+

β€Žpom.xmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>onesignal-java-client</artifactId>
66
<packaging>jar</packaging>
77
<name>onesignal-java-client</name>
8-
<version>5.15.0</version>
8+
<version>5.16.0</version>
99
<url>https://github.com/OneSignal/onesignal-java-api</url>
1010
<description>OneSignal Java API Client</description>
1111
<scm>

β€Žsrc/main/java/com/onesignal/client/ApiClient.javaβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private void init() {
132132
json = new JSON();
133133

134134
// Set default User-Agent.
135-
setUserAgent("OpenAPI-Generator/5.15.0/java");
135+
setUserAgent("OpenAPI-Generator/5.16.0/java");
136136

137137
authentications = new HashMap<String, Authentication>();
138138
}

β€Žsrc/main/java/com/onesignal/client/JSON.javaβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
117117
.registerTypeAdapterFactory(new com.onesignal.client.model.CustomEvent.CustomTypeAdapterFactory())
118118
.registerTypeAdapterFactory(new com.onesignal.client.model.CustomEventsRequest.CustomTypeAdapterFactory())
119119
.registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory())
120+
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailReputationResponse.CustomTypeAdapterFactory())
121+
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailReputationWindow.CustomTypeAdapterFactory())
120122
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUp.CustomTypeAdapterFactory())
121123
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUpRequest.CustomTypeAdapterFactory())
122124
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUpStage.CustomTypeAdapterFactory())

0 commit comments

Comments
Β (0)