{"id":19251049,"url":"https://github.com/onesignal/onesignal-java-api","last_synced_at":"2025-04-21T12:33:44.951Z","repository":{"id":37765399,"uuid":"481471354","full_name":"OneSignal/onesignal-java-api","owner":"OneSignal","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-01T23:47:08.000Z","size":643,"stargazers_count":5,"open_issues_count":5,"forks_count":10,"subscribers_count":28,"default_branch":"main","last_synced_at":"2023-08-02T00:29:17.321Z","etag":null,"topics":["email","in-app-messaging","java","onesignal","push-notifications","sms"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OneSignal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-14T04:59:32.000Z","updated_at":"2023-03-07T12:59:22.000Z","dependencies_parsed_at":"2023-02-08T16:31:51.149Z","dependency_job_id":null,"html_url":"https://github.com/OneSignal/onesignal-java-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fonesignal-java-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fonesignal-java-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fonesignal-java-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fonesignal-java-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OneSignal","download_url":"https://codeload.github.com/OneSignal/onesignal-java-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223864922,"owners_count":17216434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","in-app-messaging","java","onesignal","push-notifications","sms"],"created_at":"2024-11-09T18:19:45.083Z","updated_at":"2025-04-21T12:33:44.925Z","avatar_url":"https://github.com/OneSignal.png","language":"Java","readme":"# onesignal-java-client\n\nOneSignal\n- API version: 1.4.0\n  - Build date: 2025-02-20T21:54:45.185Z[Etc/UTC]\n\nA powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com\n\n  For more information, please visit [https://onesignal.com](https://onesignal.com)\n\n*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*\n\n\n## Requirements\n\nBuilding the API client library requires:\n1. Java 1.8+\n2. Maven (3.8.3+)/Gradle (7.2+)\n\n## Installation\n\nTo install the API client library to your local Maven repository, simply execute:\n\n```shell\nmvn clean install\n```\n\nTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:\n\n```shell\nmvn clean deploy\n```\n\nRefer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.\n\n### Maven users\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.openapitools\u003c/groupId\u003e\n  \u003cartifactId\u003eonesignal-java-client\u003c/artifactId\u003e\n  \u003cversion\u003e1.4.0\u003c/version\u003e\n  \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle users\n\nAdd this dependency to your project's build file:\n\n```groovy\n  repositories {\n    mavenCentral()     // Needed if the 'onesignal-java-client' jar has been published to maven central.\n    mavenLocal()       // Needed if the 'onesignal-java-client' jar has been published to the local maven repo.\n  }\n\n  dependencies {\n     implementation \"org.openapitools:onesignal-java-client:1.4.0\"\n  }\n```\n\n### Others\n\nAt first generate the JAR by executing:\n\n```shell\nmvn clean package\n```\n\nThen manually install the following JARs:\n\n* `target/onesignal-java-client-1.4.0.jar`\n* `target/lib/*.jar`\n\n## Getting Started\n\nPlease follow the [installation](#installation) instruction and execute the following Java code:\n\n```java\n\n// Import classes:\nimport com.onesignal.client.ApiClient;\nimport com.onesignal.client.ApiException;\nimport com.onesignal.client.Configuration;\nimport com.onesignal.client.auth.*;\nimport com.onesignal.client.models.*;\nimport com.onesignal.client.api.DefaultApi;\n\npublic class Example {\n  private static final String appId = \"YOUR_APP_ID\";\n  private static final String appKeyToken = \"YOUR_APP_KEY\";\n  private static final String userKeyToken = \"YOUR_USER_TOKEN\";\n\n  private static Notification createNotification() {\n    Notification notification = new Notification();\n    notification.setAppId(appId);\n    notification.setIsChrome(true);\n    notification.setIsAnyWeb(true);\n    notification.setIncludedSegments(Arrays.asList(new String[]{\"Subscribed Users\"}));\n    StringMap contentStringMap = new StringMap();\n    contentStringMap.en(\"Test\");\n    notification.setContents(contentStringMap);\n\n    return notification;\n  }\n\n  public static void main(String[] args) {\n    // Setting up the client\n    ApiClient defaultClient = Configuration.getDefaultApiClient();\n    HttpBearerAuth appKey = (HttpBearerAuth) defaultClient.getAuthentication(\"app_key\");\n    appKey.setBearerToken(appKeyToken);\n    HttpBearerAuth userKey = (HttpBearerAuth) defaultClient.getAuthentication(\"user_key\");\n    userKey.setBearerToken(userKeyToken);\n    api = new DefaultApi(defaultClient);\n\n    // Setting up the notification\n    Notification notification = createNotification();\n\n    // Sending the request\n    CreateNotificationSuccessResponse response = api.createNotification(notification);\n\n    // Checking the result\n    System.out.print(response.getId();\n  }\n}\n\n```\n\n## Documentation for API Endpoints\n\nAll URIs are relative to *https://api.onesignal.com*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*DefaultApi* | [**beginLiveActivity**](docs/DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity\n*DefaultApi* | [**cancelNotification**](docs/DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification\n*DefaultApi* | [**createApp**](docs/DefaultApi.md#createApp) | **POST** /apps | Create an app\n*DefaultApi* | [**createNotification**](docs/DefaultApi.md#createNotification) | **POST** /notifications | Create notification\n*DefaultApi* | [**createPlayer**](docs/DefaultApi.md#createPlayer) | **POST** /players | Add a device\n*DefaultApi* | [**createSegments**](docs/DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments\n*DefaultApi* | [**createSubscription**](docs/DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | \n*DefaultApi* | [**createUser**](docs/DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | \n*DefaultApi* | [**deleteAlias**](docs/DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | \n*DefaultApi* | [**deletePlayer**](docs/DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record\n*DefaultApi* | [**deleteSegments**](docs/DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments\n*DefaultApi* | [**deleteSubscription**](docs/DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | \n*DefaultApi* | [**deleteUser**](docs/DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | \n*DefaultApi* | [**endLiveActivity**](docs/DefaultApi.md#endLiveActivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity\n*DefaultApi* | [**exportEvents**](docs/DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id\u0026#x3D;{app_id} | Export CSV of Events\n*DefaultApi* | [**exportPlayers**](docs/DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id\u0026#x3D;{app_id} | Export CSV of Players\n*DefaultApi* | [**fetchAliases**](docs/DefaultApi.md#fetchAliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | \n*DefaultApi* | [**fetchUser**](docs/DefaultApi.md#fetchUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | \n*DefaultApi* | [**fetchUserIdentity**](docs/DefaultApi.md#fetchUserIdentity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | \n*DefaultApi* | [**getApp**](docs/DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app\n*DefaultApi* | [**getApps**](docs/DefaultApi.md#getApps) | **GET** /apps | View apps\n*DefaultApi* | [**getEligibleIams**](docs/DefaultApi.md#getEligibleIams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | \n*DefaultApi* | [**getNotification**](docs/DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification\n*DefaultApi* | [**getNotificationHistory**](docs/DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History\n*DefaultApi* | [**getNotifications**](docs/DefaultApi.md#getNotifications) | **GET** /notifications | View notifications\n*DefaultApi* | [**getOutcomes**](docs/DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes\n*DefaultApi* | [**getPlayer**](docs/DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device\n*DefaultApi* | [**getPlayers**](docs/DefaultApi.md#getPlayers) | **GET** /players | View devices\n*DefaultApi* | [**identifyUserByAlias**](docs/DefaultApi.md#identifyUserByAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | \n*DefaultApi* | [**identifyUserBySubscriptionId**](docs/DefaultApi.md#identifyUserBySubscriptionId) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | \n*DefaultApi* | [**transferSubscription**](docs/DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | \n*DefaultApi* | [**updateApp**](docs/DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app\n*DefaultApi* | [**updateLiveActivity**](docs/DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push\n*DefaultApi* | [**updatePlayer**](docs/DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device\n*DefaultApi* | [**updatePlayerTags**](docs/DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id\n*DefaultApi* | [**updateSubscription**](docs/DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | \n*DefaultApi* | [**updateUser**](docs/DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | \n\n\n## Documentation for Models\n\n - [App](docs/App.md)\n - [BasicNotification](docs/BasicNotification.md)\n - [BasicNotificationAllOf](docs/BasicNotificationAllOf.md)\n - [BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md)\n - [BeginLiveActivityRequest](docs/BeginLiveActivityRequest.md)\n - [Button](docs/Button.md)\n - [CancelNotificationSuccessResponse](docs/CancelNotificationSuccessResponse.md)\n - [CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md)\n - [CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md)\n - [CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md)\n - [CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md)\n - [CreateSubscriptionRequestBody](docs/CreateSubscriptionRequestBody.md)\n - [CreateUserConflictResponse](docs/CreateUserConflictResponse.md)\n - [CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md)\n - [CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md)\n - [DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md)\n - [DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md)\n - [DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md)\n - [DeleteSegmentSuccessResponse](docs/DeleteSegmentSuccessResponse.md)\n - [DeliveryData](docs/DeliveryData.md)\n - [ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md)\n - [ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md)\n - [ExportPlayersSuccessResponse](docs/ExportPlayersSuccessResponse.md)\n - [Filter](docs/Filter.md)\n - [FilterExpressions](docs/FilterExpressions.md)\n - [GenericError](docs/GenericError.md)\n - [GenericErrorErrorsInner](docs/GenericErrorErrorsInner.md)\n - [GetNotificationRequestBody](docs/GetNotificationRequestBody.md)\n - [InlineResponse200](docs/InlineResponse200.md)\n - [InlineResponse2003](docs/InlineResponse2003.md)\n - [InlineResponse201](docs/InlineResponse201.md)\n - [InlineResponse202](docs/InlineResponse202.md)\n - [InvalidIdentifierError](docs/InvalidIdentifierError.md)\n - [Notification](docs/Notification.md)\n - [Notification200Errors](docs/Notification200Errors.md)\n - [NotificationAllOf](docs/NotificationAllOf.md)\n - [NotificationHistorySuccessResponse](docs/NotificationHistorySuccessResponse.md)\n - [NotificationSlice](docs/NotificationSlice.md)\n - [NotificationTarget](docs/NotificationTarget.md)\n - [NotificationWithMeta](docs/NotificationWithMeta.md)\n - [NotificationWithMetaAllOf](docs/NotificationWithMetaAllOf.md)\n - [Operator](docs/Operator.md)\n - [OutcomeData](docs/OutcomeData.md)\n - [OutcomesData](docs/OutcomesData.md)\n - [PlatformDeliveryData](docs/PlatformDeliveryData.md)\n - [PlatformDeliveryDataEmailAllOf](docs/PlatformDeliveryDataEmailAllOf.md)\n - [PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md)\n - [Player](docs/Player.md)\n - [PlayerNotificationTarget](docs/PlayerNotificationTarget.md)\n - [PlayerNotificationTargetIncludeAliases](docs/PlayerNotificationTargetIncludeAliases.md)\n - [PlayerSlice](docs/PlayerSlice.md)\n - [PropertiesDeltas](docs/PropertiesDeltas.md)\n - [PropertiesObject](docs/PropertiesObject.md)\n - [Purchase](docs/Purchase.md)\n - [RateLimiterError](docs/RateLimiterError.md)\n - [Segment](docs/Segment.md)\n - [SegmentNotificationTarget](docs/SegmentNotificationTarget.md)\n - [StringMap](docs/StringMap.md)\n - [SubscriptionObject](docs/SubscriptionObject.md)\n - [TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md)\n - [UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md)\n - [UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md)\n - [UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md)\n - [UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md)\n - [UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md)\n - [UpdateSubscriptionRequestBody](docs/UpdateSubscriptionRequestBody.md)\n - [UpdateUserRequest](docs/UpdateUserRequest.md)\n - [User](docs/User.md)\n - [UserIdentityRequestBody](docs/UserIdentityRequestBody.md)\n - [UserIdentityResponse](docs/UserIdentityResponse.md)\n - [UserSubscriptionOptions](docs/UserSubscriptionOptions.md)\n\n\n## Documentation for Authorization\n\nAuthentication schemes defined for the API:\n### app_key\n\n- **Type**: HTTP basic authentication\n\n### user_key\n\n- **Type**: HTTP basic authentication\n\n\n## Recommendation\n\nIt's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.\n\n## Author\n\ndevrel@onesignal.com\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesignal%2Fonesignal-java-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonesignal%2Fonesignal-java-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesignal%2Fonesignal-java-api/lists"}