Skip to content
Open
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
600 changes: 592 additions & 8 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
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