{"id":19251049,"url":"https://github.com/onesignal/onesignal-java-api","last_synced_at":"2026-04-18T01:09:39.699Z","repository":{"id":37765399,"uuid":"481471354","full_name":"OneSignal/onesignal-java-api","owner":"OneSignal","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-09T21:33:17.000Z","size":1372,"stargazers_count":12,"open_issues_count":4,"forks_count":27,"subscribers_count":30,"default_branch":"main","last_synced_at":"2026-04-09T23:23:43.207Z","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":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-14T04:59:32.000Z","updated_at":"2026-03-25T21:55:27.000Z","dependencies_parsed_at":"2024-11-09T18:21:40.168Z","dependency_job_id":"c7dc98a1-9902-4414-9032-af6cfe59f5e2","html_url":"https://github.com/OneSignal/onesignal-java-api","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/OneSignal/onesignal-java-api","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","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Fonesignal-java-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-04-18T01:09:39.690Z","avatar_url":"https://github.com/OneSignal.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# onesignal-java-client\n\nOneSignal\n- API version: 5.4.0\n\nA powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com\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\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.onesignal\u003c/groupId\u003e\n  \u003cartifactId\u003eonesignal-java-client\u003c/artifactId\u003e\n  \u003cversion\u003e5.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```groovy\nimplementation \"com.onesignal:onesignal-java-client:5.4.0\"\n```\n\n## Configuration\n\nEvery SDK requires authentication via API keys. Two key types are available:\n\n- **REST API Key** — required for most endpoints (sending notifications, managing users, etc.). Found in your app's **Settings \u003e Keys \u0026 IDs**.\n- **Organization API Key** — only required for organization-level endpoints like creating or listing apps. Found in **Organization Settings**.\n\n\u003e **Warning:** Store your API keys in environment variables or a secrets manager. Never commit them to source control.\n\n```java\nimport com.onesignal.client.ApiClient;\nimport com.onesignal.client.Configuration;\nimport com.onesignal.client.auth.HttpBearerAuth;\nimport com.onesignal.client.api.DefaultApi;\n\nApiClient defaultClient = Configuration.getDefaultApiClient();\n\nHttpBearerAuth restApiAuth = (HttpBearerAuth) defaultClient\n    .getAuthentication(\"rest_api_key\");\nrestApiAuth.setBearerToken(\"YOUR_REST_API_KEY\");\n\nHttpBearerAuth orgApiAuth = (HttpBearerAuth) defaultClient\n    .getAuthentication(\"organization_api_key\");\norgApiAuth.setBearerToken(\"YOUR_ORGANIZATION_API_KEY\");\n\nDefaultApi client = new DefaultApi(defaultClient);\n```\n\n## Send a push notification\n\n```java\nimport com.onesignal.client.model.Notification;\nimport com.onesignal.client.model.StringMap;\n\nNotification notification = new Notification();\nnotification.setAppId(\"YOUR_APP_ID\");\n\nStringMap contents = new StringMap();\ncontents.en(\"Hello from OneSignal!\");\nnotification.setContents(contents);\n\nStringMap headings = new StringMap();\nheadings.en(\"Push Notification\");\nnotification.setHeadings(headings);\n\nnotification.setIncludedSegments(Arrays.asList(\"Subscribed Users\"));\n\nvar response = client.createNotification(notification);\nSystem.out.println(\"Notification ID: \" + response.getId());\n```\n\n## Send an email\n\n```java\nNotification notification = new Notification();\nnotification.setAppId(\"YOUR_APP_ID\");\nnotification.setEmailSubject(\"Important Update\");\nnotification.setEmailBody(\"\u003ch1\u003eHello!\u003c/h1\u003e\u003cp\u003eThis is an HTML email.\u003c/p\u003e\");\nnotification.setIncludedSegments(Arrays.asList(\"Subscribed Users\"));\nnotification.setChannelForExternalUserIds(\"email\");\n\nvar response = client.createNotification(notification);\n```\n\n## Send an SMS\n\n```java\nStringMap contents = new StringMap();\ncontents.en(\"Your SMS message content here\");\n\nNotification notification = new Notification();\nnotification.setAppId(\"YOUR_APP_ID\");\nnotification.setContents(contents);\nnotification.setIncludedSegments(Arrays.asList(\"Subscribed Users\"));\nnotification.setChannelForExternalUserIds(\"sms\");\nnotification.setSmsFrom(\"+15551234567\");\n\nvar response = client.createNotification(notification);\n```\n\n## Full API reference\n\nThe complete list of API endpoints and their parameters is available in the [DefaultApi documentation](https://github.com/OneSignal/onesignal-java-api/blob/main/docs/DefaultApi.md).\n\nFor the underlying REST API, see the [OneSignal API reference](https://documentation.onesignal.com/reference).\n","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"}