Skip to content
Closed
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
612 changes: 598 additions & 14 deletions api/openapi.yaml

Large diffs are not rendered by default.

92 changes: 86 additions & 6 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ All URIs are relative to *https://api.onesignal.com*
| [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
| [**deleteTemplate**](DefaultApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete template |
| [**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
| [**duplicateJourney**](DefaultApi.md#duplicateJourney) | **POST** /apps/{app_id}/journeys/{journey_id}/duplicate | Duplicate journey |
| [**estimateNotificationRecipients**](DefaultApi.md#estimateNotificationRecipients) | **POST** /notifications/count-unsaved | Estimate notification recipients |
| [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events | Export CSV of Events |
| [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
Expand Down Expand Up @@ -1456,7 +1457,7 @@ public class Example {

DefaultApi apiInstance = new DefaultApi(defaultClient);
String appId = "YOUR_APP_ID"; // String | The OneSignal App ID for your app. Available in Keys & IDs.
String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // String | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // String | The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard.
try {
GenericSuccessBoolResponse result = apiInstance.deleteSegment(appId, segmentId);
System.out.println(result);
Expand All @@ -1479,7 +1480,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | |
| **segmentId** | **String**| The segment_id can be found in the URL of the segment when viewing it in the dashboard. | |
| **segmentId** | **String**| The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. | |

### Return type

Expand Down Expand Up @@ -1731,6 +1732,85 @@ null (empty response body)
| **429** | Rate Limit Exceeded | - |
| **0** | Unexpected error | - |

<a name="duplicateJourney"></a>
# **duplicateJourney**
> Journey duplicateJourney(appId, journeyId, duplicateJourneyRequest)

Duplicate journey

The Journeys API is in beta. Endpoints and response fields can still change. Copy an existing journey into a new draft. The source does not change. The copy is always a draft, and started_at and archived_at are null. If you omit the body, or omit overrides, the copy keeps the source description, audience, nodes, early_exit, and reentry_rules. The copy takes the source name plus \&quot; (Copy)\&quot;. The copy does not keep schedule. Send schedule under overrides to set it. Server-controlled fields are rejected with 400. The authenticated App API key must have permission to create journeys.

### 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.
String journeyId = "YOUR_JOURNEY_ID"; // String | UUID of the journey to copy.
DuplicateJourneyRequest duplicateJourneyRequest = new DuplicateJourneyRequest(); // DuplicateJourneyRequest |
try {
Journey result = apiInstance.duplicateJourney(appId, journeyId, duplicateJourneyRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#duplicateJourney");
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. | |
| **journeyId** | **String**| UUID of the journey to copy. | |
| **duplicateJourneyRequest** | [**DuplicateJourneyRequest**](DuplicateJourneyRequest.md)| | [optional] |

### Return type

[**Journey**](Journey.md)

### Authorization

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

### HTTP request headers

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

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

<a name="estimateNotificationRecipients"></a>
# **estimateNotificationRecipients**
> EstimateNotificationRecipientsSuccessResponse estimateNotificationRecipients(estimateNotificationRecipientsRequest)
Expand Down Expand Up @@ -2670,7 +2750,7 @@ public class Example {

DefaultApi apiInstance = new DefaultApi(defaultClient);
String appId = "YOUR_APP_ID"; // String | The OneSignal App ID for your app. Available in Keys & IDs.
String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // String | The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard.
String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // String | The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard.
Boolean includeSegmentDetail = true; // Boolean | Set to true to include segment metadata and filters in the response.
try {
GetSegmentSuccessResponse result = apiInstance.getSegment(appId, segmentId, includeSegmentDetail);
Expand All @@ -2694,7 +2774,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **appId** | **String**| The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
| **segmentId** | **String**| The segment&#39;s unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. | |
| **segmentId** | **String**| The segment&#39;s unique identifier. In the dashboard, go to Audience &gt; Segments, open the segment&#39;s options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment&#39;s URL in the dashboard. | |
| **includeSegmentDetail** | **Boolean**| Set to true to include segment metadata and filters in the response. | [optional] |

### Return type
Expand Down Expand Up @@ -3699,7 +3779,7 @@ public class Example {

DefaultApi apiInstance = new DefaultApi(defaultClient);
String appId = "YOUR_APP_ID"; // String | The OneSignal App ID for your app. Available in Keys & IDs.
String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // String | The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard.
String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // String | The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard.
UpdateSegmentRequest updateSegmentRequest = new UpdateSegmentRequest(); // UpdateSegmentRequest |
try {
UpdateSegmentSuccessResponse result = apiInstance.updateSegment(appId, segmentId, updateSegmentRequest);
Expand All @@ -3723,7 +3803,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **appId** | **String**| The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
| **segmentId** | **String**| The segment&#39;s unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. | |
| **segmentId** | **String**| The segment&#39;s unique identifier. In the dashboard, go to Audience &gt; Segments, open the segment&#39;s options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment&#39;s URL in the dashboard. | |
| **updateSegmentRequest** | [**UpdateSegmentRequest**](UpdateSegmentRequest.md)| | [optional] |

### Return type
Expand Down
20 changes: 20 additions & 0 deletions docs/DuplicateJourneyOverrides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


# DuplicateJourneyOverrides

Journey fields to apply over the copy as a JSON Merge Patch (RFC 7396). Accepts the same writable fields as Create journey, and none of them are required. The patch merges into the copy, not the source. The copy starts without a schedule, so an omitted schedule leaves the copy unscheduled. An object merges key by key. A null value clears a nullable field. An array such as nodes replaces the copied array. Server-controlled fields such as id or state are rejected.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | Name for the copy, up to 300 characters. If you omit it, the copy takes the name of the source plus \&quot; (Copy)\&quot;. | [optional] |
|**description** | **String** | Optional journey description, up to 1024 characters. If you omit it, the copy takes the description of the source. Send null to clear it. | [optional] |
|**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] |
|**earlyExit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] |
|**reentryRules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] |
|**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] |
|**nodes** | [**List&lt;JourneyNode&gt;**](JourneyNode.md) | Full ordered list of nodes. Replaces the copied graph. Server-assigned id fields are rejected. | [optional] |



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


# DuplicateJourneyRequest

Optional body for Duplicate journey. Only overrides is applied. A journey field sent at the top level is ignored.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**overrides** | [**DuplicateJourneyOverrides**](DuplicateJourneyOverrides.md) | | [optional] |



2 changes: 1 addition & 1 deletion docs/Journey.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Journey

Full journey representation returned by the detail, create, and update endpoints.
Full journey representation returned by the detail, create, update, and duplicate endpoints.

## Properties

Expand Down
4 changes: 2 additions & 2 deletions docs/JourneyNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A journey node. The kind field selects which other fields apply. Branching nodes
|**id** | **String** | Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error. | [optional] |
|**kind** | [**KindEnum**](#KindEnum) | Node kind. Selects which other fields apply. | |
|**clientNodeId** | **String** | Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. | [optional] |
|**annotation** | **String** | Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. | [optional] |
|**annotation** | **String** | Optional free-text label, up to 1024 characters. Stored and returned as-is with no effect on journey behavior. | [optional] |
|**durationSeconds** | **Integer** | wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). | [optional] |
|**relativeTo** | [**RelativeToEnum**](#RelativeToEnum) | time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user&#39;s last active time. | [optional] |
|**windows** | [**List&lt;JourneyTimeWindow&gt;**](JourneyTimeWindow.md) | time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. | [optional] |
Expand All @@ -23,7 +23,7 @@ A journey node. The kind field selects which other fields apply. Branching nodes
|**webhookId** | **String** | send_webhook nodes: UUID of the webhook to send. | [optional] |
|**assignments** | **Map&lt;String, String&gt;** | tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. | [optional] |
|**randomizeOnEntry** | **Boolean** | split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. | [optional] |
|**branches** | [**List&lt;JourneyBranch&gt;**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. | [optional] |
|**branches** | [**List&lt;JourneyBranch&gt;**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 condition branches. | [optional] |
|**expiration** | [**JourneyWaitUntilExpiration**](JourneyWaitUntilExpiration.md) | | [optional] |


Expand Down
4 changes: 2 additions & 2 deletions docs/UpdateJourneyNodeRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Node fields to change, merged onto the current node. Send only the fields you wa
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**clientNodeId** | **String** | Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. | [optional] |
|**annotation** | **String** | Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. | [optional] |
|**annotation** | **String** | Optional free-text label, up to 1024 characters. Stored and returned as-is with no effect on journey behavior. | [optional] |
|**durationSeconds** | **Integer** | wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). | [optional] |
|**relativeTo** | [**RelativeToEnum**](#RelativeToEnum) | time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user&#39;s last active time. | [optional] |
|**windows** | [**List&lt;JourneyTimeWindow&gt;**](JourneyTimeWindow.md) | time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. | [optional] |
Expand All @@ -21,7 +21,7 @@ Node fields to change, merged onto the current node. Send only the fields you wa
|**webhookId** | **String** | send_webhook nodes: UUID of the webhook to send. | [optional] |
|**assignments** | **Map&lt;String, String&gt;** | tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. | [optional] |
|**randomizeOnEntry** | **Boolean** | split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. | [optional] |
|**branches** | [**List&lt;JourneyBranch&gt;**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. | [optional] |
|**branches** | [**List&lt;JourneyBranch&gt;**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 condition branches. | [optional] |
|**expiration** | [**JourneyWaitUntilExpiration**](JourneyWaitUntilExpiration.md) | | [optional] |
|**concurrencyKey** | **String** | Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node. | [optional] |

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.DuplicateJourneyOverrides.CustomTypeAdapterFactory())
.registerTypeAdapterFactory(new com.onesignal.client.model.DuplicateJourneyRequest.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())
Expand Down
Loading
Loading