From f2db33d1d27d75b726354b3407a2393d7a28e8f6 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 13 May 2025 23:46:31 +0000 Subject: [PATCH] feat: add v5.0.0-beta1 package updates --- .github/ISSUE_TEMPLATE/ask-question.yml | 6 +- .github/ISSUE_TEMPLATE/bug-report.yml | 4 +- .github/ISSUE_TEMPLATE/general-feedback.yml | 6 +- .github/workflows/project.yml | 17 + README.md | 107 +- docs/BasicNotification.md | 36 +- docs/BasicNotificationAllOf.md | 16 +- docs/BeginLiveActivityRequest.md | 20 - docs/CancelNotificationSuccessResponse.md | 18 - docs/CreateNotificationSuccessResponse.md | 4 +- docs/CreatePlayerSuccessResponse.md | 20 - docs/CreateSubscriptionRequestBody.md | 20 - docs/DefaultApi.md | 1312 +++++------------ docs/DeletePlayerNotFoundResponse.md | 18 - docs/DeleteSegmentNotFoundResponse.md | 18 - docs/DeleteSegmentSuccessResponse.md | 18 - ...y.md => ExportSubscriptionsRequestBody.md} | 4 +- ... => ExportSubscriptionsSuccessResponse.md} | 4 +- docs/Filter.md | 12 +- ...cation200Errors.md => FilterExpression.md} | 18 +- docs/FilterExpressions.md | 26 - docs/GenericError.md | 8 +- ...ponse.md => GenericSuccessBoolResponse.md} | 4 +- ...d => GetNotificationHistoryRequestBody.md} | 4 +- docs/GetSegmentsSuccessResponse.md | 24 + docs/InlineResponse2003.md | 18 - docs/InlineResponse201.md | 18 - docs/InvalidIdentifierError.md | 20 - docs/{StringMap.md => LanguageStringMap.md} | 4 +- docs/Notification.md | 36 +- docs/NotificationTarget.md | 20 +- docs/NotificationWithMeta.md | 36 +- docs/Player.md | 70 - docs/PlayerNotificationTarget.md | 40 - .../PlayerNotificationTargetIncludeAliases.md | 18 - docs/PlayerSlice.md | 24 - ...InlineResponse202.md => PropertiesBody.md} | 4 +- docs/PropertiesDeltas.md | 4 +- docs/PropertiesObject.md | 4 +- docs/Purchase.md | 2 +- docs/RateLimitError.md | 20 + docs/Segment.md | 2 +- docs/SegmentData.md | 30 + ...{SubscriptionObject.md => Subscription.md} | 14 +- docs/SubscriptionBody.md | 18 + docs/SubscriptionNotificationTarget.md | 38 + docs/TransferSubscriptionRequestBody.md | 2 +- docs/UpdateLiveActivityRequest.md | 18 +- docs/UpdateLiveActivitySuccessResponse.md | 6 +- docs/UpdatePlayerSuccessResponse.md | 18 - docs/UpdatePlayerTagsRequestBody.md | 18 - docs/UpdatePlayerTagsSuccessResponse.md | 18 - docs/UpdateSubscriptionRequestBody.md | 18 - docs/User.md | 8 +- ...lineResponse200.md => UserIdentityBody.md} | 6 +- docs/UserIdentityRequestBody.md | 18 - docs/UserIdentityResponse.md | 18 - docs/UserSubscriptionOptions.md | 18 - docs/WebButton.md | 24 + lib/onesignal.rb | 50 +- lib/onesignal/api/default_api.rb | 1272 +++++----------- lib/onesignal/api_client.rb | 4 +- lib/onesignal/api_error.rb | 2 +- lib/onesignal/configuration.rb | 10 +- lib/onesignal/models/app.rb | 2 +- lib/onesignal/models/basic_notification.rb | 96 +- .../models/basic_notification_all_of.rb | 46 +- ...cation_all_of_android_background_layout.rb | 2 +- lib/onesignal/models/button.rb | 2 +- .../cancel_notification_success_response.rb | 219 --- .../create_notification_success_response.rb | 18 +- .../create_segment_conflict_response.rb | 2 +- .../models/create_segment_success_response.rb | 2 +- .../create_subscription_request_body.rb | 228 --- .../models/create_user_conflict_response.rb | 2 +- ...ate_user_conflict_response_errors_inner.rb | 2 +- ...ser_conflict_response_errors_items_meta.rb | 2 +- .../delete_player_not_found_response.rb | 219 --- .../models/delete_player_success_response.rb | 219 --- .../delete_segment_not_found_response.rb | 219 --- .../models/delete_segment_success_response.rb | 219 --- lib/onesignal/models/delivery_data.rb | 2 +- .../models/export_events_success_response.rb | 2 +- ...b => export_subscriptions_request_body.rb} | 8 +- ... export_subscriptions_success_response.rb} | 8 +- lib/onesignal/models/filter.rb | 58 +- ...tion200_errors.rb => filter_expression.rb} | 8 +- lib/onesignal/models/filter_expressions.rb | 336 ----- lib/onesignal/models/generic_error.rb | 34 +- .../models/generic_error_errors_inner.rb | 228 --- ...se.rb => generic_success_bool_response.rb} | 8 +- ... get_notification_history_request_body.rb} | 8 +- ...ce.rb => get_segments_success_response.rb} | 28 +- lib/onesignal/models/inline_response2003.rb | 221 --- .../models/invalid_identifier_error.rb | 234 --- .../{string_map.rb => language_string_map.rb} | 8 +- lib/onesignal/models/notification.rb | 96 +- lib/onesignal/models/notification_all_of.rb | 2 +- .../notification_history_success_response.rb | 2 +- lib/onesignal/models/notification_slice.rb | 2 +- lib/onesignal/models/notification_target.rb | 58 +- .../models/notification_with_meta.rb | 96 +- .../models/notification_with_meta_all_of.rb | 2 +- lib/onesignal/models/operator.rb | 2 +- lib/onesignal/models/outcome_data.rb | 2 +- lib/onesignal/models/outcomes_data.rb | 2 +- .../models/platform_delivery_data.rb | 2 +- .../platform_delivery_data_email_all_of.rb | 2 +- .../platform_delivery_data_sms_all_of.rb | 2 +- lib/onesignal/models/player.rb | 494 ------- ...yer_notification_target_include_aliases.rb | 221 --- ...line_response202.rb => properties_body.rb} | 8 +- lib/onesignal/models/properties_deltas.rb | 6 +- lib/onesignal/models/properties_object.rb | 6 +- lib/onesignal/models/purchase.rb | 4 +- ...e_limiter_error.rb => rate_limit_error.rb} | 25 +- lib/onesignal/models/segment.rb | 4 +- ...ve_activity_request.rb => segment_data.rb} | 96 +- .../models/segment_notification_target.rb | 2 +- ...subscription_object.rb => subscription.rb} | 18 +- ...ne_response201.rb => subscription_body.rb} | 10 +- ...rb => subscription_notification_target.rb} | 60 +- .../transfer_subscription_request_body.rb | 28 +- .../models/update_live_activity_request.rb | 81 +- .../update_live_activity_success_response.rb | 25 +- .../models/update_player_tags_request_body.rb | 220 --- .../update_player_tags_success_response.rb | 219 --- .../update_subscription_request_body.rb | 219 --- lib/onesignal/models/update_user_request.rb | 2 +- lib/onesignal/models/user.rb | 21 +- ...e_response200.rb => user_identity_body.rb} | 10 +- .../models/user_identity_request_body.rb | 221 --- .../models/user_identity_response.rb | 221 --- .../models/user_subscription_options.rb | 219 --- ...ayer_success_response.rb => web_button.rb} | 57 +- lib/onesignal/version.rb | 4 +- onesignal.gemspec | 2 +- spec/api/default_api_spec.rb | 256 ++-- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/models/app_spec.rb | 2 +- ...n_all_of_android_background_layout_spec.rb | 2 +- spec/models/basic_notification_all_of_spec.rb | 20 +- spec/models/basic_notification_spec.rb | 28 +- .../begin_live_activity_request_spec.rb | 40 - spec/models/button_spec.rb | 2 +- ...ncel_notification_success_response_spec.rb | 34 - ...eate_notification_success_response_spec.rb | 8 +- .../create_segment_conflict_response_spec.rb | 2 +- .../create_segment_success_response_spec.rb | 2 +- .../create_subscription_request_body_spec.rb | 40 - ...ser_conflict_response_errors_inner_spec.rb | 2 +- ...onflict_response_errors_items_meta_spec.rb | 2 +- .../create_user_conflict_response_spec.rb | 2 +- .../delete_player_not_found_response_spec.rb | 34 - .../delete_segment_not_found_response_spec.rb | 34 - .../delete_segment_success_response_spec.rb | 34 - spec/models/delivery_data_spec.rb | 2 +- .../export_events_success_response_spec.rb | 2 +- ...export_subscriptions_request_body_spec.rb} | 14 +- ...rt_subscriptions_success_response_spec.rb} | 14 +- ...rors_spec.rb => filter_expression_spec.rb} | 6 +- spec/models/filter_spec.rb | 26 +- spec/models/generic_error_spec.rb | 14 +- ... => generic_success_bool_response_spec.rb} | 14 +- ...notification_history_request_body_spec.rb} | 14 +- ... => get_segments_success_response_spec.rb} | 16 +- spec/models/inline_response2003_spec.rb | 34 - spec/models/inline_response200_spec.rb | 34 - spec/models/invalid_identifier_error_spec.rb | 40 - ...ap_spec.rb => language_string_map_spec.rb} | 14 +- spec/models/notification_all_of_spec.rb | 2 +- ...ification_history_success_response_spec.rb | 2 +- spec/models/notification_slice_spec.rb | 2 +- spec/models/notification_spec.rb | 28 +- spec/models/notification_target_spec.rb | 10 +- .../notification_with_meta_all_of_spec.rb | 2 +- spec/models/notification_with_meta_spec.rb | 28 +- spec/models/operator_spec.rb | 2 +- spec/models/outcome_data_spec.rb | 2 +- spec/models/outcomes_data_spec.rb | 2 +- ...latform_delivery_data_email_all_of_spec.rb | 2 +- .../platform_delivery_data_sms_all_of_spec.rb | 2 +- spec/models/platform_delivery_data_spec.rb | 2 +- ...otification_target_include_aliases_spec.rb | 34 - spec/models/player_spec.rb | 190 --- ...nse202_spec.rb => properties_body_spec.rb} | 14 +- spec/models/properties_deltas_spec.rb | 2 +- spec/models/properties_object_spec.rb | 2 +- spec/models/purchase_spec.rb | 2 +- ...inner_spec.rb => rate_limit_error_spec.rb} | 18 +- spec/models/rate_limiter_error_spec.rb | 34 - ...pressions_spec.rb => segment_data_spec.rb} | 44 +- .../segment_notification_target_spec.rb | 2 +- spec/models/segment_spec.rb | 2 +- ...e201_spec.rb => subscription_body_spec.rb} | 14 +- ... subscription_notification_target_spec.rb} | 22 +- ...on_object_spec.rb => subscription_spec.rb} | 14 +- ...transfer_subscription_request_body_spec.rb | 2 +- .../update_live_activity_request_spec.rb | 38 +- ...ate_live_activity_success_response_spec.rb | 10 +- .../update_player_success_response_spec.rb | 34 - .../update_player_tags_request_body_spec.rb | 34 - ...pdate_player_tags_success_response_spec.rb | 34 - .../update_subscription_request_body_spec.rb | 34 - spec/models/update_user_request_spec.rb | 2 +- ...nse_spec.rb => user_identity_body_spec.rb} | 14 +- .../models/user_identity_request_body_spec.rb | 34 - spec/models/user_spec.rb | 8 +- spec/models/user_subscription_options_spec.rb | 34 - ...ss_response_spec.rb => web_button_spec.rb} | 30 +- spec/spec_helper.rb | 2 +- 212 files changed, 2137 insertions(+), 8620 deletions(-) create mode 100644 .github/workflows/project.yml delete mode 100644 docs/BeginLiveActivityRequest.md delete mode 100644 docs/CancelNotificationSuccessResponse.md delete mode 100644 docs/CreatePlayerSuccessResponse.md delete mode 100644 docs/CreateSubscriptionRequestBody.md delete mode 100644 docs/DeletePlayerNotFoundResponse.md delete mode 100644 docs/DeleteSegmentNotFoundResponse.md delete mode 100644 docs/DeleteSegmentSuccessResponse.md rename docs/{ExportPlayersRequestBody.md => ExportSubscriptionsRequestBody.md} (86%) rename docs/{ExportPlayersSuccessResponse.md => ExportSubscriptionsSuccessResponse.md} (65%) rename docs/{Notification200Errors.md => FilterExpression.md} (61%) delete mode 100644 docs/FilterExpressions.md rename docs/{DeletePlayerSuccessResponse.md => GenericSuccessBoolResponse.md} (67%) rename docs/{GetNotificationRequestBody.md => GetNotificationHistoryRequestBody.md} (86%) create mode 100644 docs/GetSegmentsSuccessResponse.md delete mode 100644 docs/InlineResponse2003.md delete mode 100644 docs/InlineResponse201.md delete mode 100644 docs/InvalidIdentifierError.md rename docs/{StringMap.md => LanguageStringMap.md} (97%) delete mode 100644 docs/Player.md delete mode 100644 docs/PlayerNotificationTarget.md delete mode 100644 docs/PlayerNotificationTargetIncludeAliases.md delete mode 100644 docs/PlayerSlice.md rename docs/{InlineResponse202.md => PropertiesBody.md} (76%) create mode 100644 docs/RateLimitError.md create mode 100644 docs/SegmentData.md rename docs/{SubscriptionObject.md => Subscription.md} (75%) create mode 100644 docs/SubscriptionBody.md create mode 100644 docs/SubscriptionNotificationTarget.md delete mode 100644 docs/UpdatePlayerSuccessResponse.md delete mode 100644 docs/UpdatePlayerTagsRequestBody.md delete mode 100644 docs/UpdatePlayerTagsSuccessResponse.md delete mode 100644 docs/UpdateSubscriptionRequestBody.md rename docs/{InlineResponse200.md => UserIdentityBody.md} (53%) delete mode 100644 docs/UserIdentityRequestBody.md delete mode 100644 docs/UserIdentityResponse.md delete mode 100644 docs/UserSubscriptionOptions.md create mode 100644 docs/WebButton.md delete mode 100644 lib/onesignal/models/cancel_notification_success_response.rb delete mode 100644 lib/onesignal/models/create_subscription_request_body.rb delete mode 100644 lib/onesignal/models/delete_player_not_found_response.rb delete mode 100644 lib/onesignal/models/delete_player_success_response.rb delete mode 100644 lib/onesignal/models/delete_segment_not_found_response.rb delete mode 100644 lib/onesignal/models/delete_segment_success_response.rb rename lib/onesignal/models/{export_players_request_body.rb => export_subscriptions_request_body.rb} (95%) rename lib/onesignal/models/{export_players_success_response.rb => export_subscriptions_success_response.rb} (95%) rename lib/onesignal/models/{notification200_errors.rb => filter_expression.rb} (96%) delete mode 100644 lib/onesignal/models/filter_expressions.rb delete mode 100644 lib/onesignal/models/generic_error_errors_inner.rb rename lib/onesignal/models/{update_player_success_response.rb => generic_success_bool_response.rb} (95%) rename lib/onesignal/models/{get_notification_request_body.rb => get_notification_history_request_body.rb} (96%) rename lib/onesignal/models/{player_slice.rb => get_segments_success_response.rb} (89%) delete mode 100644 lib/onesignal/models/inline_response2003.rb delete mode 100644 lib/onesignal/models/invalid_identifier_error.rb rename lib/onesignal/models/{string_map.rb => language_string_map.rb} (98%) delete mode 100644 lib/onesignal/models/player.rb delete mode 100644 lib/onesignal/models/player_notification_target_include_aliases.rb rename lib/onesignal/models/{inline_response202.rb => properties_body.rb} (95%) rename lib/onesignal/models/{rate_limiter_error.rb => rate_limit_error.rb} (91%) rename lib/onesignal/models/{begin_live_activity_request.rb => segment_data.rb} (74%) rename lib/onesignal/models/{subscription_object.rb => subscription.rb} (96%) rename lib/onesignal/models/{inline_response201.rb => subscription_body.rb} (95%) rename lib/onesignal/models/{player_notification_target.rb => subscription_notification_target.rb} (74%) delete mode 100644 lib/onesignal/models/update_player_tags_request_body.rb delete mode 100644 lib/onesignal/models/update_player_tags_success_response.rb delete mode 100644 lib/onesignal/models/update_subscription_request_body.rb rename lib/onesignal/models/{inline_response200.rb => user_identity_body.rb} (95%) delete mode 100644 lib/onesignal/models/user_identity_request_body.rb delete mode 100644 lib/onesignal/models/user_identity_response.rb delete mode 100644 lib/onesignal/models/user_subscription_options.rb rename lib/onesignal/models/{create_player_success_response.rb => web_button.rb} (85%) delete mode 100644 spec/models/begin_live_activity_request_spec.rb delete mode 100644 spec/models/cancel_notification_success_response_spec.rb delete mode 100644 spec/models/create_subscription_request_body_spec.rb delete mode 100644 spec/models/delete_player_not_found_response_spec.rb delete mode 100644 spec/models/delete_segment_not_found_response_spec.rb delete mode 100644 spec/models/delete_segment_success_response_spec.rb rename spec/models/{export_players_request_body_spec.rb => export_subscriptions_request_body_spec.rb} (69%) rename spec/models/{export_players_success_response_spec.rb => export_subscriptions_success_response_spec.rb} (58%) rename spec/models/{notification200_errors_spec.rb => filter_expression_spec.rb} (83%) rename spec/models/{delete_player_success_response_spec.rb => generic_success_bool_response_spec.rb} (60%) rename spec/models/{get_notification_request_body_spec.rb => get_notification_history_request_body_spec.rb} (76%) rename spec/models/{player_slice_spec.rb => get_segments_success_response_spec.rb} (71%) delete mode 100644 spec/models/inline_response2003_spec.rb delete mode 100644 spec/models/inline_response200_spec.rb delete mode 100644 spec/models/invalid_identifier_error_spec.rb rename spec/models/{string_map_spec.rb => language_string_map_spec.rb} (95%) delete mode 100644 spec/models/player_notification_target_include_aliases_spec.rb delete mode 100644 spec/models/player_spec.rb rename spec/models/{inline_response202_spec.rb => properties_body_spec.rb} (64%) rename spec/models/{generic_error_errors_inner_spec.rb => rate_limit_error_spec.rb} (61%) delete mode 100644 spec/models/rate_limiter_error_spec.rb rename spec/models/{filter_expressions_spec.rb => segment_data_spec.rb} (52%) rename spec/models/{inline_response201_spec.rb => subscription_body_spec.rb} (64%) rename spec/models/{player_notification_target_spec.rb => subscription_notification_target_spec.rb} (80%) rename spec/models/{subscription_object_spec.rb => subscription_spec.rb} (92%) delete mode 100644 spec/models/update_player_success_response_spec.rb delete mode 100644 spec/models/update_player_tags_request_body_spec.rb delete mode 100644 spec/models/update_player_tags_success_response_spec.rb delete mode 100644 spec/models/update_subscription_request_body_spec.rb rename spec/models/{user_identity_response_spec.rb => user_identity_body_spec.rb} (69%) delete mode 100644 spec/models/user_identity_request_body_spec.rb delete mode 100644 spec/models/user_subscription_options_spec.rb rename spec/models/{create_player_success_response_spec.rb => web_button_spec.rb} (52%) diff --git a/.github/ISSUE_TEMPLATE/ask-question.yml b/.github/ISSUE_TEMPLATE/ask-question.yml index 3da173f..6a3c282 100644 --- a/.github/ISSUE_TEMPLATE/ask-question.yml +++ b/.github/ISSUE_TEMPLATE/ask-question.yml @@ -1,7 +1,7 @@ name: 🙋‍♂️ Ask a question description: Tell us what's on your mind -title: "[question]: " -labels: ["triage"] +title: "[Question]: " +labels: ["Question"] body: - type: markdown attributes: @@ -22,4 +22,4 @@ body: description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) options: - label: I agree to follow this project's Code of Conduct - required: true \ No newline at end of file + required: true diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f274813..f99d9f6 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,7 +1,7 @@ name: 🪳 Bug report description: File a bug report title: "[Bug]: " -labels: ["bug", "triage"] +labels: ["Bug"] body: - type: markdown attributes: @@ -48,4 +48,4 @@ body: description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) options: - label: I agree to follow this project's Code of Conduct - required: true \ No newline at end of file + required: true diff --git a/.github/ISSUE_TEMPLATE/general-feedback.yml b/.github/ISSUE_TEMPLATE/general-feedback.yml index e632759..704514e 100644 --- a/.github/ISSUE_TEMPLATE/general-feedback.yml +++ b/.github/ISSUE_TEMPLATE/general-feedback.yml @@ -1,7 +1,7 @@ name: 📣 General feedback description: Tell us what's on your mind -title: "[Bug]: " -labels: ["triage"] +title: "[Feedback]: " +labels: ["Feedback"] body: - type: markdown attributes: @@ -22,4 +22,4 @@ body: description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) options: - label: I agree to follow this project's Code of Conduct - required: true \ No newline at end of file + required: true diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml new file mode 100644 index 0000000..69960fe --- /dev/null +++ b/.github/workflows/project.yml @@ -0,0 +1,17 @@ +name: Add issues to project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + runs-on: ubuntu-latest + steps: + - name: Add issue to project + uses: actions/add-to-project@v1.0.2 + with: + # SDK Server Project + project-url: https://github.com/orgs/OneSignal/projects/11 + github-token: ${{ secrets.GH_PROJECTS_TOKEN }} diff --git a/README.md b/README.md index d7d2d91..70ed088 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ A powerful way to send personalized messages at scale and build effective custom This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 1.4.0 -- Package version: 2.2.0 +- API version: 5.0.1 +- Package version: 5.0.0-beta1 - Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit [https://onesignal.com](https://onesignal.com) @@ -24,16 +24,16 @@ gem build onesignal.gemspec Then either install the gem locally: ```shell -gem install ./onesignal-2.2.0.gem +gem install ./onesignal-5.0.0-beta1.gem ``` -(for development, run `gem install --dev ./onesignal-2.2.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./onesignal-5.0.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', '~> 2.2.0' + gem 'onesignal', '~> 5.0.0-beta1' ### Install from Git @@ -59,22 +59,20 @@ require 'onesignal' # Setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.access_token = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -activity_id = 'activity_id_example' # String | Live Activity record ID -begin_live_activity_request = OneSignal::BeginLiveActivityRequest.new({push_token: 'push_token_example', subscription_id: 'subscription_id_example'}) # BeginLiveActivityRequest | +app_id = 'app_id_example' # String | +notification_id = 'notification_id_example' # String | begin - #Start Live Activity - api_instance.begin_live_activity(app_id, activity_id, begin_live_activity_request) + #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->begin_live_activity: #{e}" + puts "Exception when calling DefaultApi->cancel_notification: #{e}" end ``` @@ -85,41 +83,34 @@ All URIs are relative to *https://api.onesignal.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*OneSignal::DefaultApi* | [**begin_live_activity**](docs/DefaultApi.md#begin_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity *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_player**](docs/DefaultApi.md#create_player) | **POST** /players | Add a device -*OneSignal::DefaultApi* | [**create_segments**](docs/DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments +*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_player**](docs/DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record -*OneSignal::DefaultApi* | [**delete_segments**](docs/DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +*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* | [**end_live_activity**](docs/DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity *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_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players -*OneSignal::DefaultApi* | [**fetch_aliases**](docs/DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | -*OneSignal::DefaultApi* | [**fetch_user**](docs/DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -*OneSignal::DefaultApi* | [**fetch_user_identity**](docs/DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*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_eligible_iams**](docs/DefaultApi.md#get_eligible_iams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | *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_player**](docs/DefaultApi.md#get_player) | **GET** /players/{player_id} | View device -*OneSignal::DefaultApi* | [**get_players**](docs/DefaultApi.md#get_players) | **GET** /players | View devices -*OneSignal::DefaultApi* | [**identify_user_by_alias**](docs/DefaultApi.md#identify_user_by_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | -*OneSignal::DefaultApi* | [**identify_user_by_subscription_id**](docs/DefaultApi.md#identify_user_by_subscription_id) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*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_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device -*OneSignal::DefaultApi* | [**update_player_tags**](docs/DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id *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} | @@ -130,37 +121,25 @@ Class | Method | HTTP request | Description - [OneSignal::BasicNotification](docs/BasicNotification.md) - [OneSignal::BasicNotificationAllOf](docs/BasicNotificationAllOf.md) - [OneSignal::BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md) - - [OneSignal::BeginLiveActivityRequest](docs/BeginLiveActivityRequest.md) - [OneSignal::Button](docs/Button.md) - - [OneSignal::CancelNotificationSuccessResponse](docs/CancelNotificationSuccessResponse.md) - [OneSignal::CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md) - - [OneSignal::CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md) - [OneSignal::CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [OneSignal::CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) - - [OneSignal::CreateSubscriptionRequestBody](docs/CreateSubscriptionRequestBody.md) - [OneSignal::CreateUserConflictResponse](docs/CreateUserConflictResponse.md) - [OneSignal::CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) - [OneSignal::CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) - - [OneSignal::DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md) - - [OneSignal::DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md) - - [OneSignal::DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md) - - [OneSignal::DeleteSegmentSuccessResponse](docs/DeleteSegmentSuccessResponse.md) - [OneSignal::DeliveryData](docs/DeliveryData.md) - [OneSignal::ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md) - - [OneSignal::ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md) - - [OneSignal::ExportPlayersSuccessResponse](docs/ExportPlayersSuccessResponse.md) + - [OneSignal::ExportSubscriptionsRequestBody](docs/ExportSubscriptionsRequestBody.md) + - [OneSignal::ExportSubscriptionsSuccessResponse](docs/ExportSubscriptionsSuccessResponse.md) - [OneSignal::Filter](docs/Filter.md) - - [OneSignal::FilterExpressions](docs/FilterExpressions.md) + - [OneSignal::FilterExpression](docs/FilterExpression.md) - [OneSignal::GenericError](docs/GenericError.md) - - [OneSignal::GenericErrorErrorsInner](docs/GenericErrorErrorsInner.md) - - [OneSignal::GetNotificationRequestBody](docs/GetNotificationRequestBody.md) - - [OneSignal::InlineResponse200](docs/InlineResponse200.md) - - [OneSignal::InlineResponse2003](docs/InlineResponse2003.md) - - [OneSignal::InlineResponse201](docs/InlineResponse201.md) - - [OneSignal::InlineResponse202](docs/InlineResponse202.md) - - [OneSignal::InvalidIdentifierError](docs/InvalidIdentifierError.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::Notification200Errors](docs/Notification200Errors.md) - [OneSignal::NotificationAllOf](docs/NotificationAllOf.md) - [OneSignal::NotificationHistorySuccessResponse](docs/NotificationHistorySuccessResponse.md) - [OneSignal::NotificationSlice](docs/NotificationSlice.md) @@ -173,40 +152,34 @@ Class | Method | HTTP request | Description - [OneSignal::PlatformDeliveryData](docs/PlatformDeliveryData.md) - [OneSignal::PlatformDeliveryDataEmailAllOf](docs/PlatformDeliveryDataEmailAllOf.md) - [OneSignal::PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md) - - [OneSignal::Player](docs/Player.md) - - [OneSignal::PlayerNotificationTarget](docs/PlayerNotificationTarget.md) - - [OneSignal::PlayerNotificationTargetIncludeAliases](docs/PlayerNotificationTargetIncludeAliases.md) - - [OneSignal::PlayerSlice](docs/PlayerSlice.md) + - [OneSignal::PropertiesBody](docs/PropertiesBody.md) - [OneSignal::PropertiesDeltas](docs/PropertiesDeltas.md) - [OneSignal::PropertiesObject](docs/PropertiesObject.md) - [OneSignal::Purchase](docs/Purchase.md) - - [OneSignal::RateLimiterError](docs/RateLimiterError.md) + - [OneSignal::RateLimitError](docs/RateLimitError.md) - [OneSignal::Segment](docs/Segment.md) + - [OneSignal::SegmentData](docs/SegmentData.md) - [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md) - - [OneSignal::StringMap](docs/StringMap.md) - - [OneSignal::SubscriptionObject](docs/SubscriptionObject.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::UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md) - - [OneSignal::UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md) - - [OneSignal::UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md) - - [OneSignal::UpdateSubscriptionRequestBody](docs/UpdateSubscriptionRequestBody.md) - [OneSignal::UpdateUserRequest](docs/UpdateUserRequest.md) - [OneSignal::User](docs/User.md) - - [OneSignal::UserIdentityRequestBody](docs/UserIdentityRequestBody.md) - - [OneSignal::UserIdentityResponse](docs/UserIdentityResponse.md) - - [OneSignal::UserSubscriptionOptions](docs/UserSubscriptionOptions.md) + - [OneSignal::UserIdentityBody](docs/UserIdentityBody.md) + - [OneSignal::WebButton](docs/WebButton.md) ## Documentation for Authorization -### app_key +### rest_api_key - **Type**: Bearer authentication -### user_key +### user_auth_key - **Type**: Bearer authentication diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md index 18ac77b..44bab5f 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -6,17 +6,16 @@ | ---- | ---- | ----------- | ----- | | **included_segments** | **Array<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | | **excluded_segments** | **Array<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -| **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_subscription_ids** | **Array<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | | **target_channel** | **String** | | [optional] | | **id** | **String** | | [optional] | | **value** | **Integer** | | [optional][readonly] | @@ -32,13 +31,12 @@ | **is_wp_wns** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | | **is_adm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | | **is_chrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -| **channel_for_external_user_ids** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | | **app_id** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | | **external_id** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | | **idempotency_key** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -| **contents** | [**StringMap**](StringMap.md) | | [optional] | -| **headings** | [**StringMap**](StringMap.md) | | [optional] | -| **subtitle** | [**StringMap**](StringMap.md) | | [optional] | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | | **data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | | **huawei_msg_type** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | | **url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -55,7 +53,7 @@ | **chrome_big_picture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | | **chrome_web_image** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | | **buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -| **web_buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +| **web_buttons** | [**Array<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | | **ios_category** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | | **android_channel_id** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | | **huawei_channel_id** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -101,6 +99,8 @@ | **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | | **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | | **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +| **ios_relevance_score** | **Float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +| **ios_interruption_level** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | | **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | | **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | | **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -109,7 +109,7 @@ | **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | | **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | | **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -| **filters** | [**Array<Filter>**](Filter.md) | | [optional] | +| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] | | **custom_data** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | ## Example @@ -120,8 +120,7 @@ require 'onesignal' instance = OneSignal::BasicNotification.new( included_segments: null, excluded_segments: null, - include_player_ids: null, - include_external_user_ids: null, + include_subscription_ids: null, include_email_tokens: null, include_phone_numbers: null, include_ios_tokens: null, @@ -146,7 +145,6 @@ instance = OneSignal::BasicNotification.new( is_wp_wns: null, is_adm: null, is_chrome: null, - channel_for_external_user_ids: null, app_id: null, external_id: null, idempotency_key: null, @@ -215,6 +213,8 @@ instance = OneSignal::BasicNotification.new( thread_id: null, summary_arg: null, summary_arg_count: null, + ios_relevance_score: null, + ios_interruption_level: null, email_subject: null, email_body: null, email_from_name: null, diff --git a/docs/BasicNotificationAllOf.md b/docs/BasicNotificationAllOf.md index 7ff1acf..68dd63c 100644 --- a/docs/BasicNotificationAllOf.md +++ b/docs/BasicNotificationAllOf.md @@ -18,13 +18,12 @@ | **is_wp_wns** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | | **is_adm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | | **is_chrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -| **channel_for_external_user_ids** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | | **app_id** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | [optional] | | **external_id** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | | **idempotency_key** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -| **contents** | [**StringMap**](StringMap.md) | | [optional] | -| **headings** | [**StringMap**](StringMap.md) | | [optional] | -| **subtitle** | [**StringMap**](StringMap.md) | | [optional] | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | | **data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | | **huawei_msg_type** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | | **url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -41,7 +40,7 @@ | **chrome_big_picture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | | **chrome_web_image** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | | **buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -| **web_buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +| **web_buttons** | [**Array<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | | **ios_category** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | | **android_channel_id** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | | **huawei_channel_id** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -87,6 +86,8 @@ | **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | | **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | | **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +| **ios_relevance_score** | **Float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +| **ios_interruption_level** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | | **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | | **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | | **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -95,7 +96,7 @@ | **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | | **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | | **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -| **filters** | [**Array<Filter>**](Filter.md) | | [optional] | +| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] | | **custom_data** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | ## Example @@ -118,7 +119,6 @@ instance = OneSignal::BasicNotificationAllOf.new( is_wp_wns: null, is_adm: null, is_chrome: null, - channel_for_external_user_ids: null, app_id: null, external_id: null, idempotency_key: null, @@ -187,6 +187,8 @@ instance = OneSignal::BasicNotificationAllOf.new( thread_id: null, summary_arg: null, summary_arg_count: null, + ios_relevance_score: null, + ios_interruption_level: null, email_subject: null, email_body: null, email_from_name: null, diff --git a/docs/BeginLiveActivityRequest.md b/docs/BeginLiveActivityRequest.md deleted file mode 100644 index 4283984..0000000 --- a/docs/BeginLiveActivityRequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# OneSignal::BeginLiveActivityRequest - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **push_token** | **String** | | | -| **subscription_id** | **String** | | | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::BeginLiveActivityRequest.new( - push_token: null, - subscription_id: null -) -``` - diff --git a/docs/CancelNotificationSuccessResponse.md b/docs/CancelNotificationSuccessResponse.md deleted file mode 100644 index 4363b9c..0000000 --- a/docs/CancelNotificationSuccessResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::CancelNotificationSuccessResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::CancelNotificationSuccessResponse.new( - success: null -) -``` - diff --git a/docs/CreateNotificationSuccessResponse.md b/docs/CreateNotificationSuccessResponse.md index 2a1d231..1cfc590 100644 --- a/docs/CreateNotificationSuccessResponse.md +++ b/docs/CreateNotificationSuccessResponse.md @@ -5,9 +5,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **id** | **String** | | [optional] | -| **recipients** | **Integer** | Estimated number of subscribers targetted by notification. | [optional] | | **external_id** | **String** | | [optional] | -| **errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | +| **errors** | **Object** | Errors include the identifiers that are invalid, or that there are no subscribers. | [optional] | ## Example @@ -16,7 +15,6 @@ require 'onesignal' instance = OneSignal::CreateNotificationSuccessResponse.new( id: null, - recipients: null, external_id: null, errors: null ) diff --git a/docs/CreatePlayerSuccessResponse.md b/docs/CreatePlayerSuccessResponse.md deleted file mode 100644 index 01f846f..0000000 --- a/docs/CreatePlayerSuccessResponse.md +++ /dev/null @@ -1,20 +0,0 @@ -# OneSignal::CreatePlayerSuccessResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | -| **id** | **String** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::CreatePlayerSuccessResponse.new( - success: null, - id: null -) -``` - diff --git a/docs/CreateSubscriptionRequestBody.md b/docs/CreateSubscriptionRequestBody.md deleted file mode 100644 index 0717215..0000000 --- a/docs/CreateSubscriptionRequestBody.md +++ /dev/null @@ -1,20 +0,0 @@ -# OneSignal::CreateSubscriptionRequestBody - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | -| **retain_previous_owner** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::CreateSubscriptionRequestBody.new( - subscription: null, - retain_previous_owner: null -) -``` - diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 243ad5c..74eea47 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -4,52 +4,45 @@ All URIs are relative to *https://api.onesignal.com* | Method | HTTP request | Description | | ------ | ------------ | ----------- | -| [**begin_live_activity**](DefaultApi.md#begin_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity | | [**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification | +| [**create_alias**](DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**create_alias_by_subscription**](DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | | [**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app | | [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification | -| [**create_player**](DefaultApi.md#create_player) | **POST** /players | Add a device | -| [**create_segments**](DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments | +| [**create_segment**](DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment | | [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | | | [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | | | [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | | -| [**delete_player**](DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record | -| [**delete_segments**](DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments | +| [**delete_segment**](DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment | | [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | | | [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | -| [**end_live_activity**](DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity | | [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events | -| [**export_players**](DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players | -| [**fetch_aliases**](DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | -| [**fetch_user**](DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | -| [**fetch_user_identity**](DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions | +| [**get_aliases**](DefaultApi.md#get_aliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | | [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app | | [**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps | -| [**get_eligible_iams**](DefaultApi.md#get_eligible_iams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | | | [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification | | [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History | | [**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications | | [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | -| [**get_player**](DefaultApi.md#get_player) | **GET** /players/{player_id} | View device | -| [**get_players**](DefaultApi.md#get_players) | **GET** /players | View devices | -| [**identify_user_by_alias**](DefaultApi.md#identify_user_by_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | -| [**identify_user_by_subscription_id**](DefaultApi.md#identify_user_by_subscription_id) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | +| [**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments | +| [**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | | [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | | +| [**unsubscribe_email_with_token**](DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token | | [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app | | [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | -| [**update_player**](DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device | -| [**update_player_tags**](DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id | | [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | | [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | -## begin_live_activity +## cancel_notification -> begin_live_activity(app_id, activity_id, begin_live_activity_request) +> cancel_notification(app_id, notification_id) -Start Live Activity +Stop a scheduled or currently outgoing notification -Starts a Live Activity +Used to stop a scheduled or currently outgoing notification ### Examples @@ -57,41 +50,39 @@ Starts a Live Activity require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -activity_id = 'activity_id_example' # String | Live Activity record ID -begin_live_activity_request = OneSignal::BeginLiveActivityRequest.new({push_token: 'push_token_example', subscription_id: 'subscription_id_example'}) # BeginLiveActivityRequest | +app_id = 'app_id_example' # String | +notification_id = 'notification_id_example' # String | begin - # Start Live Activity - api_instance.begin_live_activity(app_id, activity_id, begin_live_activity_request) + # Stop a scheduled or currently outgoing notification + result = api_instance.cancel_notification(app_id, notification_id) + p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->begin_live_activity: #{e}" + puts "Error when calling DefaultApi->cancel_notification: #{e}" end ``` -#### Using the begin_live_activity_with_http_info variant +#### Using the cancel_notification_with_http_info variant -This returns an Array which contains the response data (`nil` in this case), status code and headers. +This returns an Array which contains the response data, status code and headers. -> begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request) +> , Integer, Hash)> cancel_notification_with_http_info(app_id, notification_id) ```ruby begin - # Start Live Activity - data, status_code, headers = api_instance.begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request) + # Stop a scheduled or currently outgoing notification + data, status_code, headers = api_instance.cancel_notification_with_http_info(app_id, notification_id) p status_code # => 2xx p headers # => { ... } - p data # => nil + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->begin_live_activity_with_http_info: #{e}" + puts "Error when calling DefaultApi->cancel_notification_with_http_info: #{e}" end ``` @@ -99,31 +90,30 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activity_id** | **String** | Live Activity record ID | | -| **begin_live_activity_request** | [**BeginLiveActivityRequest**](BeginLiveActivityRequest.md) | | | +| **app_id** | **String** | | | +| **notification_id** | **String** | | | ### Return type -nil (empty response body) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json -## cancel_notification +## create_alias -> cancel_notification(app_id, notification_id) +> create_alias(app_id, alias_label, alias_id, user_identity_body) -Stop a scheduled or currently outgoing notification -Used to stop a scheduled or currently outgoing notification + +Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). ### Examples @@ -131,41 +121,41 @@ Used to stop a scheduled or currently outgoing notification require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | -notification_id = 'notification_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | +user_identity_body = OneSignal::UserIdentityBody.new # UserIdentityBody | begin - # Stop a scheduled or currently outgoing notification - result = api_instance.cancel_notification(app_id, notification_id) + + result = api_instance.create_alias(app_id, alias_label, alias_id, user_identity_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->cancel_notification: #{e}" + puts "Error when calling DefaultApi->create_alias: #{e}" end ``` -#### Using the cancel_notification_with_http_info variant +#### Using the create_alias_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> cancel_notification_with_http_info(app_id, notification_id) +> , Integer, Hash)> create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body) ```ruby begin - # Stop a scheduled or currently outgoing notification - data, status_code, headers = api_instance.cancel_notification_with_http_info(app_id, notification_id) + + data, status_code, headers = api_instance.create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->cancel_notification_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_alias_with_http_info: #{e}" end ``` @@ -174,29 +164,31 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | -| **notification_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | +| **user_identity_body** | [**UserIdentityBody**](UserIdentityBody.md) | | | ### Return type -[**CancelNotificationSuccessResponse**](CancelNotificationSuccessResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json -## create_app +## create_alias_by_subscription -> create_app(app) +> create_alias_by_subscription(app_id, subscription_id, user_identity_body) -Create an app -Creates a new OneSignal app + +Upserts one or more Aliases for the User identified by :subscription_id. ### Examples @@ -204,40 +196,40 @@ Creates a new OneSignal app require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: user_key - config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app = OneSignal::App.new # App | +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | +user_identity_body = OneSignal::UserIdentityBody.new # UserIdentityBody | begin - # Create an app - result = api_instance.create_app(app) + + result = api_instance.create_alias_by_subscription(app_id, subscription_id, user_identity_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_app: #{e}" + puts "Error when calling DefaultApi->create_alias_by_subscription: #{e}" end ``` -#### Using the create_app_with_http_info variant +#### Using the create_alias_by_subscription_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_app_with_http_info(app) +> , Integer, Hash)> create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body) ```ruby begin - # Create an app - data, status_code, headers = api_instance.create_app_with_http_info(app) + + data, status_code, headers = api_instance.create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_app_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_alias_by_subscription_with_http_info: #{e}" end ``` @@ -245,15 +237,17 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app** | [**App**](App.md) | | | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | +| **user_identity_body** | [**UserIdentityBody**](UserIdentityBody.md) | | | ### Return type -[**App**](App.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[user_key](../README.md#user_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -261,13 +255,13 @@ end - **Accept**: application/json -## create_notification +## create_app -> create_notification(notification) +> create_app(app) -Create notification +Create an app -Sends notifications to your users +Creates a new OneSignal app ### Examples @@ -275,40 +269,38 @@ Sends notifications to your users require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: user_auth_key + config.user_auth_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -notification = OneSignal::Notification.new({app_id: 'app_id_example'}) # Notification | +app = OneSignal::App.new # App | begin - # Create notification - result = api_instance.create_notification(notification) + # Create an app + result = api_instance.create_app(app) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_notification: #{e}" + puts "Error when calling DefaultApi->create_app: #{e}" end ``` -#### Using the create_notification_with_http_info variant +#### Using the create_app_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_notification_with_http_info(notification) +> , Integer, Hash)> create_app_with_http_info(app) ```ruby begin - # Create notification - data, status_code, headers = api_instance.create_notification_with_http_info(notification) + # Create an app + data, status_code, headers = api_instance.create_app_with_http_info(app) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_notification_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_app_with_http_info: #{e}" end ``` @@ -316,15 +308,15 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **notification** | [**Notification**](Notification.md) | | | +| **app** | [**App**](App.md) | | | ### Return type -[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md) +[**App**](App.md) ### Authorization -[app_key](../README.md#app_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -332,13 +324,13 @@ end - **Accept**: application/json -## create_player +## create_notification -> create_player(player) +> create_notification(notification) -Add a device +Create notification -Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. +Sends notifications to your users ### Examples @@ -346,40 +338,38 @@ Register a new device to one of your OneSignal apps 🚧 Don't use this Thi require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -player = OneSignal::Player.new({device_type: 37}) # Player | +notification = OneSignal::Notification.new({app_id: 'app_id_example'}) # Notification | begin - # Add a device - result = api_instance.create_player(player) + # Create notification + result = api_instance.create_notification(notification) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_player: #{e}" + puts "Error when calling DefaultApi->create_notification: #{e}" end ``` -#### Using the create_player_with_http_info variant +#### Using the create_notification_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_player_with_http_info(player) +> , Integer, Hash)> create_notification_with_http_info(notification) ```ruby begin - # Add a device - data, status_code, headers = api_instance.create_player_with_http_info(player) + # Create notification + data, status_code, headers = api_instance.create_notification_with_http_info(notification) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_player_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_notification_with_http_info: #{e}" end ``` @@ -387,15 +377,15 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **player** | [**Player**](Player.md) | | | +| **notification** | [**Notification**](Notification.md) | | | ### Return type -[**CreatePlayerSuccessResponse**](CreatePlayerSuccessResponse.md) +[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -403,13 +393,13 @@ end - **Accept**: application/json -## create_segments +## create_segment -> create_segments(app_id, opts) +> create_segment(app_id, opts) -Create Segments +Create Segment -Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. +Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. ### Examples @@ -417,43 +407,41 @@ Create segments visible and usable in the dashboard and API - Required: OneSigna require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. opts = { - segment: OneSignal::Segment.new({name: 'name_example', filters: [OneSignal::FilterExpressions.new({field: 'field_example', relation: '>'})]}) # Segment | + segment: OneSignal::Segment.new({name: 'name_example', filters: [OneSignal::Filter.new]}) # Segment | } begin - # Create Segments - result = api_instance.create_segments(app_id, opts) + # Create Segment + result = api_instance.create_segment(app_id, opts) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_segments: #{e}" + puts "Error when calling DefaultApi->create_segment: #{e}" end ``` -#### Using the create_segments_with_http_info variant +#### Using the create_segment_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_segments_with_http_info(app_id, opts) +> , Integer, Hash)> create_segment_with_http_info(app_id, opts) ```ruby begin - # Create Segments - data, status_code, headers = api_instance.create_segments_with_http_info(app_id, opts) + # Create Segment + data, status_code, headers = api_instance.create_segment_with_http_info(app_id, opts) p status_code # => 2xx p headers # => { ... } p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_segments_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_segment_with_http_info: #{e}" end ``` @@ -470,7 +458,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -480,7 +468,7 @@ end ## create_subscription -> create_subscription(app_id, alias_label, alias_id, create_subscription_request_body) +> create_subscription(app_id, alias_label, alias_id, subscription_body) @@ -492,10 +480,8 @@ Creates a new Subscription under the User provided. Useful to add email addresse require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -503,11 +489,11 @@ api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | alias_label = 'alias_label_example' # String | alias_id = 'alias_id_example' # String | -create_subscription_request_body = OneSignal::CreateSubscriptionRequestBody.new # CreateSubscriptionRequestBody | +subscription_body = OneSignal::SubscriptionBody.new # SubscriptionBody | begin - result = api_instance.create_subscription(app_id, alias_label, alias_id, create_subscription_request_body) + result = api_instance.create_subscription(app_id, alias_label, alias_id, subscription_body) p result rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->create_subscription: #{e}" @@ -518,15 +504,15 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body) +> , Integer, Hash)> create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body) ```ruby begin - data, status_code, headers = api_instance.create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body) + data, status_code, headers = api_instance.create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->create_subscription_with_http_info: #{e}" end @@ -539,15 +525,15 @@ end | **app_id** | **String** | | | | **alias_label** | **String** | | | | **alias_id** | **String** | | | -| **create_subscription_request_body** | [**CreateSubscriptionRequestBody**](CreateSubscriptionRequestBody.md) | | | +| **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) | | | ### Return type -[**InlineResponse201**](InlineResponse201.md) +[**SubscriptionBody**](SubscriptionBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -569,10 +555,8 @@ Creates a User, optionally Subscriptions owned by the User as well as Aliases. A require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -620,7 +604,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -630,7 +614,7 @@ end ## delete_alias -> delete_alias(app_id, alias_label, alias_id, alias_label_to_delete) +> delete_alias(app_id, alias_label, alias_id, alias_label_to_delete) @@ -642,10 +626,8 @@ Deletes an alias by alias label require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -668,7 +650,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete) +> , Integer, Hash)> delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete) ```ruby begin @@ -676,7 +658,7 @@ begin data, status_code, headers = api_instance.delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->delete_alias_with_http_info: #{e}" end @@ -693,84 +675,11 @@ end ### Return type -[**InlineResponse200**](InlineResponse200.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## delete_player - -> delete_player(app_id, player_id) - -Delete a user record - -Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -player_id = 'player_id_example' # String | The OneSignal player_id - -begin - # Delete a user record - result = api_instance.delete_player(app_id, player_id) - p result -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_player: #{e}" -end -``` - -#### Using the delete_player_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> delete_player_with_http_info(app_id, player_id) - -```ruby -begin - # Delete a user record - data, status_code, headers = api_instance.delete_player_with_http_info(app_id, player_id) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_player_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **player_id** | **String** | The OneSignal player_id | | - -### Return type - -[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -778,13 +687,13 @@ end - **Accept**: application/json -## delete_segments +## delete_segment -> delete_segments(app_id, segment_id) +> delete_segment(app_id, segment_id) -Delete Segments +Delete Segment -Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. +Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. ### Examples @@ -792,10 +701,8 @@ Delete segments (not user devices) - Required: OneSignal Paid Plan You can delet require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -804,29 +711,29 @@ app_id = 'app_id_example' # String | The OneSignal App ID for your app. Availab segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. begin - # Delete Segments - result = api_instance.delete_segments(app_id, segment_id) + # Delete Segment + result = api_instance.delete_segment(app_id, segment_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_segments: #{e}" + puts "Error when calling DefaultApi->delete_segment: #{e}" end ``` -#### Using the delete_segments_with_http_info variant +#### Using the delete_segment_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_segments_with_http_info(app_id, segment_id) +> , Integer, Hash)> delete_segment_with_http_info(app_id, segment_id) ```ruby begin - # Delete Segments - data, status_code, headers = api_instance.delete_segments_with_http_info(app_id, segment_id) + # Delete Segment + data, status_code, headers = api_instance.delete_segment_with_http_info(app_id, segment_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_segments_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_segment_with_http_info: #{e}" end ``` @@ -839,11 +746,11 @@ end ### Return type -[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -865,10 +772,8 @@ Deletes the Subscription. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -915,7 +820,7 @@ nil (empty response body) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -937,10 +842,8 @@ Removes the User identified by (:alias_label, :alias_id), and all Subscriptions require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -989,81 +892,7 @@ nil (empty response body) ### Authorization -[app_key](../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## end_live_activity - -> end_live_activity(app_id, activity_id, subscription_id) - -Stop Live Activity - -Stops a Live Activity - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -activity_id = 'activity_id_example' # String | Live Activity record ID -subscription_id = 'subscription_id_example' # String | Subscription ID - -begin - # Stop Live Activity - api_instance.end_live_activity(app_id, activity_id, subscription_id) -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->end_live_activity: #{e}" -end -``` - -#### Using the end_live_activity_with_http_info variant - -This returns an Array which contains the response data (`nil` in this case), status code and headers. - -> end_live_activity_with_http_info(app_id, activity_id, subscription_id) - -```ruby -begin - # Stop Live Activity - data, status_code, headers = api_instance.end_live_activity_with_http_info(app_id, activity_id, subscription_id) - p status_code # => 2xx - p headers # => { ... } - p data # => nil -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->end_live_activity_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activity_id** | **String** | Live Activity record ID | | -| **subscription_id** | **String** | Subscription ID | | - -### Return type - -nil (empty response body) - -### Authorization - -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1085,10 +914,8 @@ Generate a compressed CSV report of all of the events data for a notification. T require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -1136,7 +963,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1144,11 +971,11 @@ end - **Accept**: application/json -## export_players +## export_subscriptions -> export_players(app_id, opts) +> export_subscriptions(app_id, opts) -Export CSV of Players +Export CSV of Subscriptions Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | @@ -1158,43 +985,41 @@ Generate a compressed CSV export of all of your current user data This method ca require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The app ID that you want to export devices from opts = { - export_players_request_body: OneSignal::ExportPlayersRequestBody.new # ExportPlayersRequestBody | + export_subscriptions_request_body: OneSignal::ExportSubscriptionsRequestBody.new # ExportSubscriptionsRequestBody | } begin - # Export CSV of Players - result = api_instance.export_players(app_id, opts) + # Export CSV of Subscriptions + result = api_instance.export_subscriptions(app_id, opts) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->export_players: #{e}" + puts "Error when calling DefaultApi->export_subscriptions: #{e}" end ``` -#### Using the export_players_with_http_info variant +#### Using the export_subscriptions_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> export_players_with_http_info(app_id, opts) +> , Integer, Hash)> export_subscriptions_with_http_info(app_id, opts) ```ruby begin - # Export CSV of Players - data, status_code, headers = api_instance.export_players_with_http_info(app_id, opts) + # Export CSV of Subscriptions + data, status_code, headers = api_instance.export_subscriptions_with_http_info(app_id, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->export_players_with_http_info: #{e}" + puts "Error when calling DefaultApi->export_subscriptions_with_http_info: #{e}" end ``` @@ -1203,15 +1028,15 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | The app ID that you want to export devices from | | -| **export_players_request_body** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md) | | [optional] | +| **export_subscriptions_request_body** | [**ExportSubscriptionsRequestBody**](ExportSubscriptionsRequestBody.md) | | [optional] | ### Return type -[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md) +[**ExportSubscriptionsSuccessResponse**](ExportSubscriptionsSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1219,13 +1044,13 @@ end - **Accept**: application/json -## fetch_aliases +## get_aliases -> fetch_aliases(app_id, subscription_id) +> get_aliases(app_id, alias_label, alias_id) -Lists all Aliases for the User identified by :subscription_id. +Lists all Aliases for the User identified by (:alias_label, :alias_id). ### Examples @@ -1233,41 +1058,40 @@ Lists all Aliases for the User identified by :subscription_id. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | -subscription_id = 'subscription_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | begin - result = api_instance.fetch_aliases(app_id, subscription_id) + result = api_instance.get_aliases(app_id, alias_label, alias_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->fetch_aliases: #{e}" + puts "Error when calling DefaultApi->get_aliases: #{e}" end ``` -#### Using the fetch_aliases_with_http_info variant +#### Using the get_aliases_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> fetch_aliases_with_http_info(app_id, subscription_id) +> , Integer, Hash)> get_aliases_with_http_info(app_id, alias_label, alias_id) ```ruby begin - data, status_code, headers = api_instance.fetch_aliases_with_http_info(app_id, subscription_id) + data, status_code, headers = api_instance.get_aliases_with_http_info(app_id, alias_label, alias_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->fetch_aliases_with_http_info: #{e}" + puts "Error when calling DefaultApi->get_aliases_with_http_info: #{e}" end ``` @@ -1276,15 +1100,16 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | -| **subscription_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | ### Return type -[**UserIdentityResponse**](UserIdentityResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1292,13 +1117,13 @@ end - **Accept**: application/json -## fetch_user +## get_aliases_by_subscription -> fetch_user(app_id, alias_label, alias_id) +> get_aliases_by_subscription(app_id, subscription_id) -Returns the User’s properties, Aliases, and Subscriptions. +Lists all Aliases for the User identified by :subscription_id. ### Examples @@ -1306,42 +1131,39 @@ Returns the User’s properties, Aliases, and Subscriptions. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | -alias_label = 'alias_label_example' # String | -alias_id = 'alias_id_example' # String | +subscription_id = 'subscription_id_example' # String | begin - result = api_instance.fetch_user(app_id, alias_label, alias_id) + result = api_instance.get_aliases_by_subscription(app_id, subscription_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->fetch_user: #{e}" + puts "Error when calling DefaultApi->get_aliases_by_subscription: #{e}" end ``` -#### Using the fetch_user_with_http_info variant +#### Using the get_aliases_by_subscription_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> fetch_user_with_http_info(app_id, alias_label, alias_id) +> , Integer, Hash)> get_aliases_by_subscription_with_http_info(app_id, subscription_id) ```ruby begin - data, status_code, headers = api_instance.fetch_user_with_http_info(app_id, alias_label, alias_id) + data, status_code, headers = api_instance.get_aliases_by_subscription_with_http_info(app_id, subscription_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->fetch_user_with_http_info: #{e}" + puts "Error when calling DefaultApi->get_aliases_by_subscription_with_http_info: #{e}" end ``` @@ -1350,16 +1172,15 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | -| **alias_label** | **String** | | | -| **alias_id** | **String** | | | +| **subscription_id** | **String** | | | ### Return type -[**User**](User.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1367,13 +1188,13 @@ end - **Accept**: application/json -## fetch_user_identity - -> fetch_user_identity(app_id, alias_label, alias_id) +## get_app +> get_app(app_id) +View an app -Lists all Aliases for the User identified by (:alias_label, :alias_id). +View the details of a single OneSignal app ### Examples @@ -1381,90 +1202,13 @@ Lists all Aliases for the User identified by (:alias_label, :alias_id). require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: user_auth_key + config.user_auth_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | -alias_label = 'alias_label_example' # String | -alias_id = 'alias_id_example' # String | - -begin - - result = api_instance.fetch_user_identity(app_id, alias_label, alias_id) - p result -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->fetch_user_identity: #{e}" -end -``` - -#### Using the fetch_user_identity_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> fetch_user_identity_with_http_info(app_id, alias_label, alias_id) - -```ruby -begin - - data, status_code, headers = api_instance.fetch_user_identity_with_http_info(app_id, alias_label, alias_id) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->fetch_user_identity_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **app_id** | **String** | | | -| **alias_label** | **String** | | | -| **alias_id** | **String** | | | - -### Return type - -[**InlineResponse200**](InlineResponse200.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_app - -> get_app(app_id) - -View an app - -View the details of a single OneSignal app - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: user_key - config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | An app id +app_id = 'app_id_example' # String | An app id begin # View an app @@ -1505,7 +1249,7 @@ end ### Authorization -[user_key](../README.md#user_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -1527,10 +1271,8 @@ View the details of all of your current OneSignal apps require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: user_key - config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: user_auth_key + config.user_auth_key = 'YOUR_BEARER_TOKEN' end @@ -1573,80 +1315,7 @@ This endpoint does not need any parameter. ### Authorization -[user_key](../README.md#user_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_eligible_iams - -> get_eligible_iams(app_id, subscription_id) - - - -Manifest of In-App Messages the Subscription is eligible to display by the SDK. - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | -subscription_id = 'subscription_id_example' # String | - -begin - - result = api_instance.get_eligible_iams(app_id, subscription_id) - p result -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_eligible_iams: #{e}" -end -``` - -#### Using the get_eligible_iams_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_eligible_iams_with_http_info(app_id, subscription_id) - -```ruby -begin - - data, status_code, headers = api_instance.get_eligible_iams_with_http_info(app_id, subscription_id) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_eligible_iams_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **app_id** | **String** | | | -| **subscription_id** | **String** | | | - -### Return type - -[**InlineResponse2003**](InlineResponse2003.md) - -### Authorization - -[app_key](../README.md#app_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -1668,10 +1337,8 @@ View the details of a single notification and outcomes associated with it require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -1719,7 +1386,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1729,7 +1396,7 @@ end ## get_notification_history -> get_notification_history(notification_id, get_notification_request_body) +> get_notification_history(notification_id, get_notification_history_request_body) Notification History @@ -1741,20 +1408,18 @@ Notification History require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new notification_id = 'notification_id_example' # String | The \"id\" of the message found in the Notification object -get_notification_request_body = OneSignal::GetNotificationRequestBody.new # GetNotificationRequestBody | +get_notification_history_request_body = OneSignal::GetNotificationHistoryRequestBody.new # GetNotificationHistoryRequestBody | begin # Notification History - result = api_instance.get_notification_history(notification_id, get_notification_request_body) + result = api_instance.get_notification_history(notification_id, get_notification_history_request_body) p result rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->get_notification_history: #{e}" @@ -1765,12 +1430,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_notification_history_with_http_info(notification_id, get_notification_request_body) +> , Integer, Hash)> get_notification_history_with_http_info(notification_id, get_notification_history_request_body) ```ruby begin # Notification History - data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id, get_notification_request_body) + data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id, get_notification_history_request_body) p status_code # => 2xx p headers # => { ... } p data # => @@ -1784,7 +1449,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **notification_id** | **String** | The \"id\" of the message found in the Notification object | | -| **get_notification_request_body** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md) | | | +| **get_notification_history_request_body** | [**GetNotificationHistoryRequestBody**](GetNotificationHistoryRequestBody.md) | | | ### Return type @@ -1792,7 +1457,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1814,10 +1479,8 @@ View the details of multiple notifications require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -1871,7 +1534,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1893,10 +1556,8 @@ View the details of all the outcomes associated with your app 🚧 Require require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -1954,7 +1615,7 @@ end ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1962,13 +1623,13 @@ end - **Accept**: application/json -## get_player +## get_segments -> get_player(app_id, player_id, opts) +> get_segments(app_id, opts) -View device +Get Segments -View the details of an existing device in one of your OneSignal apps +Returns an array of segments from an app. ### Examples @@ -1976,121 +1637,42 @@ View the details of an existing device in one of your OneSignal apps require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | Your app_id for this device -player_id = 'player_id_example' # String | Player's OneSignal ID -opts = { - email_auth_hash: 'email_auth_hash_example' # String | Email - Only required if you have enabled Identity Verification and device_type is email (11). -} - -begin - # View device - result = api_instance.get_player(app_id, player_id, opts) - p result -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_player: #{e}" -end -``` - -#### Using the get_player_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> get_player_with_http_info(app_id, player_id, opts) - -```ruby -begin - # View device - data, status_code, headers = api_instance.get_player_with_http_info(app_id, player_id, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_player_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **app_id** | **String** | Your app_id for this device | | -| **player_id** | **String** | Player's OneSignal ID | | -| **email_auth_hash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | - -### Return type - -[**Player**](Player.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_players - -> get_players(app_id, opts) - -View devices - -View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The app ID that you want to view players from +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. opts = { - limit: 56, # Integer | How many devices to return. Max is 300. Default is 300 - offset: 56 # Integer | Result offset. Default is 0. Results are sorted by id; + offset: 56, # Integer | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. + limit: 56 # Integer | The amount of Segments in the response. Maximum 300. } begin - # View devices - result = api_instance.get_players(app_id, opts) + # Get Segments + result = api_instance.get_segments(app_id, opts) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_players: #{e}" + puts "Error when calling DefaultApi->get_segments: #{e}" end ``` -#### Using the get_players_with_http_info variant +#### Using the get_segments_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_players_with_http_info(app_id, opts) +> , Integer, Hash)> get_segments_with_http_info(app_id, opts) ```ruby begin - # View devices - data, status_code, headers = api_instance.get_players_with_http_info(app_id, opts) + # Get Segments + data, status_code, headers = api_instance.get_segments_with_http_info(app_id, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_players_with_http_info: #{e}" + puts "Error when calling DefaultApi->get_segments_with_http_info: #{e}" end ``` @@ -2098,17 +1680,17 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The app ID that you want to view players from | | -| **limit** | **Integer** | How many devices to return. Max is 300. Default is 300 | [optional] | -| **offset** | **Integer** | Result offset. Default is 0. Results are sorted by id; | [optional] | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **offset** | **Integer** | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. | [optional] | +| **limit** | **Integer** | The amount of Segments in the response. Maximum 300. | [optional] | ### Return type -[**PlayerSlice**](PlayerSlice.md) +[**GetSegmentsSuccessResponse**](GetSegmentsSuccessResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2116,13 +1698,13 @@ end - **Accept**: application/json -## identify_user_by_alias +## get_user -> identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body) +> get_user(app_id, alias_label, alias_id) -Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). +Returns the User’s properties, Aliases, and Subscriptions. ### Examples @@ -2130,10 +1712,8 @@ Upserts one or more Aliases to an existing User identified by (:alias_label, :al require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -2141,32 +1721,31 @@ api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | alias_label = 'alias_label_example' # String | alias_id = 'alias_id_example' # String | -user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody | begin - result = api_instance.identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body) + result = api_instance.get_user(app_id, alias_label, alias_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->identify_user_by_alias: #{e}" + puts "Error when calling DefaultApi->get_user: #{e}" end ``` -#### Using the identify_user_by_alias_with_http_info variant +#### Using the get_user_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body) +> , Integer, Hash)> get_user_with_http_info(app_id, alias_label, alias_id) ```ruby begin - data, status_code, headers = api_instance.identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body) + data, status_code, headers = api_instance.get_user_with_http_info(app_id, alias_label, alias_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->identify_user_by_alias_with_http_info: #{e}" + puts "Error when calling DefaultApi->get_user_with_http_info: #{e}" end ``` @@ -2177,29 +1756,28 @@ end | **app_id** | **String** | | | | **alias_label** | **String** | | | | **alias_id** | **String** | | | -| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | | ### Return type -[**InlineResponse200**](InlineResponse200.md) +[**User**](User.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json -## identify_user_by_subscription_id +## transfer_subscription -> identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body) +> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) -Upserts one or more Aliases for the User identified by :subscription_id. +Transfers this Subscription to the User identified by the identity in the payload. ### Examples @@ -2207,42 +1785,40 @@ Upserts one or more Aliases for the User identified by :subscription_id. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | subscription_id = 'subscription_id_example' # String | -user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody | +transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody | begin - result = api_instance.identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body) + result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->identify_user_by_subscription_id: #{e}" + puts "Error when calling DefaultApi->transfer_subscription: #{e}" end ``` -#### Using the identify_user_by_subscription_id_with_http_info variant +#### Using the transfer_subscription_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body) +> , Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) ```ruby begin - data, status_code, headers = api_instance.identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body) + data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->identify_user_by_subscription_id_with_http_info: #{e}" + puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}" end ``` @@ -2252,15 +1828,15 @@ end | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | | **subscription_id** | **String** | | | -| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | | +| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | | ### Return type -[**UserIdentityResponse**](UserIdentityResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2268,13 +1844,13 @@ end - **Accept**: application/json -## transfer_subscription +## unsubscribe_email_with_token -> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) +> unsubscribe_email_with_token(app_id, notification_id, token) +Unsubscribe with token - -Transfers this Subscription to the User identified by the identity in the payload. +Unsubscribe an email with a token when using your own custom email unsubscribe landing page ### Examples @@ -2282,42 +1858,40 @@ Transfers this Subscription to the User identified by the identity in the payloa require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | -subscription_id = 'subscription_id_example' # String | -transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody | +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +notification_id = 'notification_id_example' # String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. +token = 'token_example' # String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. begin - - result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) + # Unsubscribe with token + result = api_instance.unsubscribe_email_with_token(app_id, notification_id, token) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->transfer_subscription: #{e}" + puts "Error when calling DefaultApi->unsubscribe_email_with_token: #{e}" end ``` -#### Using the transfer_subscription_with_http_info variant +#### Using the unsubscribe_email_with_token_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) +> , Integer, Hash)> unsubscribe_email_with_token_with_http_info(app_id, notification_id, token) ```ruby begin - - data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) + # Unsubscribe with token + data, status_code, headers = api_instance.unsubscribe_email_with_token_with_http_info(app_id, notification_id, token) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}" + puts "Error when calling DefaultApi->unsubscribe_email_with_token_with_http_info: #{e}" end ``` @@ -2325,21 +1899,21 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | | | -| **subscription_id** | **String** | | | -| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | | +| **token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | | ### Return type -[**UserIdentityResponse**](UserIdentityResponse.md) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json @@ -2357,10 +1931,8 @@ Updates the name or configuration settings of an existing OneSignal app require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: user_key - config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: user_auth_key + config.user_auth_key = 'YOUR_BEARER_TOKEN' end @@ -2408,7 +1980,7 @@ end ### Authorization -[user_key](../README.md#user_key) +[user_auth_key](../README.md#user_auth_key) ### HTTP request headers @@ -2430,17 +2002,15 @@ Updates a specified live activity. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. activity_id = 'activity_id_example' # String | Live Activity record ID -update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'headings', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest | +update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'name_example', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest | begin # Update a Live Activity via Push @@ -2483,157 +2053,7 @@ end ### Authorization -[app_key](../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_player - -> update_player(player_id, player) - -Edit device - -Update an existing device in one of your OneSignal apps - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -player_id = 'player_id_example' # String | Player's OneSignal ID -player = OneSignal::Player.new({device_type: 37}) # Player | - -begin - # Edit device - result = api_instance.update_player(player_id, player) - p result -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_player: #{e}" -end -``` - -#### Using the update_player_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> update_player_with_http_info(player_id, player) - -```ruby -begin - # Edit device - data, status_code, headers = api_instance.update_player_with_http_info(player_id, player) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_player_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **player_id** | **String** | Player's OneSignal ID | | -| **player** | [**Player**](Player.md) | | | - -### Return type - -[**UpdatePlayerSuccessResponse**](UpdatePlayerSuccessResponse.md) - -### Authorization - -[app_key](../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_player_tags - -> update_player_tags(app_id, external_user_id, opts) - -Edit tags with external user id - -Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - -### Examples - -```ruby -require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints - -end - -api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID the user record is found under. -external_user_id = 'external_user_id_example' # String | The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. -opts = { - update_player_tags_request_body: OneSignal::UpdatePlayerTagsRequestBody.new # UpdatePlayerTagsRequestBody | -} - -begin - # Edit tags with external user id - result = api_instance.update_player_tags(app_id, external_user_id, opts) - p result -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_player_tags: #{e}" -end -``` - -#### Using the update_player_tags_with_http_info variant - -This returns an Array which contains the response data, status code and headers. - -> , Integer, Hash)> update_player_tags_with_http_info(app_id, external_user_id, opts) - -```ruby -begin - # Edit tags with external user id - data, status_code, headers = api_instance.update_player_tags_with_http_info(app_id, external_user_id, opts) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->update_player_tags_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID the user record is found under. | | -| **external_user_id** | **String** | The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. | | -| **update_player_tags_request_body** | [**UpdatePlayerTagsRequestBody**](UpdatePlayerTagsRequestBody.md) | | [optional] | - -### Return type - -[**UpdatePlayerTagsSuccessResponse**](UpdatePlayerTagsSuccessResponse.md) - -### Authorization - -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2643,7 +2063,7 @@ end ## update_subscription -> update_subscription(app_id, subscription_id, update_subscription_request_body) +> update_subscription(app_id, subscription_id, subscription_body) @@ -2655,21 +2075,19 @@ Updates an existing Subscription’s properties. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | subscription_id = 'subscription_id_example' # String | -update_subscription_request_body = OneSignal::UpdateSubscriptionRequestBody.new # UpdateSubscriptionRequestBody | +subscription_body = OneSignal::SubscriptionBody.new # SubscriptionBody | begin - api_instance.update_subscription(app_id, subscription_id, update_subscription_request_body) + api_instance.update_subscription(app_id, subscription_id, subscription_body) rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->update_subscription: #{e}" end @@ -2679,12 +2097,12 @@ end This returns an Array which contains the response data (`nil` in this case), status code and headers. -> update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body) +> update_subscription_with_http_info(app_id, subscription_id, subscription_body) ```ruby begin - data, status_code, headers = api_instance.update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body) + data, status_code, headers = api_instance.update_subscription_with_http_info(app_id, subscription_id, subscription_body) p status_code # => 2xx p headers # => { ... } p data # => nil @@ -2699,7 +2117,7 @@ end | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | | **subscription_id** | **String** | | | -| **update_subscription_request_body** | [**UpdateSubscriptionRequestBody**](UpdateSubscriptionRequestBody.md) | | | +| **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) | | | ### Return type @@ -2707,7 +2125,7 @@ nil (empty response body) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -2717,7 +2135,7 @@ nil (empty response body) ## update_user -> update_user(app_id, alias_label, alias_id, update_user_request) +> update_user(app_id, alias_label, alias_id, update_user_request) @@ -2729,10 +2147,8 @@ Updates an existing User’s properties. require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints - # Configure Bearer authorization: app_key - config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints + # Configure Bearer authorization: rest_api_key + config.rest_api_key = 'YOUR_BEARER_TOKEN' end @@ -2755,7 +2171,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_user_with_http_info(app_id, alias_label, alias_id, update_user_request) +> , Integer, Hash)> update_user_with_http_info(app_id, alias_label, alias_id, update_user_request) ```ruby begin @@ -2763,7 +2179,7 @@ begin data, status_code, headers = api_instance.update_user_with_http_info(app_id, alias_label, alias_id, update_user_request) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->update_user_with_http_info: #{e}" end @@ -2780,11 +2196,11 @@ end ### Return type -[**InlineResponse202**](InlineResponse202.md) +[**PropertiesBody**](PropertiesBody.md) ### Authorization -[app_key](../README.md#app_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers diff --git a/docs/DeletePlayerNotFoundResponse.md b/docs/DeletePlayerNotFoundResponse.md deleted file mode 100644 index 85fe84c..0000000 --- a/docs/DeletePlayerNotFoundResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::DeletePlayerNotFoundResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::DeletePlayerNotFoundResponse.new( - success: null -) -``` - diff --git a/docs/DeleteSegmentNotFoundResponse.md b/docs/DeleteSegmentNotFoundResponse.md deleted file mode 100644 index 1332fec..0000000 --- a/docs/DeleteSegmentNotFoundResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::DeleteSegmentNotFoundResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::DeleteSegmentNotFoundResponse.new( - success: null -) -``` - diff --git a/docs/DeleteSegmentSuccessResponse.md b/docs/DeleteSegmentSuccessResponse.md deleted file mode 100644 index 93401c1..0000000 --- a/docs/DeleteSegmentSuccessResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::DeleteSegmentSuccessResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::DeleteSegmentSuccessResponse.new( - success: null -) -``` - diff --git a/docs/ExportPlayersRequestBody.md b/docs/ExportSubscriptionsRequestBody.md similarity index 86% rename from docs/ExportPlayersRequestBody.md rename to docs/ExportSubscriptionsRequestBody.md index 2b6c042..ab88c0b 100644 --- a/docs/ExportPlayersRequestBody.md +++ b/docs/ExportSubscriptionsRequestBody.md @@ -1,4 +1,4 @@ -# OneSignal::ExportPlayersRequestBody +# OneSignal::ExportSubscriptionsRequestBody ## Properties @@ -13,7 +13,7 @@ ```ruby require 'onesignal' -instance = OneSignal::ExportPlayersRequestBody.new( +instance = OneSignal::ExportSubscriptionsRequestBody.new( extra_fields: null, last_active_since: null, segment_name: null diff --git a/docs/ExportPlayersSuccessResponse.md b/docs/ExportSubscriptionsSuccessResponse.md similarity index 65% rename from docs/ExportPlayersSuccessResponse.md rename to docs/ExportSubscriptionsSuccessResponse.md index ba76645..74639c0 100644 --- a/docs/ExportPlayersSuccessResponse.md +++ b/docs/ExportSubscriptionsSuccessResponse.md @@ -1,4 +1,4 @@ -# OneSignal::ExportPlayersSuccessResponse +# OneSignal::ExportSubscriptionsSuccessResponse ## Properties @@ -11,7 +11,7 @@ ```ruby require 'onesignal' -instance = OneSignal::ExportPlayersSuccessResponse.new( +instance = OneSignal::ExportSubscriptionsSuccessResponse.new( csv_file_url: null ) ``` diff --git a/docs/Filter.md b/docs/Filter.md index 7451cf5..8942962 100644 --- a/docs/Filter.md +++ b/docs/Filter.md @@ -4,10 +4,14 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **field** | **String** | Name of the field to use as the first operand in the filter expression. | | +| **field** | **String** | Required. Name of the field to use as the first operand in the filter expression. | [optional] | | **key** | **String** | If `field` is `tag`, this field is *required* to specify `key` inside the tags. | [optional] | | **value** | **String** | Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. | [optional] | -| **relation** | **String** | Operator of a filter expression. | | +| **hours_ago** | **String** | If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. | [optional] | +| **radius** | **Float** | If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. | [optional] | +| **lat** | **Float** | If `field` is `location`, this is *required* to specify the user's latitude. | [optional] | +| **long** | **Float** | If `field` is `location`, this is *required* to specify the user's longitude. | [optional] | +| **relation** | **String** | Required. Operator of a filter expression. | [optional] | ## Example @@ -18,6 +22,10 @@ instance = OneSignal::Filter.new( field: null, key: null, value: null, + hours_ago: null, + radius: null, + lat: null, + long: null, relation: null ) ``` diff --git a/docs/Notification200Errors.md b/docs/FilterExpression.md similarity index 61% rename from docs/Notification200Errors.md rename to docs/FilterExpression.md index a09ba9c..1ebf94e 100644 --- a/docs/Notification200Errors.md +++ b/docs/FilterExpression.md @@ -1,4 +1,4 @@ -# OneSignal::Notification200Errors +# OneSignal::FilterExpression ## Class instance methods @@ -11,11 +11,11 @@ Returns the list of classes defined in oneOf. ```ruby require 'onesignal' -OneSignal::Notification200Errors.openapi_one_of +OneSignal::FilterExpression.openapi_one_of # => # [ -# :'Array', -# :'InvalidIdentifierError' +# :'Filter', +# :'Operator' # ] ``` @@ -28,10 +28,10 @@ Find the appropriate object from the `openapi_one_of` list and casts the data in ```ruby require 'onesignal' -OneSignal::Notification200Errors.build(data) -# => #:0x00007fdd4aab02a0> +OneSignal::FilterExpression.build(data) +# => # -OneSignal::Notification200Errors.build(data_that_doesnt_match) +OneSignal::FilterExpression.build(data_that_doesnt_match) # => nil ``` @@ -43,7 +43,7 @@ OneSignal::Notification200Errors.build(data_that_doesnt_match) #### Return type -- `Array` -- `InvalidIdentifierError` +- `Filter` +- `Operator` - `nil` (if no type matches) diff --git a/docs/FilterExpressions.md b/docs/FilterExpressions.md deleted file mode 100644 index 33bccba..0000000 --- a/docs/FilterExpressions.md +++ /dev/null @@ -1,26 +0,0 @@ -# OneSignal::FilterExpressions - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **field** | **String** | Name of the field to use as the first operand in the filter expression. | | -| **key** | **String** | If `field` is `tag`, this field is *required* to specify `key` inside the tags. | [optional] | -| **value** | **String** | Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. | [optional] | -| **relation** | **String** | Operator of a filter expression. | | -| **operator** | **String** | Strictly, this must be either `\"OR\"`, or `\"AND\"`. It can be used to compose Filters as part of a Filters object. | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::FilterExpressions.new( - field: null, - key: null, - value: null, - relation: null, - operator: null -) -``` - diff --git a/docs/GenericError.md b/docs/GenericError.md index 04a42ab..5612c1b 100644 --- a/docs/GenericError.md +++ b/docs/GenericError.md @@ -4,7 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **errors** | [**Array<GenericErrorErrorsInner>**](GenericErrorErrorsInner.md) | | [optional] | +| **errors** | **Object** | | [optional] | +| **success** | **Boolean** | | [optional] | +| **reference** | **Object** | | [optional] | ## Example @@ -12,7 +14,9 @@ require 'onesignal' instance = OneSignal::GenericError.new( - errors: null + errors: null, + success: null, + reference: null ) ``` diff --git a/docs/DeletePlayerSuccessResponse.md b/docs/GenericSuccessBoolResponse.md similarity index 67% rename from docs/DeletePlayerSuccessResponse.md rename to docs/GenericSuccessBoolResponse.md index 0aa5008..0ea859d 100644 --- a/docs/DeletePlayerSuccessResponse.md +++ b/docs/GenericSuccessBoolResponse.md @@ -1,4 +1,4 @@ -# OneSignal::DeletePlayerSuccessResponse +# OneSignal::GenericSuccessBoolResponse ## Properties @@ -11,7 +11,7 @@ ```ruby require 'onesignal' -instance = OneSignal::DeletePlayerSuccessResponse.new( +instance = OneSignal::GenericSuccessBoolResponse.new( success: null ) ``` diff --git a/docs/GetNotificationRequestBody.md b/docs/GetNotificationHistoryRequestBody.md similarity index 86% rename from docs/GetNotificationRequestBody.md rename to docs/GetNotificationHistoryRequestBody.md index 5ae559b..7a907e4 100644 --- a/docs/GetNotificationRequestBody.md +++ b/docs/GetNotificationHistoryRequestBody.md @@ -1,4 +1,4 @@ -# OneSignal::GetNotificationRequestBody +# OneSignal::GetNotificationHistoryRequestBody ## Properties @@ -13,7 +13,7 @@ ```ruby require 'onesignal' -instance = OneSignal::GetNotificationRequestBody.new( +instance = OneSignal::GetNotificationHistoryRequestBody.new( events: null, email: null, app_id: null diff --git a/docs/GetSegmentsSuccessResponse.md b/docs/GetSegmentsSuccessResponse.md new file mode 100644 index 0000000..c4f6329 --- /dev/null +++ b/docs/GetSegmentsSuccessResponse.md @@ -0,0 +1,24 @@ +# OneSignal::GetSegmentsSuccessResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **total_count** | **Integer** | The number of Segments in the response. | [optional] | +| **offset** | **Integer** | Set with the offset query parameter. Default 0. | [optional] | +| **limit** | **Integer** | Maximum number of Segments returned. Default 300. | [optional] | +| **segments** | [**Array<SegmentData>**](SegmentData.md) | An array containing the Segment information. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::GetSegmentsSuccessResponse.new( + total_count: null, + offset: null, + limit: null, + segments: null +) +``` + diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md deleted file mode 100644 index 7e14059..0000000 --- a/docs/InlineResponse2003.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::InlineResponse2003 - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **in_app_messages** | **Array<Object>** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::InlineResponse2003.new( - in_app_messages: null -) -``` - diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md deleted file mode 100644 index eb691ec..0000000 --- a/docs/InlineResponse201.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::InlineResponse201 - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::InlineResponse201.new( - subscription: null -) -``` - diff --git a/docs/InvalidIdentifierError.md b/docs/InvalidIdentifierError.md deleted file mode 100644 index 2521497..0000000 --- a/docs/InvalidIdentifierError.md +++ /dev/null @@ -1,20 +0,0 @@ -# OneSignal::InvalidIdentifierError - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **invalid_external_user_ids** | **Array<String>** | Returned if using include_external_user_ids | [optional] | -| **invalid_player_ids** | **Array<String>** | Returned if using include_player_ids and some were valid and others were not. | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::InvalidIdentifierError.new( - invalid_external_user_ids: null, - invalid_player_ids: null -) -``` - diff --git a/docs/StringMap.md b/docs/LanguageStringMap.md similarity index 97% rename from docs/StringMap.md rename to docs/LanguageStringMap.md index dac6e3e..2e33cdd 100644 --- a/docs/StringMap.md +++ b/docs/LanguageStringMap.md @@ -1,4 +1,4 @@ -# OneSignal::StringMap +# OneSignal::LanguageStringMap ## Properties @@ -53,7 +53,7 @@ ```ruby require 'onesignal' -instance = OneSignal::StringMap.new( +instance = OneSignal::LanguageStringMap.new( en: null, ar: null, bs: null, diff --git a/docs/Notification.md b/docs/Notification.md index 42b9154..69a188f 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -6,17 +6,16 @@ | ---- | ---- | ----------- | ----- | | **included_segments** | **Array<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | | **excluded_segments** | **Array<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -| **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_subscription_ids** | **Array<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | | **target_channel** | **String** | | [optional] | | **id** | **String** | | [optional] | | **value** | **Integer** | | [optional][readonly] | @@ -32,13 +31,12 @@ | **is_wp_wns** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | | **is_adm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | | **is_chrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -| **channel_for_external_user_ids** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | | **app_id** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | | **external_id** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | | **idempotency_key** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -| **contents** | [**StringMap**](StringMap.md) | | [optional] | -| **headings** | [**StringMap**](StringMap.md) | | [optional] | -| **subtitle** | [**StringMap**](StringMap.md) | | [optional] | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | | **data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | | **huawei_msg_type** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | | **url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -55,7 +53,7 @@ | **chrome_big_picture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | | **chrome_web_image** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | | **buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -| **web_buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +| **web_buttons** | [**Array<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | | **ios_category** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | | **android_channel_id** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | | **huawei_channel_id** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -101,6 +99,8 @@ | **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | | **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | | **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +| **ios_relevance_score** | **Float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +| **ios_interruption_level** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | | **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | | **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | | **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -109,7 +109,7 @@ | **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | | **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | | **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -| **filters** | [**Array<Filter>**](Filter.md) | | [optional] | +| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] | | **custom_data** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | | **send_after** | **Time** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | @@ -121,8 +121,7 @@ require 'onesignal' instance = OneSignal::Notification.new( included_segments: null, excluded_segments: null, - include_player_ids: null, - include_external_user_ids: null, + include_subscription_ids: null, include_email_tokens: null, include_phone_numbers: null, include_ios_tokens: null, @@ -147,7 +146,6 @@ instance = OneSignal::Notification.new( is_wp_wns: null, is_adm: null, is_chrome: null, - channel_for_external_user_ids: null, app_id: null, external_id: null, idempotency_key: null, @@ -216,6 +214,8 @@ instance = OneSignal::Notification.new( thread_id: null, summary_arg: null, summary_arg_count: null, + ios_relevance_score: null, + ios_interruption_level: null, email_subject: null, email_body: null, email_from_name: null, diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md index f8ed086..cf5f450 100644 --- a/docs/NotificationTarget.md +++ b/docs/NotificationTarget.md @@ -6,17 +6,16 @@ | ---- | ---- | ----------- | ----- | | **included_segments** | **Array<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | | **excluded_segments** | **Array<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -| **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_subscription_ids** | **Array<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | | **target_channel** | **String** | | [optional] | ## Example @@ -27,8 +26,7 @@ require 'onesignal' instance = OneSignal::NotificationTarget.new( included_segments: null, excluded_segments: null, - include_player_ids: null, - include_external_user_ids: null, + include_subscription_ids: null, include_email_tokens: null, include_phone_numbers: null, include_ios_tokens: null, diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index d91744e..1624232 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -6,17 +6,16 @@ | ---- | ---- | ----------- | ----- | | **included_segments** | **Array<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | | **excluded_segments** | **Array<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | -| **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_subscription_ids** | **Array<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | | **target_channel** | **String** | | [optional] | | **id** | **String** | | [optional] | | **value** | **Integer** | | [optional][readonly] | @@ -32,13 +31,12 @@ | **is_wp_wns** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | | **is_adm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | | **is_chrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | -| **channel_for_external_user_ids** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | | **app_id** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | | **external_id** | **String** | [DEPRECATED] Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | | **idempotency_key** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | -| **contents** | [**StringMap**](StringMap.md) | | [optional] | -| **headings** | [**StringMap**](StringMap.md) | | [optional] | -| **subtitle** | [**StringMap**](StringMap.md) | | [optional] | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **subtitle** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | | **data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | | **huawei_msg_type** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | | **url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | @@ -55,7 +53,7 @@ | **chrome_big_picture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | | **chrome_web_image** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | | **buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | -| **web_buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +| **web_buttons** | [**Array<WebButton>**](WebButton.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | | **ios_category** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | | **android_channel_id** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | | **huawei_channel_id** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | @@ -101,6 +99,8 @@ | **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | | **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | | **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +| **ios_relevance_score** | **Float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | +| **ios_interruption_level** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | | **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | | **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | | **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -109,7 +109,7 @@ | **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | | **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | | **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | -| **filters** | [**Array<Filter>**](Filter.md) | | [optional] | +| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | | [optional] | | **custom_data** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] | | **successful** | **Integer** | Number of notifications that were successfully delivered. | [optional] | | **failed** | **Integer** | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional] | @@ -131,8 +131,7 @@ require 'onesignal' instance = OneSignal::NotificationWithMeta.new( included_segments: null, excluded_segments: null, - include_player_ids: null, - include_external_user_ids: null, + include_subscription_ids: null, include_email_tokens: null, include_phone_numbers: null, include_ios_tokens: null, @@ -157,7 +156,6 @@ instance = OneSignal::NotificationWithMeta.new( is_wp_wns: null, is_adm: null, is_chrome: null, - channel_for_external_user_ids: null, app_id: null, external_id: null, idempotency_key: null, @@ -226,6 +224,8 @@ instance = OneSignal::NotificationWithMeta.new( thread_id: null, summary_arg: null, summary_arg_count: null, + ios_relevance_score: null, + ios_interruption_level: null, email_subject: null, email_body: null, email_from_name: null, diff --git a/docs/Player.md b/docs/Player.md deleted file mode 100644 index 8241656..0000000 --- a/docs/Player.md +++ /dev/null @@ -1,70 +0,0 @@ -# OneSignal::Player - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **id** | **String** | The device's OneSignal ID | [optional][readonly] | -| **invalid_identifier** | **Boolean** | If true, this is the equivalent of a user being Unsubscribed | [optional][readonly] | -| **app_id** | **String** | | [optional] | -| **device_type** | **Integer** | Required The device's platform: 0 = iOS 1 = Android 2 = Amazon 3 = WindowsPhone (MPNS) 4 = Chrome Apps / Extensions 5 = Chrome Web Push 6 = Windows (WNS) 7 = Safari 8 = Firefox 9 = MacOS 10 = Alexa 11 = Email 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM 14 = SMS | | -| **external_user_id** | **String** | a custom user ID | [optional] | -| **external_user_id_auth_hash** | **String** | Only required if you have enabled Identity Verification and device_type is NOT 11 email. | [optional] | -| **email_auth_hash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | -| **identifier** | **String** | Recommended: For Push Notifications, this is the Push Token Identifier from Google or Apple. For Apple Push identifiers, you must strip all non alphanumeric characters. Examples: iOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0 Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV... For Email Addresses, set the full email address email@email.com and make sure to set device_type to 11. | [optional] | -| **language** | **String** | Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: en | [optional] | -| **timezone** | **Integer** | Number of seconds away from UTC. Example: -28800 | [optional] | -| **game_version** | **String** | Version of your app. Example: 1.1 | [optional] | -| **device_model** | **String** | Device make and model. Example: iPhone5,1 | [optional] | -| **device_os** | **String** | Device operating system version. Example: 7.0.4 | [optional] | -| **ad_id** | **String** | The ad id for the device's platform: Android = Advertising Id iOS = identifierForVendor WP8.0 = DeviceUniqueId WP8.1 = AdvertisingId | [optional] | -| **sdk** | **String** | Name and version of the sdk/plugin that's calling this API method (if any) | [optional] | -| **session_count** | **Integer** | Number of times the user has played the game, defaults to 1 | [optional] | -| **tags** | **Object** | Custom tags for the player. Only support string and integer key value pairs. Does not support arrays or other nested objects. Setting a tag value to null or an empty string will remove the tag. Example: {\"foo\":\"bar\",\"this\":\"that\"} Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of data Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | -| **amount_spent** | **Float** | Amount the user has spent in USD, up to two decimal places | [optional] | -| **created_at** | **Integer** | Unixtime when the player joined the game | [optional] | -| **playtime** | **Integer** | Seconds player was running your app. | [optional] | -| **badge_count** | **Integer** | Current iOS badge count displayed on the app icon NOTE: Not supported for apps created after June 2018, since badge count for apps created after this date are handled on the client. | [optional] | -| **last_active** | **Integer** | Unixtime when the player was last active | [optional] | -| **notification_types** | **Integer** | 1 = subscribed -2 = unsubscribed iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues. | [optional] | -| **test_type** | **Integer** | This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. 1 = Development 2 = Ad-Hoc Omit this field for App Store builds. | [optional] | -| **long** | **Float** | Longitude of the device, used for geotagging to segment on. | [optional] | -| **lat** | **Float** | Latitude of the device, used for geotagging to segment on. | [optional] | -| **country** | **String** | Country code in the ISO 3166-1 Alpha 2 format | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::Player.new( - id: null, - invalid_identifier: null, - app_id: null, - device_type: null, - external_user_id: null, - external_user_id_auth_hash: null, - email_auth_hash: null, - identifier: null, - language: null, - timezone: null, - game_version: null, - device_model: null, - device_os: null, - ad_id: null, - sdk: null, - session_count: null, - tags: null, - amount_spent: null, - created_at: null, - playtime: null, - badge_count: null, - last_active: null, - notification_types: null, - test_type: null, - long: null, - lat: null, - country: null -) -``` - diff --git a/docs/PlayerNotificationTarget.md b/docs/PlayerNotificationTarget.md deleted file mode 100644 index 865f9a1..0000000 --- a/docs/PlayerNotificationTarget.md +++ /dev/null @@ -1,40 +0,0 @@ -# OneSignal::PlayerNotificationTarget - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | -| **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | -| **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | -| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | -| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | -| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | -| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | -| **target_channel** | **String** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::PlayerNotificationTarget.new( - include_player_ids: null, - include_external_user_ids: null, - include_email_tokens: null, - include_phone_numbers: null, - include_ios_tokens: null, - include_wp_wns_uris: null, - include_amazon_reg_ids: null, - include_chrome_reg_ids: null, - include_chrome_web_reg_ids: null, - include_android_reg_ids: null, - include_aliases: null, - target_channel: null -) -``` - diff --git a/docs/PlayerNotificationTargetIncludeAliases.md b/docs/PlayerNotificationTargetIncludeAliases.md deleted file mode 100644 index 8d2bd8b..0000000 --- a/docs/PlayerNotificationTargetIncludeAliases.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::PlayerNotificationTargetIncludeAliases - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **alias_label** | **Array<String>** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::PlayerNotificationTargetIncludeAliases.new( - alias_label: null -) -``` - diff --git a/docs/PlayerSlice.md b/docs/PlayerSlice.md deleted file mode 100644 index 6a68b70..0000000 --- a/docs/PlayerSlice.md +++ /dev/null @@ -1,24 +0,0 @@ -# OneSignal::PlayerSlice - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **total_count** | **Integer** | | [optional] | -| **offset** | **Integer** | | [optional] | -| **limit** | **Integer** | | [optional] | -| **players** | [**Array<Player>**](Player.md) | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::PlayerSlice.new( - total_count: null, - offset: null, - limit: null, - players: null -) -``` - diff --git a/docs/InlineResponse202.md b/docs/PropertiesBody.md similarity index 76% rename from docs/InlineResponse202.md rename to docs/PropertiesBody.md index 353bc48..2004ffb 100644 --- a/docs/InlineResponse202.md +++ b/docs/PropertiesBody.md @@ -1,4 +1,4 @@ -# OneSignal::InlineResponse202 +# OneSignal::PropertiesBody ## Properties @@ -11,7 +11,7 @@ ```ruby require 'onesignal' -instance = OneSignal::InlineResponse202.new( +instance = OneSignal::PropertiesBody.new( properties: null ) ``` diff --git a/docs/PropertiesDeltas.md b/docs/PropertiesDeltas.md index a19592b..519ff8b 100644 --- a/docs/PropertiesDeltas.md +++ b/docs/PropertiesDeltas.md @@ -4,8 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **session_time** | **Float** | | [optional] | -| **session_count** | **Float** | | [optional] | +| **session_time** | **Integer** | | [optional] | +| **session_count** | **Integer** | | [optional] | | **purchases** | [**Array<Purchase>**](Purchase.md) | | [optional] | ## Example diff --git a/docs/PropertiesObject.md b/docs/PropertiesObject.md index 9446813..5c09290 100644 --- a/docs/PropertiesObject.md +++ b/docs/PropertiesObject.md @@ -10,8 +10,8 @@ | **lat** | **Float** | | [optional] | | **long** | **Float** | | [optional] | | **country** | **String** | | [optional] | -| **first_active** | **Float** | | [optional] | -| **last_active** | **Float** | | [optional] | +| **first_active** | **Integer** | | [optional] | +| **last_active** | **Integer** | | [optional] | | **amount_spent** | **Float** | | [optional] | | **purchases** | [**Array<Purchase>**](Purchase.md) | | [optional] | | **ip** | **String** | | [optional] | diff --git a/docs/Purchase.md b/docs/Purchase.md index 85677bc..11f8da1 100644 --- a/docs/Purchase.md +++ b/docs/Purchase.md @@ -7,7 +7,7 @@ | **sku** | **String** | The unique identifier of the purchased item. | | | **amount** | **String** | The amount, in USD, spent purchasing the item. | | | **iso** | **String** | The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. | | -| **count** | **Float** | | [optional] | +| **count** | **Integer** | | [optional] | ## Example diff --git a/docs/RateLimitError.md b/docs/RateLimitError.md new file mode 100644 index 0000000..b9093e1 --- /dev/null +++ b/docs/RateLimitError.md @@ -0,0 +1,20 @@ +# OneSignal::RateLimitError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **errors** | **Array<String>** | | [optional] | +| **limit** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::RateLimitError.new( + errors: null, + limit: null +) +``` + diff --git a/docs/Segment.md b/docs/Segment.md index 95f4829..476b907 100644 --- a/docs/Segment.md +++ b/docs/Segment.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **id** | **String** | UUID of the segment. If left empty, it will be assigned automaticaly. | [optional] | | **name** | **String** | Name of the segment. You'll see this name on the Web UI. | | -| **filters** | [**Array<FilterExpressions>**](FilterExpressions.md) | Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. | | +| **filters** | [**Array<FilterExpression>**](FilterExpression.md) | Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. | | ## Example diff --git a/docs/SegmentData.md b/docs/SegmentData.md new file mode 100644 index 0000000..eae1744 --- /dev/null +++ b/docs/SegmentData.md @@ -0,0 +1,30 @@ +# OneSignal::SegmentData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The segment ID | [optional] | +| **name** | **String** | The segment name | [optional] | +| **created_at** | **String** | Date segment created | [optional] | +| **updated_at** | **String** | Date segment last updated | [optional] | +| **app_id** | **String** | The app id | [optional] | +| **read_only** | **Boolean** | Is the segment read only? | [optional] | +| **is_active** | **Boolean** | Is the segment active? | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::SegmentData.new( + id: null, + name: null, + created_at: null, + updated_at: null, + app_id: null, + read_only: null, + is_active: null +) +``` + diff --git a/docs/SubscriptionObject.md b/docs/Subscription.md similarity index 75% rename from docs/SubscriptionObject.md rename to docs/Subscription.md index 1bb05dc..aec5241 100644 --- a/docs/SubscriptionObject.md +++ b/docs/Subscription.md @@ -1,4 +1,4 @@ -# OneSignal::SubscriptionObject +# OneSignal::Subscription ## Properties @@ -8,16 +8,16 @@ | **type** | **String** | | [optional] | | **token** | **String** | | [optional] | | **enabled** | **Boolean** | | [optional] | -| **notification_types** | **Float** | | [optional] | -| **session_time** | **Float** | | [optional] | -| **session_count** | **Float** | | [optional] | +| **notification_types** | **Integer** | | [optional] | +| **session_time** | **Integer** | | [optional] | +| **session_count** | **Integer** | | [optional] | | **sdk** | **String** | | [optional] | | **device_model** | **String** | | [optional] | | **device_os** | **String** | | [optional] | | **rooted** | **Boolean** | | [optional] | -| **test_type** | **Float** | | [optional] | +| **test_type** | **Integer** | | [optional] | | **app_version** | **String** | | [optional] | -| **net_type** | **Float** | | [optional] | +| **net_type** | **Integer** | | [optional] | | **carrier** | **String** | | [optional] | | **web_auth** | **String** | | [optional] | | **web_p256** | **String** | | [optional] | @@ -27,7 +27,7 @@ ```ruby require 'onesignal' -instance = OneSignal::SubscriptionObject.new( +instance = OneSignal::Subscription.new( id: null, type: null, token: null, diff --git a/docs/SubscriptionBody.md b/docs/SubscriptionBody.md new file mode 100644 index 0000000..efac0f6 --- /dev/null +++ b/docs/SubscriptionBody.md @@ -0,0 +1,18 @@ +# OneSignal::SubscriptionBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subscription** | [**Subscription**](Subscription.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::SubscriptionBody.new( + subscription: null +) +``` + diff --git a/docs/SubscriptionNotificationTarget.md b/docs/SubscriptionNotificationTarget.md new file mode 100644 index 0000000..7fc7d4d --- /dev/null +++ b/docs/SubscriptionNotificationTarget.md @@ -0,0 +1,38 @@ +# OneSignal::SubscriptionNotificationTarget + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **include_subscription_ids** | **Array<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | +| **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | +| **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | +| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] | +| **target_channel** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::SubscriptionNotificationTarget.new( + include_subscription_ids: null, + include_email_tokens: null, + include_phone_numbers: null, + include_ios_tokens: null, + include_wp_wns_uris: null, + include_amazon_reg_ids: null, + include_chrome_reg_ids: null, + include_chrome_web_reg_ids: null, + include_android_reg_ids: null, + include_aliases: null, + target_channel: null +) +``` + diff --git a/docs/TransferSubscriptionRequestBody.md b/docs/TransferSubscriptionRequestBody.md index 185c57f..a126bee 100644 --- a/docs/TransferSubscriptionRequestBody.md +++ b/docs/TransferSubscriptionRequestBody.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **identity** | **Hash<String, Object>** | | [optional] | +| **identity** | **Hash<String, String>** | | [optional] | ## Example diff --git a/docs/UpdateLiveActivityRequest.md b/docs/UpdateLiveActivityRequest.md index 27ef633..1459900 100644 --- a/docs/UpdateLiveActivityRequest.md +++ b/docs/UpdateLiveActivityRequest.md @@ -4,10 +4,15 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **name** | **String** | Type of live activity | | +| **name** | **String** | An internal name to assist with your campaign organization. This does not get displayed in the message itself. | | | **event** | **String** | | | -| **event_updates** | **Object** | | | -| **dismiss_at** | **Float** | Timestamp; only allowed if event is \"end\" | [optional] | +| **event_updates** | **Object** | This must match the ContentState interface you have defined within your Live Activity in your app. | | +| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +| **sound** | **String** | Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. | [optional] | +| **stale_date** | **Integer** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] | +| **dismissal_date** | **Integer** | Accepts Unix timestamp in seconds; only allowed if event is \"end\" | [optional] | +| **priority** | **Integer** | Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery. | [optional] | ## Example @@ -18,7 +23,12 @@ instance = OneSignal::UpdateLiveActivityRequest.new( name: null, event: null, event_updates: null, - dismiss_at: null + contents: null, + headings: null, + sound: null, + stale_date: null, + dismissal_date: null, + priority: null ) ``` diff --git a/docs/UpdateLiveActivitySuccessResponse.md b/docs/UpdateLiveActivitySuccessResponse.md index 0d00678..d6c1e6c 100644 --- a/docs/UpdateLiveActivitySuccessResponse.md +++ b/docs/UpdateLiveActivitySuccessResponse.md @@ -4,8 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **notification_id** | **String** | | [optional] | -| **errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | +| **id** | **String** | | [optional] | ## Example @@ -13,8 +12,7 @@ require 'onesignal' instance = OneSignal::UpdateLiveActivitySuccessResponse.new( - notification_id: null, - errors: null + id: null ) ``` diff --git a/docs/UpdatePlayerSuccessResponse.md b/docs/UpdatePlayerSuccessResponse.md deleted file mode 100644 index 50b2666..0000000 --- a/docs/UpdatePlayerSuccessResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UpdatePlayerSuccessResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UpdatePlayerSuccessResponse.new( - success: null -) -``` - diff --git a/docs/UpdatePlayerTagsRequestBody.md b/docs/UpdatePlayerTagsRequestBody.md deleted file mode 100644 index 75aac4d..0000000 --- a/docs/UpdatePlayerTagsRequestBody.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UpdatePlayerTagsRequestBody - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **tags** | **Object** | Custom tags for the device record. Only support string key value pairs. Does not support arrays or other nested objects. Example `{\"foo\":\"bar\",\"this\":\"that\"}`. Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of ata Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UpdatePlayerTagsRequestBody.new( - tags: null -) -``` - diff --git a/docs/UpdatePlayerTagsSuccessResponse.md b/docs/UpdatePlayerTagsSuccessResponse.md deleted file mode 100644 index 5c99ef7..0000000 --- a/docs/UpdatePlayerTagsSuccessResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UpdatePlayerTagsSuccessResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UpdatePlayerTagsSuccessResponse.new( - success: null -) -``` - diff --git a/docs/UpdateSubscriptionRequestBody.md b/docs/UpdateSubscriptionRequestBody.md deleted file mode 100644 index e0c04c8..0000000 --- a/docs/UpdateSubscriptionRequestBody.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UpdateSubscriptionRequestBody - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UpdateSubscriptionRequestBody.new( - subscription: null -) -``` - diff --git a/docs/User.md b/docs/User.md index 90f2ae2..2ad0faf 100644 --- a/docs/User.md +++ b/docs/User.md @@ -5,9 +5,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **properties** | [**PropertiesObject**](PropertiesObject.md) | | [optional] | -| **identity** | **Hash<String, Object>** | | [optional] | -| **subscriptions** | [**Array<SubscriptionObject>**](SubscriptionObject.md) | | [optional] | -| **subscription_options** | [**UserSubscriptionOptions**](UserSubscriptionOptions.md) | | [optional] | +| **identity** | **Hash<String, String>** | | [optional] | +| **subscriptions** | [**Array<Subscription>**](Subscription.md) | | [optional] | ## Example @@ -17,8 +16,7 @@ require 'onesignal' instance = OneSignal::User.new( properties: null, identity: null, - subscriptions: null, - subscription_options: null + subscriptions: null ) ``` diff --git a/docs/InlineResponse200.md b/docs/UserIdentityBody.md similarity index 53% rename from docs/InlineResponse200.md rename to docs/UserIdentityBody.md index 059e84a..ea1c876 100644 --- a/docs/InlineResponse200.md +++ b/docs/UserIdentityBody.md @@ -1,17 +1,17 @@ -# OneSignal::InlineResponse200 +# OneSignal::UserIdentityBody ## Properties | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **identity** | **Hash<String, Object>** | | [optional] | +| **identity** | **Hash<String, String>** | | [optional] | ## Example ```ruby require 'onesignal' -instance = OneSignal::InlineResponse200.new( +instance = OneSignal::UserIdentityBody.new( identity: null ) ``` diff --git a/docs/UserIdentityRequestBody.md b/docs/UserIdentityRequestBody.md deleted file mode 100644 index 797866e..0000000 --- a/docs/UserIdentityRequestBody.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UserIdentityRequestBody - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **identity** | **Hash<String, Object>** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UserIdentityRequestBody.new( - identity: null -) -``` - diff --git a/docs/UserIdentityResponse.md b/docs/UserIdentityResponse.md deleted file mode 100644 index 84f4cb1..0000000 --- a/docs/UserIdentityResponse.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UserIdentityResponse - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **identity** | **Hash<String, Object>** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UserIdentityResponse.new( - identity: null -) -``` - diff --git a/docs/UserSubscriptionOptions.md b/docs/UserSubscriptionOptions.md deleted file mode 100644 index 9dcd472..0000000 --- a/docs/UserSubscriptionOptions.md +++ /dev/null @@ -1,18 +0,0 @@ -# OneSignal::UserSubscriptionOptions - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **retain_previous_owner** | **Boolean** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::UserSubscriptionOptions.new( - retain_previous_owner: null -) -``` - diff --git a/docs/WebButton.md b/docs/WebButton.md new file mode 100644 index 0000000..10fc3f9 --- /dev/null +++ b/docs/WebButton.md @@ -0,0 +1,24 @@ +# OneSignal::WebButton + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | +| **text** | **String** | | [optional] | +| **icon** | **String** | | [optional] | +| **url** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::WebButton.new( + id: null, + text: null, + icon: null, + url: null +) +``` + diff --git a/lib/onesignal.rb b/lib/onesignal.rb index 69c6857..633d4e2 100644 --- a/lib/onesignal.rb +++ b/lib/onesignal.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -21,37 +21,25 @@ require 'onesignal/models/basic_notification' require 'onesignal/models/basic_notification_all_of' require 'onesignal/models/basic_notification_all_of_android_background_layout' -require 'onesignal/models/begin_live_activity_request' require 'onesignal/models/button' -require 'onesignal/models/cancel_notification_success_response' require 'onesignal/models/create_notification_success_response' -require 'onesignal/models/create_player_success_response' require 'onesignal/models/create_segment_conflict_response' require 'onesignal/models/create_segment_success_response' -require 'onesignal/models/create_subscription_request_body' require 'onesignal/models/create_user_conflict_response' require 'onesignal/models/create_user_conflict_response_errors_inner' require 'onesignal/models/create_user_conflict_response_errors_items_meta' -require 'onesignal/models/delete_player_not_found_response' -require 'onesignal/models/delete_player_success_response' -require 'onesignal/models/delete_segment_not_found_response' -require 'onesignal/models/delete_segment_success_response' require 'onesignal/models/delivery_data' require 'onesignal/models/export_events_success_response' -require 'onesignal/models/export_players_request_body' -require 'onesignal/models/export_players_success_response' +require 'onesignal/models/export_subscriptions_request_body' +require 'onesignal/models/export_subscriptions_success_response' require 'onesignal/models/filter' -require 'onesignal/models/filter_expressions' +require 'onesignal/models/filter_expression' require 'onesignal/models/generic_error' -require 'onesignal/models/generic_error_errors_inner' -require 'onesignal/models/get_notification_request_body' -require 'onesignal/models/inline_response200' -require 'onesignal/models/inline_response2003' -require 'onesignal/models/inline_response201' -require 'onesignal/models/inline_response202' -require 'onesignal/models/invalid_identifier_error' +require 'onesignal/models/generic_success_bool_response' +require 'onesignal/models/get_notification_history_request_body' +require 'onesignal/models/get_segments_success_response' +require 'onesignal/models/language_string_map' require 'onesignal/models/notification' -require 'onesignal/models/notification200_errors' require 'onesignal/models/notification_all_of' require 'onesignal/models/notification_history_success_response' require 'onesignal/models/notification_slice' @@ -64,30 +52,24 @@ require 'onesignal/models/platform_delivery_data' require 'onesignal/models/platform_delivery_data_email_all_of' require 'onesignal/models/platform_delivery_data_sms_all_of' -require 'onesignal/models/player' -require 'onesignal/models/player_notification_target' -require 'onesignal/models/player_notification_target_include_aliases' -require 'onesignal/models/player_slice' +require 'onesignal/models/properties_body' require 'onesignal/models/properties_deltas' require 'onesignal/models/properties_object' require 'onesignal/models/purchase' -require 'onesignal/models/rate_limiter_error' +require 'onesignal/models/rate_limit_error' require 'onesignal/models/segment' +require 'onesignal/models/segment_data' require 'onesignal/models/segment_notification_target' -require 'onesignal/models/string_map' -require 'onesignal/models/subscription_object' +require 'onesignal/models/subscription' +require 'onesignal/models/subscription_body' +require 'onesignal/models/subscription_notification_target' require 'onesignal/models/transfer_subscription_request_body' require 'onesignal/models/update_live_activity_request' require 'onesignal/models/update_live_activity_success_response' -require 'onesignal/models/update_player_success_response' -require 'onesignal/models/update_player_tags_request_body' -require 'onesignal/models/update_player_tags_success_response' -require 'onesignal/models/update_subscription_request_body' require 'onesignal/models/update_user_request' require 'onesignal/models/user' -require 'onesignal/models/user_identity_request_body' -require 'onesignal/models/user_identity_response' -require 'onesignal/models/user_subscription_options' +require 'onesignal/models/user_identity_body' +require 'onesignal/models/web_button' # APIs require 'onesignal/api/default_api' diff --git a/lib/onesignal/api/default_api.rb b/lib/onesignal/api/default_api.rb index 0476125..a080953 100644 --- a/lib/onesignal/api/default_api.rb +++ b/lib/onesignal/api/default_api.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -19,71 +19,61 @@ class DefaultApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Start Live Activity - # Starts a Live Activity - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param activity_id [String] Live Activity record ID - # @param begin_live_activity_request [BeginLiveActivityRequest] + # Stop a scheduled or currently outgoing notification + # Used to stop a scheduled or currently outgoing notification + # @param app_id [String] + # @param notification_id [String] # @param [Hash] opts the optional parameters - # @return [nil] - def begin_live_activity(app_id, activity_id, begin_live_activity_request, opts = {}) - begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts) - nil + # @return [GenericSuccessBoolResponse] + def cancel_notification(app_id, notification_id, opts = {}) + data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts) + data end - # Start Live Activity - # Starts a Live Activity - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param activity_id [String] Live Activity record ID - # @param begin_live_activity_request [BeginLiveActivityRequest] + # Stop a scheduled or currently outgoing notification + # Used to stop a scheduled or currently outgoing notification + # @param app_id [String] + # @param notification_id [String] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts = {}) + # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers + def cancel_notification_with_http_info(app_id, notification_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.begin_live_activity ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.begin_live_activity" - end - # verify the required parameter 'activity_id' is set - if @api_client.config.client_side_validation && activity_id.nil? - fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.begin_live_activity" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.cancel_notification" end - # verify the required parameter 'begin_live_activity_request' is set - if @api_client.config.client_side_validation && begin_live_activity_request.nil? - fail ArgumentError, "Missing the required parameter 'begin_live_activity_request' when calling DefaultApi.begin_live_activity" + # verify the required parameter 'notification_id' is set + if @api_client.config.client_side_validation && notification_id.nil? + fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.cancel_notification" end # resource path - local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s)) + local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'app_id'] = app_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(begin_live_activity_request) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'GenericSuccessBoolResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.begin_live_activity", + :operation => :"DefaultApi.cancel_notification", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -92,68 +82,82 @@ def begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#begin_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#cancel_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Stop a scheduled or currently outgoing notification - # Used to stop a scheduled or currently outgoing notification + # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). # @param app_id [String] - # @param notification_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param user_identity_body [UserIdentityBody] # @param [Hash] opts the optional parameters - # @return [CancelNotificationSuccessResponse] - def cancel_notification(app_id, notification_id, opts = {}) - data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts) + # @return [UserIdentityBody] + def create_alias(app_id, alias_label, alias_id, user_identity_body, opts = {}) + data, _status_code, _headers = create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body, opts) data end - # Stop a scheduled or currently outgoing notification - # Used to stop a scheduled or currently outgoing notification + # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). # @param app_id [String] - # @param notification_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param user_identity_body [UserIdentityBody] # @param [Hash] opts the optional parameters - # @return [Array<(CancelNotificationSuccessResponse, Integer, Hash)>] CancelNotificationSuccessResponse data, response status code and response headers - def cancel_notification_with_http_info(app_id, notification_id, opts = {}) + # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers + def create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_alias ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.cancel_notification" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_alias" end - # verify the required parameter 'notification_id' is set - if @api_client.config.client_side_validation && notification_id.nil? - fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.cancel_notification" + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.create_alias" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_alias" + end + # verify the required parameter 'user_identity_body' is set + if @api_client.config.client_side_validation && user_identity_body.nil? + fail ArgumentError, "Missing the required parameter 'user_identity_body' when calling DefaultApi.create_alias" end # resource path - local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_body) # return_type - return_type = opts[:debug_return_type] || 'CancelNotificationSuccessResponse' + return_type = opts[:debug_return_type] || 'UserIdentityBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.cancel_notification", + :operation => :"DefaultApi.create_alias", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -162,38 +166,48 @@ def cancel_notification_with_http_info(app_id, notification_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#cancel_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create an app - # Creates a new OneSignal app - # @param app [App] + # Upserts one or more Aliases for the User identified by :subscription_id. + # @param app_id [String] + # @param subscription_id [String] + # @param user_identity_body [UserIdentityBody] # @param [Hash] opts the optional parameters - # @return [App] - def create_app(app, opts = {}) - data, _status_code, _headers = create_app_with_http_info(app, opts) + # @return [UserIdentityBody] + def create_alias_by_subscription(app_id, subscription_id, user_identity_body, opts = {}) + data, _status_code, _headers = create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body, opts) data end - # Create an app - # Creates a new OneSignal app - # @param app [App] + # Upserts one or more Aliases for the User identified by :subscription_id. + # @param app_id [String] + # @param subscription_id [String] + # @param user_identity_body [UserIdentityBody] # @param [Hash] opts the optional parameters - # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers - def create_app_with_http_info(app, opts = {}) + # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers + def create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.create_app ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_alias_by_subscription ...' end - # verify the required parameter 'app' is set - if @api_client.config.client_side_validation && app.nil? - fail ArgumentError, "Missing the required parameter 'app' when calling DefaultApi.create_app" + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_alias_by_subscription" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.create_alias_by_subscription" + end + # verify the required parameter 'user_identity_body' is set + if @api_client.config.client_side_validation && user_identity_body.nil? + fail ArgumentError, "Missing the required parameter 'user_identity_body' when calling DefaultApi.create_alias_by_subscription" end # resource path - local_var_path = '/apps' + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -212,16 +226,16 @@ def create_app_with_http_info(app, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(app) + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_body) # return_type - return_type = opts[:debug_return_type] || 'App' + return_type = opts[:debug_return_type] || 'UserIdentityBody' # auth_names - auth_names = opts[:debug_auth_names] || ['user_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.create_app", + :operation => :"DefaultApi.create_alias_by_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -230,38 +244,38 @@ def create_app_with_http_info(app, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#create_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_alias_by_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create notification - # Sends notifications to your users - # @param notification [Notification] + # Create an app + # Creates a new OneSignal app + # @param app [App] # @param [Hash] opts the optional parameters - # @return [CreateNotificationSuccessResponse] - def create_notification(notification, opts = {}) - data, _status_code, _headers = create_notification_with_http_info(notification, opts) + # @return [App] + def create_app(app, opts = {}) + data, _status_code, _headers = create_app_with_http_info(app, opts) data end - # Create notification - # Sends notifications to your users - # @param notification [Notification] + # Create an app + # Creates a new OneSignal app + # @param app [App] # @param [Hash] opts the optional parameters - # @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers - def create_notification_with_http_info(notification, opts = {}) + # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers + def create_app_with_http_info(app, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_app ...' end - # verify the required parameter 'notification' is set - if @api_client.config.client_side_validation && notification.nil? - fail ArgumentError, "Missing the required parameter 'notification' when calling DefaultApi.create_notification" + # verify the required parameter 'app' is set + if @api_client.config.client_side_validation && app.nil? + fail ArgumentError, "Missing the required parameter 'app' when calling DefaultApi.create_app" end # resource path - local_var_path = '/notifications' + local_var_path = '/apps' # query parameters query_params = opts[:query_params] || {} @@ -280,16 +294,16 @@ def create_notification_with_http_info(notification, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(notification) + post_body = opts[:debug_body] || @api_client.object_to_http_body(app) # return_type - return_type = opts[:debug_return_type] || 'CreateNotificationSuccessResponse' + return_type = opts[:debug_return_type] || 'App' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['user_auth_key'] new_options = opts.merge( - :operation => :"DefaultApi.create_notification", + :operation => :"DefaultApi.create_app", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -300,36 +314,36 @@ def create_notification_with_http_info(notification, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#create_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Add a device - # Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. - # @param player [Player] + # Create notification + # Sends notifications to your users + # @param notification [Notification] # @param [Hash] opts the optional parameters - # @return [CreatePlayerSuccessResponse] - def create_player(player, opts = {}) - data, _status_code, _headers = create_player_with_http_info(player, opts) + # @return [CreateNotificationSuccessResponse] + def create_notification(notification, opts = {}) + data, _status_code, _headers = create_notification_with_http_info(notification, opts) data end - # Add a device - # Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. - # @param player [Player] + # Create notification + # Sends notifications to your users + # @param notification [Notification] # @param [Hash] opts the optional parameters - # @return [Array<(CreatePlayerSuccessResponse, Integer, Hash)>] CreatePlayerSuccessResponse data, response status code and response headers - def create_player_with_http_info(player, opts = {}) + # @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers + def create_notification_with_http_info(notification, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.create_player ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...' end - # verify the required parameter 'player' is set - if @api_client.config.client_side_validation && player.nil? - fail ArgumentError, "Missing the required parameter 'player' when calling DefaultApi.create_player" + # verify the required parameter 'notification' is set + if @api_client.config.client_side_validation && notification.nil? + fail ArgumentError, "Missing the required parameter 'notification' when calling DefaultApi.create_notification" end # resource path - local_var_path = '/players' + local_var_path = '/notifications' # query parameters query_params = opts[:query_params] || {} @@ -348,16 +362,16 @@ def create_player_with_http_info(player, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(player) + post_body = opts[:debug_body] || @api_client.object_to_http_body(notification) # return_type - return_type = opts[:debug_return_type] || 'CreatePlayerSuccessResponse' + return_type = opts[:debug_return_type] || 'CreateNotificationSuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.create_player", + :operation => :"DefaultApi.create_notification", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -368,35 +382,35 @@ def create_player_with_http_info(player, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#create_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Segments - # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + # Create Segment + # Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param [Hash] opts the optional parameters # @option opts [Segment] :segment # @return [CreateSegmentSuccessResponse] - def create_segments(app_id, opts = {}) - data, _status_code, _headers = create_segments_with_http_info(app_id, opts) + def create_segment(app_id, opts = {}) + data, _status_code, _headers = create_segment_with_http_info(app_id, opts) data end - # Create Segments - # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + # Create Segment + # Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param [Hash] opts the optional parameters # @option opts [Segment] :segment # @return [Array<(CreateSegmentSuccessResponse, Integer, Hash)>] CreateSegmentSuccessResponse data, response status code and response headers - def create_segments_with_http_info(app_id, opts = {}) + def create_segment_with_http_info(app_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.create_segments ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_segment ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_segments" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_segment" end # resource path local_var_path = '/apps/{app_id}/segments'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) @@ -424,10 +438,10 @@ def create_segments_with_http_info(app_id, opts = {}) return_type = opts[:debug_return_type] || 'CreateSegmentSuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.create_segments", + :operation => :"DefaultApi.create_segment", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -438,7 +452,7 @@ def create_segments_with_http_info(app_id, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#create_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -447,11 +461,11 @@ def create_segments_with_http_info(app_id, opts = {}) # @param app_id [String] # @param alias_label [String] # @param alias_id [String] - # @param create_subscription_request_body [CreateSubscriptionRequestBody] + # @param subscription_body [SubscriptionBody] # @param [Hash] opts the optional parameters - # @return [InlineResponse201] - def create_subscription(app_id, alias_label, alias_id, create_subscription_request_body, opts = {}) - data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts) + # @return [SubscriptionBody] + def create_subscription(app_id, alias_label, alias_id, subscription_body, opts = {}) + data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body, opts) data end @@ -459,10 +473,10 @@ def create_subscription(app_id, alias_label, alias_id, create_subscription_reque # @param app_id [String] # @param alias_label [String] # @param alias_id [String] - # @param create_subscription_request_body [CreateSubscriptionRequestBody] + # @param subscription_body [SubscriptionBody] # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers - def create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts = {}) + # @return [Array<(SubscriptionBody, Integer, Hash)>] SubscriptionBody data, response status code and response headers + def create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.create_subscription ...' end @@ -478,9 +492,9 @@ def create_subscription_with_http_info(app_id, alias_label, alias_id, create_sub if @api_client.config.client_side_validation && alias_id.nil? fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_subscription" end - # verify the required parameter 'create_subscription_request_body' is set - if @api_client.config.client_side_validation && create_subscription_request_body.nil? - fail ArgumentError, "Missing the required parameter 'create_subscription_request_body' when calling DefaultApi.create_subscription" + # verify the required parameter 'subscription_body' is set + if @api_client.config.client_side_validation && subscription_body.nil? + fail ArgumentError, "Missing the required parameter 'subscription_body' when calling DefaultApi.create_subscription" end # resource path local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) @@ -502,13 +516,13 @@ def create_subscription_with_http_info(app_id, alias_label, alias_id, create_sub form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(create_subscription_request_body) + post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_body) # return_type - return_type = opts[:debug_return_type] || 'InlineResponse201' + return_type = opts[:debug_return_type] || 'SubscriptionBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.create_subscription", @@ -580,7 +594,7 @@ def create_user_with_http_info(app_id, user, opts = {}) return_type = opts[:debug_return_type] || 'User' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.create_user", @@ -605,7 +619,7 @@ def create_user_with_http_info(app_id, user, opts = {}) # @param alias_id [String] # @param alias_label_to_delete [String] # @param [Hash] opts the optional parameters - # @return [InlineResponse200] + # @return [UserIdentityBody] def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {}) data, _status_code, _headers = delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts) data @@ -617,7 +631,7 @@ def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {} # @param alias_id [String] # @param alias_label_to_delete [String] # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers + # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...' @@ -656,10 +670,10 @@ def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_de post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InlineResponse200' + return_type = opts[:debug_return_type] || 'UserIdentityBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.delete_alias", @@ -678,104 +692,34 @@ def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_de return data, status_code, headers end - # Delete a user record - # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param player_id [String] The OneSignal player_id - # @param [Hash] opts the optional parameters - # @return [DeletePlayerSuccessResponse] - def delete_player(app_id, player_id, opts = {}) - data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts) - data - end - - # Delete a user record - # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param player_id [String] The OneSignal player_id - # @param [Hash] opts the optional parameters - # @return [Array<(DeletePlayerSuccessResponse, Integer, Hash)>] DeletePlayerSuccessResponse data, response status code and response headers - def delete_player_with_http_info(app_id, player_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player" - end - # verify the required parameter 'player_id' is set - if @api_client.config.client_side_validation && player_id.nil? - fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player" - end - # resource path - local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'DeletePlayerSuccessResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.delete_player", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete Segments - # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + # Delete Segment + # Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param [Hash] opts the optional parameters - # @return [DeleteSegmentSuccessResponse] - def delete_segments(app_id, segment_id, opts = {}) - data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts) + # @return [GenericSuccessBoolResponse] + def delete_segment(app_id, segment_id, opts = {}) + data, _status_code, _headers = delete_segment_with_http_info(app_id, segment_id, opts) data end - # Delete Segments - # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + # Delete Segment + # Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param [Hash] opts the optional parameters - # @return [Array<(DeleteSegmentSuccessResponse, Integer, Hash)>] DeleteSegmentSuccessResponse data, response status code and response headers - def delete_segments_with_http_info(app_id, segment_id, opts = {}) + # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers + def delete_segment_with_http_info(app_id, segment_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segment ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segment" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? - fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments" + fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segment" end # resource path local_var_path = '/apps/{app_id}/segments/{segment_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'segment_id' + '}', CGI.escape(segment_id.to_s)) @@ -795,13 +739,13 @@ def delete_segments_with_http_info(app_id, segment_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'DeleteSegmentSuccessResponse' + return_type = opts[:debug_return_type] || 'GenericSuccessBoolResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.delete_segments", + :operation => :"DefaultApi.delete_segment", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -812,7 +756,7 @@ def delete_segments_with_http_info(app_id, segment_id, opts = {}) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#delete_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -865,7 +809,7 @@ def delete_subscription_with_http_info(app_id, subscription_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.delete_subscription", @@ -938,7 +882,7 @@ def delete_user_with_http_info(app_id, alias_label, alias_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.delete_user", @@ -957,81 +901,6 @@ def delete_user_with_http_info(app_id, alias_label, alias_id, opts = {}) return data, status_code, headers end - # Stop Live Activity - # Stops a Live Activity - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param activity_id [String] Live Activity record ID - # @param subscription_id [String] Subscription ID - # @param [Hash] opts the optional parameters - # @return [nil] - def end_live_activity(app_id, activity_id, subscription_id, opts = {}) - end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts) - nil - end - - # Stop Live Activity - # Stops a Live Activity - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param activity_id [String] Live Activity record ID - # @param subscription_id [String] Subscription ID - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.end_live_activity ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.end_live_activity" - end - # verify the required parameter 'activity_id' is set - if @api_client.config.client_side_validation && activity_id.nil? - fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.end_live_activity" - end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.end_live_activity" - end - # resource path - local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.end_live_activity", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#end_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Export CSV of Events # Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. # @param notification_id [String] The ID of the notification to export events from. @@ -1083,7 +952,7 @@ def export_events_with_http_info(notification_id, app_id, opts = {}) return_type = opts[:debug_return_type] || 'ExportEventsSuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.export_events", @@ -1102,30 +971,30 @@ def export_events_with_http_info(notification_id, app_id, opts = {}) return data, status_code, headers end - # Export CSV of Players + # Export CSV of Subscriptions # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | # @param app_id [String] The app ID that you want to export devices from # @param [Hash] opts the optional parameters - # @option opts [ExportPlayersRequestBody] :export_players_request_body - # @return [ExportPlayersSuccessResponse] - def export_players(app_id, opts = {}) - data, _status_code, _headers = export_players_with_http_info(app_id, opts) + # @option opts [ExportSubscriptionsRequestBody] :export_subscriptions_request_body + # @return [ExportSubscriptionsSuccessResponse] + def export_subscriptions(app_id, opts = {}) + data, _status_code, _headers = export_subscriptions_with_http_info(app_id, opts) data end - # Export CSV of Players + # Export CSV of Subscriptions # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | # @param app_id [String] The app ID that you want to export devices from # @param [Hash] opts the optional parameters - # @option opts [ExportPlayersRequestBody] :export_players_request_body - # @return [Array<(ExportPlayersSuccessResponse, Integer, Hash)>] ExportPlayersSuccessResponse data, response status code and response headers - def export_players_with_http_info(app_id, opts = {}) + # @option opts [ExportSubscriptionsRequestBody] :export_subscriptions_request_body + # @return [Array<(ExportSubscriptionsSuccessResponse, Integer, Hash)>] ExportSubscriptionsSuccessResponse data, response status code and response headers + def export_subscriptions_with_http_info(app_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.export_subscriptions ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_subscriptions" end # resource path local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) @@ -1147,16 +1016,16 @@ def export_players_with_http_info(app_id, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body']) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_subscriptions_request_body']) # return_type - return_type = opts[:debug_return_type] || 'ExportPlayersSuccessResponse' + return_type = opts[:debug_return_type] || 'ExportSubscriptionsSuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.export_players", + :operation => :"DefaultApi.export_subscriptions", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1167,113 +1036,46 @@ def export_players_with_http_info(app_id, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Lists all Aliases for the User identified by :subscription_id. - # @param app_id [String] - # @param subscription_id [String] - # @param [Hash] opts the optional parameters - # @return [UserIdentityResponse] - def fetch_aliases(app_id, subscription_id, opts = {}) - data, _status_code, _headers = fetch_aliases_with_http_info(app_id, subscription_id, opts) - data - end - - # Lists all Aliases for the User identified by :subscription_id. - # @param app_id [String] - # @param subscription_id [String] - # @param [Hash] opts the optional parameters - # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers - def fetch_aliases_with_http_info(app_id, subscription_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_aliases ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_aliases" - end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.fetch_aliases" - end - # resource path - local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'UserIdentityResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.fetch_aliases", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#fetch_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#export_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Returns the User’s properties, Aliases, and Subscriptions. + # Lists all Aliases for the User identified by (:alias_label, :alias_id). # @param app_id [String] # @param alias_label [String] # @param alias_id [String] # @param [Hash] opts the optional parameters - # @return [User] - def fetch_user(app_id, alias_label, alias_id, opts = {}) - data, _status_code, _headers = fetch_user_with_http_info(app_id, alias_label, alias_id, opts) + # @return [UserIdentityBody] + def get_aliases(app_id, alias_label, alias_id, opts = {}) + data, _status_code, _headers = get_aliases_with_http_info(app_id, alias_label, alias_id, opts) data end - # Returns the User’s properties, Aliases, and Subscriptions. + # Lists all Aliases for the User identified by (:alias_label, :alias_id). # @param app_id [String] # @param alias_label [String] # @param alias_id [String] # @param [Hash] opts the optional parameters - # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers - def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {}) + # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers + def get_aliases_with_http_info(app_id, alias_label, alias_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.get_aliases ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_aliases" end # verify the required parameter 'alias_label' is set if @api_client.config.client_side_validation && alias_label.nil? - fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user" + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.get_aliases" end # verify the required parameter 'alias_id' is set if @api_client.config.client_side_validation && alias_id.nil? - fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user" + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.get_aliases" end # resource path - local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1290,13 +1092,13 @@ def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'User' + return_type = opts[:debug_return_type] || 'UserIdentityBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.fetch_user", + :operation => :"DefaultApi.get_aliases", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1307,46 +1109,40 @@ def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#fetch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Lists all Aliases for the User identified by (:alias_label, :alias_id). + # Lists all Aliases for the User identified by :subscription_id. # @param app_id [String] - # @param alias_label [String] - # @param alias_id [String] + # @param subscription_id [String] # @param [Hash] opts the optional parameters - # @return [InlineResponse200] - def fetch_user_identity(app_id, alias_label, alias_id, opts = {}) - data, _status_code, _headers = fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts) + # @return [UserIdentityBody] + def get_aliases_by_subscription(app_id, subscription_id, opts = {}) + data, _status_code, _headers = get_aliases_by_subscription_with_http_info(app_id, subscription_id, opts) data end - # Lists all Aliases for the User identified by (:alias_label, :alias_id). + # Lists all Aliases for the User identified by :subscription_id. # @param app_id [String] - # @param alias_label [String] - # @param alias_id [String] + # @param subscription_id [String] # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers - def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {}) + # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers + def get_aliases_by_subscription_with_http_info(app_id, subscription_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user_identity ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.get_aliases_by_subscription ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user_identity" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_aliases_by_subscription" end - # verify the required parameter 'alias_label' is set - if @api_client.config.client_side_validation && alias_label.nil? - fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user_identity" - end - # verify the required parameter 'alias_id' is set - if @api_client.config.client_side_validation && alias_id.nil? - fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user_identity" + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_aliases_by_subscription" end # resource path - local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1363,13 +1159,13 @@ def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InlineResponse200' + return_type = opts[:debug_return_type] || 'UserIdentityBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.fetch_user_identity", + :operation => :"DefaultApi.get_aliases_by_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1380,7 +1176,7 @@ def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#fetch_user_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_aliases_by_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -1409,64 +1205,7 @@ def get_app_with_http_info(app_id, opts = {}) fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app" end # resource path - local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'App' - - # auth_names - auth_names = opts[:debug_auth_names] || ['user_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.get_app", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # View apps - # View the details of all of your current OneSignal apps - # @param [Hash] opts the optional parameters - # @return [Array] - def get_apps(opts = {}) - data, _status_code, _headers = get_apps_with_http_info(opts) - data - end - - # View apps - # View the details of all of your current OneSignal apps - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def get_apps_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...' - end - # resource path - local_var_path = '/apps' + local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1483,13 +1222,13 @@ def get_apps_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Array' + return_type = opts[:debug_return_type] || 'App' # auth_names - auth_names = opts[:debug_auth_names] || ['user_key'] + auth_names = opts[:debug_auth_names] || ['user_auth_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_apps", + :operation => :"DefaultApi.get_app", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1500,40 +1239,30 @@ def get_apps_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Manifest of In-App Messages the Subscription is eligible to display by the SDK. - # @param app_id [String] - # @param subscription_id [String] + # View apps + # View the details of all of your current OneSignal apps # @param [Hash] opts the optional parameters - # @return [InlineResponse2003] - def get_eligible_iams(app_id, subscription_id, opts = {}) - data, _status_code, _headers = get_eligible_iams_with_http_info(app_id, subscription_id, opts) + # @return [Array] + def get_apps(opts = {}) + data, _status_code, _headers = get_apps_with_http_info(opts) data end - # Manifest of In-App Messages the Subscription is eligible to display by the SDK. - # @param app_id [String] - # @param subscription_id [String] + # View apps + # View the details of all of your current OneSignal apps # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers - def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {}) + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def get_apps_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_eligible_iams ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_eligible_iams" - end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_eligible_iams" + @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...' end # resource path - local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/iams'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + local_var_path = '/apps' # query parameters query_params = opts[:query_params] || {} @@ -1550,13 +1279,13 @@ def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InlineResponse2003' + return_type = opts[:debug_return_type] || 'Array' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['user_auth_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_eligible_iams", + :operation => :"DefaultApi.get_apps", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1567,7 +1296,7 @@ def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_eligible_iams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -1623,7 +1352,7 @@ def get_notification_with_http_info(app_id, notification_id, opts = {}) return_type = opts[:debug_return_type] || 'NotificationWithMeta' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.get_notification", @@ -1645,21 +1374,21 @@ def get_notification_with_http_info(app_id, notification_id, opts = {}) # Notification History # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. # @param notification_id [String] The \"id\" of the message found in the Notification object - # @param get_notification_request_body [GetNotificationRequestBody] + # @param get_notification_history_request_body [GetNotificationHistoryRequestBody] # @param [Hash] opts the optional parameters # @return [NotificationHistorySuccessResponse] - def get_notification_history(notification_id, get_notification_request_body, opts = {}) - data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_request_body, opts) + def get_notification_history(notification_id, get_notification_history_request_body, opts = {}) + data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_history_request_body, opts) data end # Notification History # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. # @param notification_id [String] The \"id\" of the message found in the Notification object - # @param get_notification_request_body [GetNotificationRequestBody] + # @param get_notification_history_request_body [GetNotificationHistoryRequestBody] # @param [Hash] opts the optional parameters # @return [Array<(NotificationHistorySuccessResponse, Integer, Hash)>] NotificationHistorySuccessResponse data, response status code and response headers - def get_notification_history_with_http_info(notification_id, get_notification_request_body, opts = {}) + def get_notification_history_with_http_info(notification_id, get_notification_history_request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification_history ...' end @@ -1667,9 +1396,9 @@ def get_notification_history_with_http_info(notification_id, get_notification_re if @api_client.config.client_side_validation && notification_id.nil? fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification_history" end - # verify the required parameter 'get_notification_request_body' is set - if @api_client.config.client_side_validation && get_notification_request_body.nil? - fail ArgumentError, "Missing the required parameter 'get_notification_request_body' when calling DefaultApi.get_notification_history" + # verify the required parameter 'get_notification_history_request_body' is set + if @api_client.config.client_side_validation && get_notification_history_request_body.nil? + fail ArgumentError, "Missing the required parameter 'get_notification_history_request_body' when calling DefaultApi.get_notification_history" end # resource path local_var_path = '/notifications/{notification_id}/history'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s)) @@ -1691,13 +1420,13 @@ def get_notification_history_with_http_info(notification_id, get_notification_re form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(get_notification_request_body) + post_body = opts[:debug_body] || @api_client.object_to_http_body(get_notification_history_request_body) # return_type return_type = opts[:debug_return_type] || 'NotificationHistorySuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.get_notification_history", @@ -1774,7 +1503,7 @@ def get_notifications_with_http_info(app_id, opts = {}) return_type = opts[:debug_return_type] || 'NotificationSlice' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.get_notifications", @@ -1856,7 +1585,7 @@ def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) return_type = opts[:debug_return_type] || 'OutcomesData' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.get_outcomes", @@ -1875,114 +1604,40 @@ def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) return data, status_code, headers end - # View device - # View the details of an existing device in one of your OneSignal apps - # @param app_id [String] Your app_id for this device - # @param player_id [String] Player's OneSignal ID - # @param [Hash] opts the optional parameters - # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). - # @return [Player] - def get_player(app_id, player_id, opts = {}) - data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts) - data - end - - # View device - # View the details of an existing device in one of your OneSignal apps - # @param app_id [String] Your app_id for this device - # @param player_id [String] Player's OneSignal ID - # @param [Hash] opts the optional parameters - # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). - # @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers - def get_player_with_http_info(app_id, player_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player" - end - # verify the required parameter 'player_id' is set - if @api_client.config.client_side_validation && player_id.nil? - fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player" - end - # resource path - local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id - query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Player' - - # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.get_player", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # View devices - # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - # @param app_id [String] The app ID that you want to view players from + # Get Segments + # Returns an array of segments from an app. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 - # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; - # @return [PlayerSlice] - def get_players(app_id, opts = {}) - data, _status_code, _headers = get_players_with_http_info(app_id, opts) + # @option opts [Integer] :offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. + # @option opts [Integer] :limit The amount of Segments in the response. Maximum 300. + # @return [GetSegmentsSuccessResponse] + def get_segments(app_id, opts = {}) + data, _status_code, _headers = get_segments_with_http_info(app_id, opts) data end - # View devices - # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - # @param app_id [String] The app ID that you want to view players from + # Get Segments + # Returns an array of segments from an app. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 - # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; - # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers - def get_players_with_http_info(app_id, opts = {}) + # @option opts [Integer] :offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. + # @option opts [Integer] :limit The amount of Segments in the response. Maximum 300. + # @return [Array<(GetSegmentsSuccessResponse, Integer, Hash)>] GetSegmentsSuccessResponse data, response status code and response headers + def get_segments_with_http_info(app_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.get_segments ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_segments" end # resource path - local_var_path = '/players' + local_var_path = '/apps/{app_id}/segments'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} @@ -1996,13 +1651,13 @@ def get_players_with_http_info(app_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'PlayerSlice' + return_type = opts[:debug_return_type] || 'GetSegmentsSuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_players", + :operation => :"DefaultApi.get_segments", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2013,52 +1668,46 @@ def get_players_with_http_info(app_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + # Returns the User’s properties, Aliases, and Subscriptions. # @param app_id [String] # @param alias_label [String] # @param alias_id [String] - # @param user_identity_request_body [UserIdentityRequestBody] # @param [Hash] opts the optional parameters - # @return [InlineResponse200] - def identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body, opts = {}) - data, _status_code, _headers = identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts) + # @return [User] + def get_user(app_id, alias_label, alias_id, opts = {}) + data, _status_code, _headers = get_user_with_http_info(app_id, alias_label, alias_id, opts) data end - # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + # Returns the User’s properties, Aliases, and Subscriptions. # @param app_id [String] # @param alias_label [String] # @param alias_id [String] - # @param user_identity_request_body [UserIdentityRequestBody] # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers - def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts = {}) + # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers + def get_user_with_http_info(app_id, alias_label, alias_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_alias ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.get_user ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_alias" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_user" end # verify the required parameter 'alias_label' is set if @api_client.config.client_side_validation && alias_label.nil? - fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.identify_user_by_alias" + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.get_user" end # verify the required parameter 'alias_id' is set if @api_client.config.client_side_validation && alias_id.nil? - fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.identify_user_by_alias" - end - # verify the required parameter 'user_identity_request_body' is set - if @api_client.config.client_side_validation && user_identity_request_body.nil? - fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_alias" + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.get_user" end # resource path - local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2067,26 +1716,21 @@ def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_id header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InlineResponse200' + return_type = opts[:debug_return_type] || 'User' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.identify_user_by_alias", + :operation => :"DefaultApi.get_user", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2095,48 +1739,48 @@ def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_id :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Upserts one or more Aliases for the User identified by :subscription_id. + # Transfers this Subscription to the User identified by the identity in the payload. # @param app_id [String] # @param subscription_id [String] - # @param user_identity_request_body [UserIdentityRequestBody] + # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] # @param [Hash] opts the optional parameters - # @return [UserIdentityResponse] - def identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body, opts = {}) - data, _status_code, _headers = identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts) + # @return [UserIdentityBody] + def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {}) + data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts) data end - # Upserts one or more Aliases for the User identified by :subscription_id. + # Transfers this Subscription to the User identified by the identity in the payload. # @param app_id [String] # @param subscription_id [String] - # @param user_identity_request_body [UserIdentityRequestBody] + # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] # @param [Hash] opts the optional parameters - # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers - def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts = {}) + # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers + def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_subscription_id" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription" end # verify the required parameter 'subscription_id' is set if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.identify_user_by_subscription_id" + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription" end - # verify the required parameter 'user_identity_request_body' is set - if @api_client.config.client_side_validation && user_identity_request_body.nil? - fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_subscription_id" + # verify the required parameter 'transfer_subscription_request_body' is set + if @api_client.config.client_side_validation && transfer_subscription_request_body.nil? + fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription" end # resource path - local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/owner'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2155,16 +1799,16 @@ def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, use form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body) + post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body) # return_type - return_type = opts[:debug_return_type] || 'UserIdentityResponse' + return_type = opts[:debug_return_type] || 'UserIdentityBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.identify_user_by_subscription_id", + :operation => :"DefaultApi.transfer_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2175,74 +1819,72 @@ def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, use data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_subscription_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Transfers this Subscription to the User identified by the identity in the payload. - # @param app_id [String] - # @param subscription_id [String] - # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] + # Unsubscribe with token + # Unsubscribe an email with a token when using your own custom email unsubscribe landing page + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param notification_id [String] The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. + # @param token [String] The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. # @param [Hash] opts the optional parameters - # @return [UserIdentityResponse] - def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {}) - data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts) + # @return [GenericSuccessBoolResponse] + def unsubscribe_email_with_token(app_id, notification_id, token, opts = {}) + data, _status_code, _headers = unsubscribe_email_with_token_with_http_info(app_id, notification_id, token, opts) data end - # Transfers this Subscription to the User identified by the identity in the payload. - # @param app_id [String] - # @param subscription_id [String] - # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] + # Unsubscribe with token + # Unsubscribe an email with a token when using your own custom email unsubscribe landing page + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param notification_id [String] The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. + # @param token [String] The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. # @param [Hash] opts the optional parameters - # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers - def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {}) + # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers + def unsubscribe_email_with_token_with_http_info(app_id, notification_id, token, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.unsubscribe_email_with_token ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.unsubscribe_email_with_token" end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription" + # verify the required parameter 'notification_id' is set + if @api_client.config.client_side_validation && notification_id.nil? + fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.unsubscribe_email_with_token" end - # verify the required parameter 'transfer_subscription_request_body' is set - if @api_client.config.client_side_validation && transfer_subscription_request_body.nil? - fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription" + # verify the required parameter 'token' is set + if @api_client.config.client_side_validation && token.nil? + fail ArgumentError, "Missing the required parameter 'token' when calling DefaultApi.unsubscribe_email_with_token" end # resource path - local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/owner'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + local_var_path = '/apps/{app_id}/notifications/{notification_id}/unsubscribe'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'token'] = token # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'UserIdentityResponse' + return_type = opts[:debug_return_type] || 'GenericSuccessBoolResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( - :operation => :"DefaultApi.transfer_subscription", + :operation => :"DefaultApi.unsubscribe_email_with_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2251,9 +1893,9 @@ def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subsc :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#unsubscribe_email_with_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -2313,7 +1955,7 @@ def update_app_with_http_info(app_id, app, opts = {}) return_type = opts[:debug_return_type] || 'App' # auth_names - auth_names = opts[:debug_auth_names] || ['user_key'] + auth_names = opts[:debug_auth_names] || ['user_auth_key'] new_options = opts.merge( :operation => :"DefaultApi.update_app", @@ -2393,7 +2035,7 @@ def update_live_activity_with_http_info(app_id, activity_id, update_live_activit return_type = opts[:debug_return_type] || 'UpdateLiveActivitySuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.update_live_activity", @@ -2412,174 +2054,24 @@ def update_live_activity_with_http_info(app_id, activity_id, update_live_activit return data, status_code, headers end - # Edit device - # Update an existing device in one of your OneSignal apps - # @param player_id [String] Player's OneSignal ID - # @param player [Player] - # @param [Hash] opts the optional parameters - # @return [UpdatePlayerSuccessResponse] - def update_player(player_id, player, opts = {}) - data, _status_code, _headers = update_player_with_http_info(player_id, player, opts) - data - end - - # Edit device - # Update an existing device in one of your OneSignal apps - # @param player_id [String] Player's OneSignal ID - # @param player [Player] - # @param [Hash] opts the optional parameters - # @return [Array<(UpdatePlayerSuccessResponse, Integer, Hash)>] UpdatePlayerSuccessResponse data, response status code and response headers - def update_player_with_http_info(player_id, player, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.update_player ...' - end - # verify the required parameter 'player_id' is set - if @api_client.config.client_side_validation && player_id.nil? - fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.update_player" - end - # verify the required parameter 'player' is set - if @api_client.config.client_side_validation && player.nil? - fail ArgumentError, "Missing the required parameter 'player' when calling DefaultApi.update_player" - end - # resource path - local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(player) - - # return_type - return_type = opts[:debug_return_type] || 'UpdatePlayerSuccessResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.update_player", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#update_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Edit tags with external user id - # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - # @param app_id [String] The OneSignal App ID the user record is found under. - # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. - # @param [Hash] opts the optional parameters - # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body - # @return [UpdatePlayerTagsSuccessResponse] - def update_player_tags(app_id, external_user_id, opts = {}) - data, _status_code, _headers = update_player_tags_with_http_info(app_id, external_user_id, opts) - data - end - - # Edit tags with external user id - # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } - # @param app_id [String] The OneSignal App ID the user record is found under. - # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. - # @param [Hash] opts the optional parameters - # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body - # @return [Array<(UpdatePlayerTagsSuccessResponse, Integer, Hash)>] UpdatePlayerTagsSuccessResponse data, response status code and response headers - def update_player_tags_with_http_info(app_id, external_user_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_player_tags" - end - # verify the required parameter 'external_user_id' is set - if @api_client.config.client_side_validation && external_user_id.nil? - fail ArgumentError, "Missing the required parameter 'external_user_id' when calling DefaultApi.update_player_tags" - end - # resource path - local_var_path = '/apps/{app_id}/users/{external_user_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'external_user_id' + '}', CGI.escape(external_user_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_player_tags_request_body']) - - # return_type - return_type = opts[:debug_return_type] || 'UpdatePlayerTagsSuccessResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] - - new_options = opts.merge( - :operation => :"DefaultApi.update_player_tags", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#update_player_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Updates an existing Subscription’s properties. # @param app_id [String] # @param subscription_id [String] - # @param update_subscription_request_body [UpdateSubscriptionRequestBody] + # @param subscription_body [SubscriptionBody] # @param [Hash] opts the optional parameters # @return [nil] - def update_subscription(app_id, subscription_id, update_subscription_request_body, opts = {}) - update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts) + def update_subscription(app_id, subscription_id, subscription_body, opts = {}) + update_subscription_with_http_info(app_id, subscription_id, subscription_body, opts) nil end # Updates an existing Subscription’s properties. # @param app_id [String] # @param subscription_id [String] - # @param update_subscription_request_body [UpdateSubscriptionRequestBody] + # @param subscription_body [SubscriptionBody] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts = {}) + def update_subscription_with_http_info(app_id, subscription_id, subscription_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...' end @@ -2591,9 +2083,9 @@ def update_subscription_with_http_info(app_id, subscription_id, update_subscript if @api_client.config.client_side_validation && subscription_id.nil? fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.update_subscription" end - # verify the required parameter 'update_subscription_request_body' is set - if @api_client.config.client_side_validation && update_subscription_request_body.nil? - fail ArgumentError, "Missing the required parameter 'update_subscription_request_body' when calling DefaultApi.update_subscription" + # verify the required parameter 'subscription_body' is set + if @api_client.config.client_side_validation && subscription_body.nil? + fail ArgumentError, "Missing the required parameter 'subscription_body' when calling DefaultApi.update_subscription" end # resource path local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) @@ -2615,13 +2107,13 @@ def update_subscription_with_http_info(app_id, subscription_id, update_subscript form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(update_subscription_request_body) + post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_body) # return_type return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.update_subscription", @@ -2646,7 +2138,7 @@ def update_subscription_with_http_info(app_id, subscription_id, update_subscript # @param alias_id [String] # @param update_user_request [UpdateUserRequest] # @param [Hash] opts the optional parameters - # @return [InlineResponse202] + # @return [PropertiesBody] def update_user(app_id, alias_label, alias_id, update_user_request, opts = {}) data, _status_code, _headers = update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts) data @@ -2658,7 +2150,7 @@ def update_user(app_id, alias_label, alias_id, update_user_request, opts = {}) # @param alias_id [String] # @param update_user_request [UpdateUserRequest] # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse202, Integer, Hash)>] InlineResponse202 data, response status code and response headers + # @return [Array<(PropertiesBody, Integer, Hash)>] PropertiesBody data, response status code and response headers def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.update_user ...' @@ -2702,10 +2194,10 @@ def update_user_with_http_info(app_id, alias_label, alias_id, update_user_reques post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request) # return_type - return_type = opts[:debug_return_type] || 'InlineResponse202' + return_type = opts[:debug_return_type] || 'PropertiesBody' # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || ['rest_api_key'] new_options = opts.merge( :operation => :"DefaultApi.update_user", diff --git a/lib/onesignal/api_client.rb b/lib/onesignal/api_client.rb index 57e1159..ed733fc 100644 --- a/lib/onesignal/api_client.rb +++ b/lib/onesignal/api_client.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -90,7 +90,7 @@ def build_request(http_method, path, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase - opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=2.2.0' + opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.0.0-beta1' header_params = @default_headers.merge(opts[:header_params] || {}) query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} diff --git a/lib/onesignal/api_error.rb b/lib/onesignal/api_error.rb index fcd948b..53e05b1 100644 --- a/lib/onesignal/api_error.rb +++ b/lib/onesignal/api_error.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/configuration.rb b/lib/onesignal/configuration.rb index 0da81ff..b04651e 100644 --- a/lib/onesignal/configuration.rb +++ b/lib/onesignal/configuration.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -175,19 +175,19 @@ def base_url(operation = nil) # Returns Auth Settings hash for api client. def auth_settings { - 'app_key' => + 'rest_api_key' => { type: 'bearer', in: 'header', key: 'Authorization', - value: "Key token=\"#{ app_key }\"" + value: "Key token=\"#{ rest_api_key }\"" }, - 'user_key' => + 'user_auth_key' => { type: 'bearer', in: 'header', key: 'Authorization', - value: "Key token=\"#{ user_key }\"" + value: "Key token=\"#{ user_auth_key }\"" }, } end diff --git a/lib/onesignal/models/app.rb b/lib/onesignal/models/app.rb index 7bb7e2f..88d31db 100644 --- a/lib/onesignal/models/app.rb +++ b/lib/onesignal/models/app.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/basic_notification.rb b/lib/onesignal/models/basic_notification.rb index 261641b..ebdd076 100644 --- a/lib/onesignal/models/basic_notification.rb +++ b/lib/onesignal/models/basic_notification.rb @@ -3,7 +3,7 @@ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -The version of the OpenAPI document: 1.4.0 +The version of the OpenAPI document: 5.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -21,11 +21,8 @@ class BasicNotification # Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] attr_accessor :excluded_segments - # Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call - attr_accessor :include_player_ids - - # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. - attr_accessor :include_external_user_ids + # Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call + attr_accessor :include_subscription_ids # Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call attr_accessor :include_email_tokens @@ -33,24 +30,25 @@ class BasicNotification # Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call attr_accessor :include_phone_numbers - # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call + # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call attr_accessor :include_ios_tokens - # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call + # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call attr_accessor :include_wp_wns_uris - # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call + # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call attr_accessor :include_amazon_reg_ids - # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call + # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_chrome_reg_ids - # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call + # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_chrome_web_reg_ids - # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call + # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_android_reg_ids + # Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. attr_accessor :include_aliases attr_accessor :target_channel @@ -94,9 +92,6 @@ class BasicNotification # This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. attr_accessor :is_chrome - # Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. - attr_accessor :channel_for_external_user_ids - # Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. attr_accessor :app_id @@ -297,6 +292,12 @@ class BasicNotification # Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" attr_accessor :summary_arg_count + # Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. + attr_accessor :ios_relevance_score + + # Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. + attr_accessor :ios_interruption_level + # Channel: Email Required. The subject of the email. attr_accessor :email_subject @@ -353,8 +354,7 @@ def self.attribute_map { :'included_segments' => :'included_segments', :'excluded_segments' => :'excluded_segments', - :'include_player_ids' => :'include_player_ids', - :'include_external_user_ids' => :'include_external_user_ids', + :'include_subscription_ids' => :'include_subscription_ids', :'include_email_tokens' => :'include_email_tokens', :'include_phone_numbers' => :'include_phone_numbers', :'include_ios_tokens' => :'include_ios_tokens', @@ -379,7 +379,6 @@ def self.attribute_map :'is_wp_wns' => :'isWP_WNS', :'is_adm' => :'isAdm', :'is_chrome' => :'isChrome', - :'channel_for_external_user_ids' => :'channel_for_external_user_ids', :'app_id' => :'app_id', :'external_id' => :'external_id', :'idempotency_key' => :'idempotency_key', @@ -448,6 +447,8 @@ def self.attribute_map :'thread_id' => :'thread_id', :'summary_arg' => :'summary_arg', :'summary_arg_count' => :'summary_arg_count', + :'ios_relevance_score' => :'ios_relevance_score', + :'ios_interruption_level' => :'ios_interruption_level', :'email_subject' => :'email_subject', :'email_body' => :'email_body', :'email_from_name' => :'email_from_name', @@ -471,8 +472,7 @@ def self.openapi_types { :'included_segments' => :'Array', :'excluded_segments' => :'Array', - :'include_player_ids' => :'Array', - :'include_external_user_ids' => :'Array', + :'include_subscription_ids' => :'Array', :'include_email_tokens' => :'Array', :'include_phone_numbers' => :'Array', :'include_ios_tokens' => :'Array', @@ -481,7 +481,7 @@ def self.openapi_types :'include_chrome_reg_ids' => :'Array', :'include_chrome_web_reg_ids' => :'Array', :'include_android_reg_ids' => :'Array', - :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', + :'include_aliases' => :'Hash>', :'target_channel' => :'String', :'id' => :'String', :'value' => :'Integer', @@ -497,13 +497,12 @@ def self.openapi_types :'is_wp_wns' => :'Boolean', :'is_adm' => :'Boolean', :'is_chrome' => :'Boolean', - :'channel_for_external_user_ids' => :'String', :'app_id' => :'String', :'external_id' => :'String', :'idempotency_key' => :'String', - :'contents' => :'StringMap', - :'headings' => :'StringMap', - :'subtitle' => :'StringMap', + :'contents' => :'LanguageStringMap', + :'headings' => :'LanguageStringMap', + :'subtitle' => :'LanguageStringMap', :'data' => :'Object', :'huawei_msg_type' => :'String', :'url' => :'String', @@ -520,7 +519,7 @@ def self.openapi_types :'chrome_big_picture' => :'String', :'chrome_web_image' => :'String', :'buttons' => :'Array