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 project:
- API version: 5.1.0
- Package version: 5.1.0-beta1
- Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://onesignal.com
To build the Ruby code into a gem:
gem build onesignal.gemspec
Then either install the gem locally:
gem install ./onesignal-5.1.0-beta1.gem
(for development, run gem install --dev ./onesignal-5.1.0-beta1.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'onesignal', '~> 5.1.0-beta1'
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 using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# 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
All URIs are relative to https://api.onesignal.com
Class | Method | HTTP request | Description |
---|---|---|---|
OneSignal::DefaultApi | cancel_notification | DELETE /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
OneSignal::DefaultApi | create_alias | PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
OneSignal::DefaultApi | create_alias_by_subscription | PATCH /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
OneSignal::DefaultApi | create_app | POST /apps | Create an app |
OneSignal::DefaultApi | create_notification | POST /notifications | Create notification |
OneSignal::DefaultApi | create_segment | POST /apps/{app_id}/segments | Create Segment |
OneSignal::DefaultApi | create_subscription | POST /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | |
OneSignal::DefaultApi | create_user | POST /apps/{app_id}/users | |
OneSignal::DefaultApi | delete_alias | DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | |
OneSignal::DefaultApi | delete_segment | DELETE /apps/{app_id}/segments/{segment_id} | Delete Segment |
OneSignal::DefaultApi | delete_subscription | DELETE /apps/{app_id}/subscriptions/{subscription_id} | |
OneSignal::DefaultApi | delete_user | DELETE /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
OneSignal::DefaultApi | export_events | POST /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
OneSignal::DefaultApi | export_subscriptions | POST /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
OneSignal::DefaultApi | get_aliases | GET /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
OneSignal::DefaultApi | get_aliases_by_subscription | GET /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
OneSignal::DefaultApi | get_app | GET /apps/{app_id} | View an app |
OneSignal::DefaultApi | get_apps | GET /apps | View apps |
OneSignal::DefaultApi | get_notification | GET /notifications/{notification_id} | View notification |
OneSignal::DefaultApi | get_notification_history | POST /notifications/{notification_id}/history | Notification History |
OneSignal::DefaultApi | get_notifications | GET /notifications | View notifications |
OneSignal::DefaultApi | get_outcomes | GET /apps/{app_id}/outcomes | View Outcomes |
OneSignal::DefaultApi | get_segments | GET /apps/{app_id}/segments | Get Segments |
OneSignal::DefaultApi | get_user | GET /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
OneSignal::DefaultApi | transfer_subscription | PATCH /apps/{app_id}/subscriptions/{subscription_id}/owner | |
OneSignal::DefaultApi | unsubscribe_email_with_token | POST /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token |
OneSignal::DefaultApi | update_app | PUT /apps/{app_id} | Update an app |
OneSignal::DefaultApi | update_live_activity | POST /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push |
OneSignal::DefaultApi | update_subscription | PATCH /apps/{app_id}/subscriptions/{subscription_id} | |
OneSignal::DefaultApi | update_user | PATCH /apps/{app_id}/users/by/{alias_label}/{alias_id} |
- OneSignal::App
- OneSignal::BasicNotification
- OneSignal::BasicNotificationAllOf
- OneSignal::BasicNotificationAllOfAndroidBackgroundLayout
- OneSignal::Button
- OneSignal::CreateNotificationSuccessResponse
- OneSignal::CreateSegmentConflictResponse
- OneSignal::CreateSegmentSuccessResponse
- OneSignal::CreateUserConflictResponse
- OneSignal::CreateUserConflictResponseErrorsInner
- OneSignal::CreateUserConflictResponseErrorsItemsMeta
- OneSignal::DeliveryData
- OneSignal::ExportEventsSuccessResponse
- OneSignal::ExportSubscriptionsRequestBody
- OneSignal::ExportSubscriptionsSuccessResponse
- OneSignal::Filter
- OneSignal::FilterExpression
- OneSignal::GenericError
- OneSignal::GenericSuccessBoolResponse
- OneSignal::GetNotificationHistoryRequestBody
- OneSignal::GetSegmentsSuccessResponse
- OneSignal::LanguageStringMap
- OneSignal::Notification
- OneSignal::NotificationAllOf
- OneSignal::NotificationHistorySuccessResponse
- OneSignal::NotificationSlice
- OneSignal::NotificationTarget
- OneSignal::NotificationWithMeta
- OneSignal::NotificationWithMetaAllOf
- OneSignal::Operator
- OneSignal::OutcomeData
- OneSignal::OutcomesData
- OneSignal::PlatformDeliveryData
- OneSignal::PlatformDeliveryDataEmailAllOf
- OneSignal::PlatformDeliveryDataSmsAllOf
- OneSignal::PropertiesBody
- OneSignal::PropertiesDeltas
- OneSignal::PropertiesObject
- OneSignal::Purchase
- OneSignal::RateLimitError
- OneSignal::Segment
- OneSignal::SegmentData
- OneSignal::SegmentNotificationTarget
- OneSignal::Subscription
- OneSignal::SubscriptionBody
- OneSignal::SubscriptionNotificationTarget
- OneSignal::TransferSubscriptionRequestBody
- OneSignal::UpdateLiveActivityRequest
- OneSignal::UpdateLiveActivitySuccessResponse
- OneSignal::UpdateUserRequest
- OneSignal::User
- OneSignal::UserIdentityBody
- OneSignal::WebButton
- Type: Bearer authentication
- Type: Bearer authentication