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.18.0
- API version: 5.19.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.18.0</version>
<version>5.19.0</version>
</dependency>
```

### Gradle

```groovy
implementation "com.onesignal:onesignal-java-client:5.18.0"
implementation "com.onesignal:onesignal-java-client:5.19.0"
```

## Configuration
Expand Down
121 changes: 120 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.18.0
version: 5.19.0
servers:
- url: https://api.onesignal.com
paths:
Expand Down Expand Up @@ -2616,6 +2616,16 @@ paths:
example: push
type: string
style: form
- description: "Return only templates whose name contains this text, ignoring\
\ case."
explode: true
in: query
name: name
required: false
schema:
example: Welcome
type: string
style: form
responses:
default:
content:
Expand Down Expand Up @@ -3733,6 +3743,56 @@ paths:
summary: Update journey node
x-content-type: application/json
x-accepts: application/json
/journeys/schema:
get:
description: Retrieve the JSON Schema for a Journey authoring operation without
authentication or app context. The response identifies the document to validate.
Schema retrieval does not validate permissions or business rules for a later
write.
operationId: get_journey_schema
parameters:
- description: The authoring operation whose schema you need.
explode: true
in: query
name: operation
required: true
schema:
enum:
- create
- duplicate
- update
- update_node
example: create
type: string
style: form
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/JourneySchemaResponse'
description: The schema and its applicability.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
description: Unexpected error
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/JourneyValidationErrorResponse'
description: Missing or unsupported operation.
"429":
content:
application/json:
schema:
$ref: '#/components/schemas/RateLimitError'
description: Rate Limit Exceeded
security: []
summary: Get Journey schema
x-accepts: application/json
/organizations/{organization_id}/audit_logs:
get:
description: "Retrieve a paginated, time-scoped list of audit log events for\
Expand Down Expand Up @@ -9272,6 +9332,65 @@ components:
branching nodes.
type: object
type: object
JourneySchemaResponse:
example:
schema:
key: ""
document: body
operation: create
properties:
operation:
description: The requested operation.
enum:
- create
- duplicate
- update
- update_node
type: string
document:
description: "The document that the schema describes. For update_node, merged_node\
\ is the complete node after applying the patch."
enum:
- body
- overrides
- patch
- merged_node
type: string
schema:
additionalProperties: true
description: A self-contained JSON Schema Draft 6 document with local $defs
references.
type: object
required:
- document
- operation
- schema
type: object
JourneyValidationError:
properties:
code:
description: "Stable, kebab-case error identifier. Always `invalid-payload`\
\ for validation failures."
type: string
title:
description: Human-readable message. Wording may change between releases.
type: string
meta:
additionalProperties: true
description: "Structured context. Always includes `attribute` (the field,\
\ or `base` for request-level errors); may also include `path`, `node_id`,\
\ or `client_node_id`."
type: object
type: object
JourneyValidationErrorResponse:
description: Validation error response. The failing field and any positional
detail are in `meta`.
properties:
errors:
items:
$ref: '#/components/schemas/JourneyValidationError'
type: array
type: object
get_notification_history_request_body:
properties:
events:
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.18.0'
version = '5.19.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.18.0",
version := "5.19.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
77 changes: 75 additions & 2 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All URIs are relative to *https://api.onesignal.com*
| [**getEmailProviderMetrics**](DefaultApi.md#getEmailProviderMetrics) | **GET** /apps/{app_id}/email_analytics/provider_metrics | Get email inbox provider metrics |
| [**getEmailProviderMetricsTimeseries**](DefaultApi.md#getEmailProviderMetricsTimeseries) | **GET** /apps/{app_id}/email_analytics/provider_metrics_timeseries | Get email inbox provider metrics over time |
| [**getEmailReputation**](DefaultApi.md#getEmailReputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics |
| [**getJourneySchema**](DefaultApi.md#getJourneySchema) | **GET** /journeys/schema | Get Journey schema |
| [**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 @@ -2630,6 +2631,76 @@ public class Example {
| **429** | Rate Limit Exceeded | - |
| **0** | Unexpected error | - |

<a name="getJourneySchema"></a>
# **getJourneySchema**
> JourneySchemaResponse getJourneySchema(operation)

Get Journey schema

Retrieve the JSON Schema for a Journey authoring operation without authentication or app context. The response identifies the document to validate. Schema retrieval does not validate permissions or business rules for a later write.

### Example
```java
// Import classes:
import java.util.Arrays;
import java.util.List;
import com.onesignal.client.ApiClient;
import com.onesignal.client.ApiException;
import com.onesignal.client.Configuration;
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");

DefaultApi apiInstance = new DefaultApi(defaultClient);
String operation = "create"; // String | The authoring operation whose schema you need.
try {
JourneySchemaResponse result = apiInstance.getJourneySchema(operation);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getJourneySchema");
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 |
|------------- | ------------- | ------------- | -------------|
| **operation** | **String**| The authoring operation whose schema you need. | [enum: create, duplicate, update, update_node] |

### Return type

[**JourneySchemaResponse**](JourneySchemaResponse.md)

### Authorization

No authorization required

### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | The schema and its applicability. | - |
| **400** | Missing or unsupported operation. | - |
| **429** | Rate Limit Exceeded | - |
| **0** | Unexpected error | - |

<a name="getNotification"></a>
# **getNotification**
> NotificationWithMeta getNotification(appId, notificationId)
Expand Down Expand Up @@ -4798,7 +4869,7 @@ public class Example {

<a name="viewTemplates"></a>
# **viewTemplates**
> TemplatesListResponse viewTemplates(appId, limit, offset, channel)
> TemplatesListResponse viewTemplates(appId, limit, offset, channel, name)

View templates

Expand Down Expand Up @@ -4830,8 +4901,9 @@ public class Example {
Integer limit = 10; // Integer | Maximum number of templates. Default and max is 50.
Integer offset = 0; // Integer | Pagination offset.
String channel = "push"; // String | Filter by delivery channel.
String name = "Welcome"; // String | Return only templates whose name contains this text, ignoring case.
try {
TemplatesListResponse result = apiInstance.viewTemplates(appId, limit, offset, channel);
TemplatesListResponse result = apiInstance.viewTemplates(appId, limit, offset, channel, name);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#viewTemplates");
Expand All @@ -4855,6 +4927,7 @@ public class Example {
| **limit** | **Integer**| Maximum number of templates. Default and max is 50. | [optional] [default to 50] |
| **offset** | **Integer**| Pagination offset. | [optional] [default to 0] |
| **channel** | **String**| Filter by delivery channel. | [optional] [enum: push, email, sms] |
| **name** | **String**| Return only templates whose name contains this text, ignoring case. | [optional] |

### Return type

Expand Down
37 changes: 37 additions & 0 deletions docs/JourneySchemaResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@


# JourneySchemaResponse


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**operation** | [**OperationEnum**](#OperationEnum) | The requested operation. | |
|**document** | [**DocumentEnum**](#DocumentEnum) | The document that the schema describes. For update_node, merged_node is the complete node after applying the patch. | |
|**schema** | **Map&lt;String, Object&gt;** | A self-contained JSON Schema Draft 6 document with local $defs references. | |



## Enum: OperationEnum

| Name | Value |
|---- | -----|
| CREATE | &quot;create&quot; |
| DUPLICATE | &quot;duplicate&quot; |
| UPDATE | &quot;update&quot; |
| UPDATE_NODE | &quot;update_node&quot; |



## Enum: DocumentEnum

| Name | Value |
|---- | -----|
| BODY | &quot;body&quot; |
| OVERRIDES | &quot;overrides&quot; |
| PATCH | &quot;patch&quot; |
| MERGED_NODE | &quot;merged_node&quot; |



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


# JourneyValidationError


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**code** | **String** | Stable, kebab-case error identifier. Always &#x60;invalid-payload&#x60; for validation failures. | [optional] |
|**title** | **String** | Human-readable message. Wording may change between releases. | [optional] |
|**meta** | **Map&lt;String, Object&gt;** | Structured context. Always includes &#x60;attribute&#x60; (the field, or &#x60;base&#x60; for request-level errors); may also include &#x60;path&#x60;, &#x60;node_id&#x60;, or &#x60;client_node_id&#x60;. | [optional] |



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


# JourneyValidationErrorResponse

Validation error response. The failing field and any positional detail are in `meta`.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**errors** | [**List&lt;JourneyValidationError&gt;**](JourneyValidationError.md) | | [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.18.0</version>
<version>5.19.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.18.0/java");
setUserAgent("OpenAPI-Generator/5.19.0/java");

authentications = new HashMap<String, Authentication>();
}
Expand Down
Loading