https://github.com/onesignal/onesignal-ruby-api
https://github.com/onesignal/onesignal-ruby-api
email in-app-messaging notifications push-notifications ruby sms
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/onesignal/onesignal-ruby-api
- Owner: OneSignal
- License: other
- Created: 2016-02-22T17:21:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T23:56:42.000Z (over 2 years ago)
- Last Synced: 2023-08-02T00:29:16.016Z (over 2 years ago)
- Topics: email, in-app-messaging, notifications, push-notifications, ruby, sms
- Language: Ruby
- Size: 327 KB
- Stars: 12
- Watchers: 27
- Forks: 8
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# onesignal
OneSignal - the Ruby gem for the OneSignal
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 5.2.0
- Package version: 5.2.0-beta1
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
For more information, please visit [https://onesignal.com](https://onesignal.com)
## Installation
### Build a gem
To build the Ruby code into a gem:
```shell
gem build onesignal.gemspec
```
Then either install the gem locally:
```shell
gem install ./onesignal-5.2.0-beta1.gem
```
(for development, run `gem install --dev ./onesignal-5.2.0-beta1.gem` to install the development dependencies)
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
Finally add this to the Gemfile:
gem 'onesignal', '~> 5.2.0-beta1'
### Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'onesignal', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
### Include the Ruby code directly
Include the Ruby code directly using `-I` as follows:
```shell
ruby -Ilib script.rb
```
## Getting Started
Please follow the [installation](#installation) procedure and then run the following code:
```ruby
# Load the gem
require 'onesignal'
# Setup authorization
OneSignal.configure do |config|
# Configure Bearer authorization: organization_api_key
config.organization_api_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
# Configure Bearer authorization: rest_api_key
config.rest_api_key = 'REST_API_KEY' # App REST API key required for most endpoints
end
api_instance = OneSignal::DefaultApi.new
app_id = 'app_id_example' # String |
notification_id = 'notification_id_example' # String |
begin
#Stop a scheduled or currently outgoing notification
result = api_instance.cancel_notification(app_id, notification_id)
p result
rescue OneSignal::ApiError => e
puts "Exception when calling DefaultApi->cancel_notification: #{e}"
end
```
## Documentation for API Endpoints
All URIs are relative to *https://api.onesignal.com*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*OneSignal::DefaultApi* | [**cancel_notification**](docs/DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
*OneSignal::DefaultApi* | [**create_alias**](docs/DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
*OneSignal::DefaultApi* | [**create_alias_by_subscription**](docs/DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
*OneSignal::DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create an app
*OneSignal::DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification
*OneSignal::DefaultApi* | [**create_segment**](docs/DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment
*OneSignal::DefaultApi* | [**create_subscription**](docs/DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions |
*OneSignal::DefaultApi* | [**create_user**](docs/DefaultApi.md#create_user) | **POST** /apps/{app_id}/users |
*OneSignal::DefaultApi* | [**delete_alias**](docs/DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} |
*OneSignal::DefaultApi* | [**delete_segment**](docs/DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment
*OneSignal::DefaultApi* | [**delete_subscription**](docs/DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} |
*OneSignal::DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
*OneSignal::DefaultApi* | [**export_events**](docs/DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events
*OneSignal::DefaultApi* | [**export_subscriptions**](docs/DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions
*OneSignal::DefaultApi* | [**get_aliases**](docs/DefaultApi.md#get_aliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
*OneSignal::DefaultApi* | [**get_aliases_by_subscription**](docs/DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
*OneSignal::DefaultApi* | [**get_app**](docs/DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app
*OneSignal::DefaultApi* | [**get_apps**](docs/DefaultApi.md#get_apps) | **GET** /apps | View apps
*OneSignal::DefaultApi* | [**get_notification**](docs/DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification
*OneSignal::DefaultApi* | [**get_notification_history**](docs/DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History
*OneSignal::DefaultApi* | [**get_notifications**](docs/DefaultApi.md#get_notifications) | **GET** /notifications | View notifications
*OneSignal::DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
*OneSignal::DefaultApi* | [**get_segments**](docs/DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments
*OneSignal::DefaultApi* | [**get_user**](docs/DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
*OneSignal::DefaultApi* | [**transfer_subscription**](docs/DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner |
*OneSignal::DefaultApi* | [**unsubscribe_email_with_token**](docs/DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token
*OneSignal::DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app
*OneSignal::DefaultApi* | [**update_live_activity**](docs/DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
*OneSignal::DefaultApi* | [**update_subscription**](docs/DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} |
*OneSignal::DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
## Documentation for Models
- [OneSignal::App](docs/App.md)
- [OneSignal::BasicNotification](docs/BasicNotification.md)
- [OneSignal::BasicNotificationAllOf](docs/BasicNotificationAllOf.md)
- [OneSignal::BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md)
- [OneSignal::Button](docs/Button.md)
- [OneSignal::CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md)
- [OneSignal::CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md)
- [OneSignal::CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md)
- [OneSignal::CreateUserConflictResponse](docs/CreateUserConflictResponse.md)
- [OneSignal::CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md)
- [OneSignal::CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md)
- [OneSignal::DeliveryData](docs/DeliveryData.md)
- [OneSignal::ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md)
- [OneSignal::ExportSubscriptionsRequestBody](docs/ExportSubscriptionsRequestBody.md)
- [OneSignal::ExportSubscriptionsSuccessResponse](docs/ExportSubscriptionsSuccessResponse.md)
- [OneSignal::Filter](docs/Filter.md)
- [OneSignal::FilterExpression](docs/FilterExpression.md)
- [OneSignal::GenericError](docs/GenericError.md)
- [OneSignal::GenericSuccessBoolResponse](docs/GenericSuccessBoolResponse.md)
- [OneSignal::GetNotificationHistoryRequestBody](docs/GetNotificationHistoryRequestBody.md)
- [OneSignal::GetSegmentsSuccessResponse](docs/GetSegmentsSuccessResponse.md)
- [OneSignal::LanguageStringMap](docs/LanguageStringMap.md)
- [OneSignal::Notification](docs/Notification.md)
- [OneSignal::NotificationAllOf](docs/NotificationAllOf.md)
- [OneSignal::NotificationHistorySuccessResponse](docs/NotificationHistorySuccessResponse.md)
- [OneSignal::NotificationSlice](docs/NotificationSlice.md)
- [OneSignal::NotificationTarget](docs/NotificationTarget.md)
- [OneSignal::NotificationWithMeta](docs/NotificationWithMeta.md)
- [OneSignal::NotificationWithMetaAllOf](docs/NotificationWithMetaAllOf.md)
- [OneSignal::Operator](docs/Operator.md)
- [OneSignal::OutcomeData](docs/OutcomeData.md)
- [OneSignal::OutcomesData](docs/OutcomesData.md)
- [OneSignal::PlatformDeliveryData](docs/PlatformDeliveryData.md)
- [OneSignal::PlatformDeliveryDataEmailAllOf](docs/PlatformDeliveryDataEmailAllOf.md)
- [OneSignal::PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md)
- [OneSignal::PropertiesBody](docs/PropertiesBody.md)
- [OneSignal::PropertiesDeltas](docs/PropertiesDeltas.md)
- [OneSignal::PropertiesObject](docs/PropertiesObject.md)
- [OneSignal::Purchase](docs/Purchase.md)
- [OneSignal::RateLimitError](docs/RateLimitError.md)
- [OneSignal::Segment](docs/Segment.md)
- [OneSignal::SegmentData](docs/SegmentData.md)
- [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md)
- [OneSignal::Subscription](docs/Subscription.md)
- [OneSignal::SubscriptionBody](docs/SubscriptionBody.md)
- [OneSignal::SubscriptionNotificationTarget](docs/SubscriptionNotificationTarget.md)
- [OneSignal::TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md)
- [OneSignal::UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md)
- [OneSignal::UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md)
- [OneSignal::UpdateUserRequest](docs/UpdateUserRequest.md)
- [OneSignal::User](docs/User.md)
- [OneSignal::UserIdentityBody](docs/UserIdentityBody.md)
- [OneSignal::WebButton](docs/WebButton.md)
## Documentation for Authorization
### organization_api_key
- **Type**: Bearer authentication
### rest_api_key
- **Type**: Bearer authentication