|
| 1 | +# onesignal-java-client |
| 2 | + |
| 3 | +OneSignal |
| 4 | +- API version: 1.0.2 |
| 5 | + - Build date: 2022-04-25T12:25:49.025-07:00[America/Los_Angeles] |
| 6 | + |
| 7 | +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com |
| 8 | + |
| 9 | + For more information, please visit [https://onesignal.com](https://onesignal.com) |
| 10 | + |
| 11 | +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* |
| 12 | + |
| 13 | + |
| 14 | +## Requirements |
| 15 | + |
| 16 | +Building the API client library requires: |
| 17 | +1. Java 1.8+ |
| 18 | +2. Maven (3.8.3+)/Gradle (7.2+) |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +To install the API client library to your local Maven repository, simply execute: |
| 23 | + |
| 24 | +```shell |
| 25 | +mvn clean install |
| 26 | +``` |
| 27 | + |
| 28 | +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: |
| 29 | + |
| 30 | +```shell |
| 31 | +mvn clean deploy |
| 32 | +``` |
| 33 | + |
| 34 | +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. |
| 35 | + |
| 36 | +### Maven users |
| 37 | + |
| 38 | +Add this dependency to your project's POM: |
| 39 | + |
| 40 | +```xml |
| 41 | +<dependency> |
| 42 | + <groupId>org.openapitools</groupId> |
| 43 | + <artifactId>onesignal-java-client</artifactId> |
| 44 | + <version>1.0.2</version> |
| 45 | + <scope>compile</scope> |
| 46 | +</dependency> |
| 47 | +``` |
| 48 | + |
| 49 | +### Gradle users |
| 50 | + |
| 51 | +Add this dependency to your project's build file: |
| 52 | + |
| 53 | +```groovy |
| 54 | + repositories { |
| 55 | + mavenCentral() // Needed if the 'onesignal-java-client' jar has been published to maven central. |
| 56 | + mavenLocal() // Needed if the 'onesignal-java-client' jar has been published to the local maven repo. |
| 57 | + } |
| 58 | +
|
| 59 | + dependencies { |
| 60 | + implementation "org.openapitools:onesignal-java-client:1.0.2" |
| 61 | + } |
| 62 | +``` |
| 63 | + |
| 64 | +### Others |
| 65 | + |
| 66 | +At first generate the JAR by executing: |
| 67 | + |
| 68 | +```shell |
| 69 | +mvn clean package |
| 70 | +``` |
| 71 | + |
| 72 | +Then manually install the following JARs: |
| 73 | + |
| 74 | +* `target/onesignal-java-client-1.0.2.jar` |
| 75 | +* `target/lib/*.jar` |
| 76 | + |
| 77 | +## Getting Started |
| 78 | + |
| 79 | +Please follow the [installation](#installation) instruction and execute the following Java code: |
| 80 | + |
| 81 | +```java |
| 82 | + |
| 83 | +// Import classes: |
| 84 | +import com.onesignal.client.ApiClient; |
| 85 | +import com.onesignal.client.ApiException; |
| 86 | +import com.onesignal.client.Configuration; |
| 87 | +import com.onesignal.client.auth.*; |
| 88 | +import com.onesignal.client.models.*; |
| 89 | +import com.onesignal.client.api.DefaultApi; |
| 90 | + |
| 91 | +public class Example { |
| 92 | + public static void main(String[] args) { |
| 93 | + // Define constants |
| 94 | + String appKeyToken = "YOUR_APP_KEY"; |
| 95 | + String userKeyToken = "YOUR_USER_TOKEN"; |
| 96 | + |
| 97 | + // Setting up the client |
| 98 | + ApiClient defaultClient = Configuration.getDefaultApiClient(); |
| 99 | + HttpBearerAuth appKey = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); |
| 100 | + appKey.setBearerToken(appKeyToken); |
| 101 | + HttpBearerAuth userKey = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); |
| 102 | + userKey.setBearerToken(userKeyToken); |
| 103 | + api = new DefaultApi(defaultClient); |
| 104 | + |
| 105 | + // Setting up the notification |
| 106 | + Notification notification = createNotification(); |
| 107 | + |
| 108 | + // Sending the request |
| 109 | + InlineResponse200 response = api.createNotification(notification); |
| 110 | + |
| 111 | + // Checking the result |
| 112 | + System.out.print(response.getId(); |
| 113 | + } |
| 114 | +} |
| 115 | + |
| 116 | +``` |
| 117 | + |
| 118 | +## Documentation for API Endpoints |
| 119 | + |
| 120 | +All URIs are relative to *https://onesignal.com/api/v1* |
| 121 | + |
| 122 | +Class | Method | HTTP request | Description |
| 123 | +------------ | ------------- | ------------- | ------------- |
| 124 | +*DefaultApi* | [**cancelNotification**](docs/DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
| 125 | +*DefaultApi* | [**createApp**](docs/DefaultApi.md#createApp) | **POST** /apps | Create an app |
| 126 | +*DefaultApi* | [**createNotification**](docs/DefaultApi.md#createNotification) | **POST** /notifications | Create notification |
| 127 | +*DefaultApi* | [**createPlayer**](docs/DefaultApi.md#createPlayer) | **POST** /players | Add a device |
| 128 | +*DefaultApi* | [**createSegments**](docs/DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments |
| 129 | +*DefaultApi* | [**deletePlayer**](docs/DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record |
| 130 | +*DefaultApi* | [**deleteSegments**](docs/DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments |
| 131 | +*DefaultApi* | [**exportPlayers**](docs/DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | CSV export |
| 132 | +*DefaultApi* | [**getApp**](docs/DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app |
| 133 | +*DefaultApi* | [**getApps**](docs/DefaultApi.md#getApps) | **GET** /apps | View apps |
| 134 | +*DefaultApi* | [**getNotification**](docs/DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification |
| 135 | +*DefaultApi* | [**getNotificationHistory**](docs/DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History |
| 136 | +*DefaultApi* | [**getNotifications**](docs/DefaultApi.md#getNotifications) | **GET** /notifications | View notifications |
| 137 | +*DefaultApi* | [**getOutcomes**](docs/DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes |
| 138 | +*DefaultApi* | [**getPlayer**](docs/DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device |
| 139 | +*DefaultApi* | [**getPlayers**](docs/DefaultApi.md#getPlayers) | **GET** /players | View devices |
| 140 | +*DefaultApi* | [**updateApp**](docs/DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app |
| 141 | +*DefaultApi* | [**updatePlayer**](docs/DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device |
| 142 | +*DefaultApi* | [**updatePlayerTags**](docs/DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id |
| 143 | + |
| 144 | + |
| 145 | +## Documentation for Models |
| 146 | + |
| 147 | + - [App](docs/App.md) |
| 148 | + - [Button](docs/Button.md) |
| 149 | + - [DeliveryData](docs/DeliveryData.md) |
| 150 | + - [ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md) |
| 151 | + - [Filter](docs/Filter.md) |
| 152 | + - [FilterExpressions](docs/FilterExpressions.md) |
| 153 | + - [FilterNotificationTarget](docs/FilterNotificationTarget.md) |
| 154 | + - [GetNotificationRequestBody](docs/GetNotificationRequestBody.md) |
| 155 | + - [InlineResponse200](docs/InlineResponse200.md) |
| 156 | + - [InlineResponse2001](docs/InlineResponse2001.md) |
| 157 | + - [InlineResponse2002](docs/InlineResponse2002.md) |
| 158 | + - [InlineResponse2003](docs/InlineResponse2003.md) |
| 159 | + - [InlineResponse2004](docs/InlineResponse2004.md) |
| 160 | + - [InlineResponse2005](docs/InlineResponse2005.md) |
| 161 | + - [InlineResponse201](docs/InlineResponse201.md) |
| 162 | + - [InlineResponse400](docs/InlineResponse400.md) |
| 163 | + - [InlineResponse4001](docs/InlineResponse4001.md) |
| 164 | + - [InlineResponse4002](docs/InlineResponse4002.md) |
| 165 | + - [InlineResponse4003](docs/InlineResponse4003.md) |
| 166 | + - [InvalidIdentifierError](docs/InvalidIdentifierError.md) |
| 167 | + - [Notification](docs/Notification.md) |
| 168 | + - [Notification200Errors](docs/Notification200Errors.md) |
| 169 | + - [NotificationAllOf](docs/NotificationAllOf.md) |
| 170 | + - [NotificationAllOfAndroidBackgroundLayout](docs/NotificationAllOfAndroidBackgroundLayout.md) |
| 171 | + - [NotificationSlice](docs/NotificationSlice.md) |
| 172 | + - [NotificationTarget](docs/NotificationTarget.md) |
| 173 | + - [Operator](docs/Operator.md) |
| 174 | + - [OutcomeData](docs/OutcomeData.md) |
| 175 | + - [OutcomesData](docs/OutcomesData.md) |
| 176 | + - [PlatformDeliveryData](docs/PlatformDeliveryData.md) |
| 177 | + - [Player](docs/Player.md) |
| 178 | + - [PlayerNotificationTarget](docs/PlayerNotificationTarget.md) |
| 179 | + - [PlayerSlice](docs/PlayerSlice.md) |
| 180 | + - [Purchase](docs/Purchase.md) |
| 181 | + - [Segment](docs/Segment.md) |
| 182 | + - [SegmentNotificationTarget](docs/SegmentNotificationTarget.md) |
| 183 | + - [StringMap](docs/StringMap.md) |
| 184 | + - [UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md) |
| 185 | + |
| 186 | + |
| 187 | +## Documentation for Authorization |
| 188 | + |
| 189 | +Authentication schemes defined for the API: |
| 190 | +### app_key |
| 191 | + |
| 192 | +- **Type**: HTTP basic authentication |
| 193 | + |
| 194 | +### user_key |
| 195 | + |
| 196 | +- **Type**: HTTP basic authentication |
| 197 | + |
| 198 | + |
| 199 | +## Recommendation |
| 200 | + |
| 201 | +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. |
| 202 | +
|
| 203 | +## Author |
| 204 | +
|
| 205 | + |
| 206 | +
|
0 commit comments