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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> **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.

OneSignal
- API version: 5.15.0
- API version: 5.16.0

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

Expand All @@ -21,14 +21,14 @@ Building the API client library requires:
<dependency>
<groupId>com.onesignal</groupId>
<artifactId>onesignal-java-client</artifactId>
<version>5.15.0</version>
<version>5.16.0</version>
</dependency>
```

### Gradle

```groovy
implementation "com.onesignal:onesignal-java-client:5.15.0"
implementation "com.onesignal:onesignal-java-client:5.16.0"
```

## Configuration
Expand Down
98 changes: 97 additions & 1 deletion api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info:
customer engagement strategies. Learn more at onesignal.com
termsOfService: https://onesignal.com/tos
title: OneSignal
version: 5.15.0
version: 5.16.0
servers:
- url: https://api.onesignal.com
paths:
Expand Down Expand Up @@ -968,6 +968,59 @@ paths:
- rest_api_key: []
summary: View Outcomes
x-accepts: application/json
/apps/{app_id}/email_analytics/delivery_metrics:
get:
description: "The email bounce and spam complaint rates received for the app\
\ over the last 24 hours, 7 days, and 30 days.\nRates are expressed as fractions\
\ of successfully delivered emails (for example, `0.02` means 2%). A window\
\ reports `0` for both rates when the app has not successfully delivered any\
\ email in that period.\n"
operationId: get_email_reputation
parameters:
- description: Your OneSignal App ID in UUID v4 format.
explode: false
in: path
name: app_id
required: true
schema:
example: YOUR_APP_ID
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/EmailReputationResponse'
description: OK
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
description: Unexpected error
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
description: Bad Request
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
description: Not Found
"429":
content:
application/json:
schema:
$ref: '#/components/schemas/RateLimitError'
description: Rate Limit Exceeded
security:
- rest_api_key: []
summary: Get email reputation statistics
x-accepts: application/json
/apps/{app_id}/activities/activity/{activity_type}:
post:
description: Remotely start a Live Activity on iOS devices via OneSignal’s REST
Expand Down Expand Up @@ -5148,6 +5201,49 @@ components:
`false`.
type: integer
type: object
EmailReputationResponse:
description: "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."
example:
last_7_days:
bounce_rate: 0.02
complaint_rate: 0.001
last_24_hours:
bounce_rate: 0.02
complaint_rate: 0.001
last_30_days:
bounce_rate: 0.02
complaint_rate: 0.001
properties:
last_24_hours:
$ref: '#/components/schemas/EmailReputationWindow'
last_7_days:
$ref: '#/components/schemas/EmailReputationWindow'
last_30_days:
$ref: '#/components/schemas/EmailReputationWindow'
type: object
EmailReputationWindow:
description: "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."
example:
bounce_rate: 0.02
complaint_rate: 0.001
properties:
bounce_rate:
description: The fraction of successfully delivered emails that hard or
soft bounced during the window.
example: 0.02
format: double
type: number
complaint_rate:
description: The fraction of successfully delivered emails that recipients
reported as spam during the window.
example: 0.001
format: double
type: number
type: object
GenericSuccessBoolResponse:
example:
success: true
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.vanniktech.maven.publish'

group = 'com.onesignal'
version = '5.15.0'
version = '5.16.0'

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.onesignal",
name := "onesignal-java-client",
version := "5.15.0",
version := "5.16.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
75 changes: 75 additions & 0 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All URIs are relative to *https://api.onesignal.com*
| [**getAliasesBySubscription**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
| [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app |
| [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps |
| [**getEmailReputation**](DefaultApi.md#getEmailReputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics |
| [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification |
| [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History |
| [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications |
Expand Down Expand Up @@ -2250,6 +2251,80 @@ This endpoint does not need any parameter.
| **429** | Rate Limit Exceeded | - |
| **0** | Unexpected error | - |

<a name="getEmailReputation"></a>
# **getEmailReputation**
> EmailReputationResponse getEmailReputation(appId)

Get email reputation statistics

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.

### Example
```java
// Import classes:
import com.onesignal.client.ApiClient;
import com.onesignal.client.ApiException;
import com.onesignal.client.Configuration;
import com.onesignal.client.auth.*;
import com.onesignal.client.model.*;
import com.onesignal.client.api.DefaultApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.onesignal.com");

// Configure HTTP bearer authorization: rest_api_key
HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
rest_api_key.setBearerToken("YOUR_REST_API_KEY");

DefaultApi apiInstance = new DefaultApi(defaultClient);
String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format.
try {
EmailReputationResponse result = apiInstance.getEmailReputation(appId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getEmailReputation");
System.err.println("Status code: " + e.getCode());
// getErrorMessages() flattens any error-envelope shape to a List<String>;
// the raw body remains on getResponseBody().
System.err.println("Error messages: " + e.getErrorMessages());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | |

### Return type

[**EmailReputationResponse**](EmailReputationResponse.md)

### Authorization

[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | Bad Request | - |
| **404** | Not Found | - |
| **429** | Rate Limit Exceeded | - |
| **0** | Unexpected error | - |

<a name="getNotification"></a>
# **getNotification**
> NotificationWithMeta getNotification(appId, notificationId)
Expand Down
16 changes: 16 additions & 0 deletions docs/EmailReputationResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


# EmailReputationResponse

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.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**last24Hours** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
|**last7Days** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
|**last30Days** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |



15 changes: 15 additions & 0 deletions docs/EmailReputationWindow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# EmailReputationWindow

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.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**bounceRate** | **Double** | The fraction of successfully delivered emails that hard or soft bounced during the window. | [optional] |
|**complaintRate** | **Double** | The fraction of successfully delivered emails that recipients reported as spam during the window. | [optional] |



2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>onesignal-java-client</artifactId>
<packaging>jar</packaging>
<name>onesignal-java-client</name>
<version>5.15.0</version>
<version>5.16.0</version>
<url>https://github.com/OneSignal/onesignal-java-api</url>
<description>OneSignal Java API Client</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/onesignal/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void init() {
json = new JSON();

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

authentications = new HashMap<String, Authentication>();
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/onesignal/client/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
.registerTypeAdapterFactory(new com.onesignal.client.model.CustomEvent.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.CustomEventsRequest.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailReputationResponse.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailReputationWindow.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUp.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUpRequest.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUpStage.CustomTypeAdapterFactory())
Expand Down
Loading