onesignal 5.14.0 → 5.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -3
  5. data/docs/BasicNotification.md +1 -1
  6. data/docs/DefaultApi.md +154 -0
  7. data/docs/EmailReputationResponse.md +22 -0
  8. data/docs/EmailReputationWindow.md +20 -0
  9. data/docs/EstimateNotificationRecipientsRequest.md +28 -0
  10. data/docs/EstimateNotificationRecipientsRequestAllOf.md +24 -0
  11. data/docs/EstimateNotificationRecipientsSuccessResponse.md +26 -0
  12. data/docs/Notification.md +1 -1
  13. data/docs/NotificationTarget.md +1 -1
  14. data/docs/NotificationWithMeta.md +1 -1
  15. data/docs/SegmentNotificationTarget.md +1 -1
  16. data/lib/onesignal/api/default_api.rb +131 -0
  17. data/lib/onesignal/api_client.rb +1 -1
  18. data/lib/onesignal/models/basic_notification.rb +1 -1
  19. data/lib/onesignal/models/email_reputation_response.rb +237 -0
  20. data/lib/onesignal/models/email_reputation_window.rb +230 -0
  21. data/lib/onesignal/models/estimate_notification_recipients_request.rb +326 -0
  22. data/lib/onesignal/models/estimate_notification_recipients_request_all_of.rb +288 -0
  23. data/lib/onesignal/models/estimate_notification_recipients_success_response.rb +260 -0
  24. data/lib/onesignal/models/notification.rb +1 -1
  25. data/lib/onesignal/models/notification_target.rb +1 -1
  26. data/lib/onesignal/models/notification_with_meta.rb +1 -1
  27. data/lib/onesignal/models/segment_notification_target.rb +1 -1
  28. data/lib/onesignal/version.rb +1 -1
  29. data/lib/onesignal.rb +5 -0
  30. data/spec/api/default_api_spec.rb +24 -0
  31. data/spec/models/email_reputation_response_spec.rb +45 -0
  32. data/spec/models/email_reputation_window_spec.rb +39 -0
  33. data/spec/models/estimate_notification_recipients_request_all_of_spec.rb +55 -0
  34. data/spec/models/estimate_notification_recipients_request_spec.rb +67 -0
  35. data/spec/models/estimate_notification_recipients_success_response_spec.rb +57 -0
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/gem_make.out +5 -5
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/mkmf.log +3 -3
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  41. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  42. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  43. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  44. metadata +109 -89
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84ff3d0dedcffdf89af4a61638585fa1d6ff83421d03f9b5bb450a9882ef410e
4
- data.tar.gz: df75bc81b8b50e7e28c5166b927deb30fb9c070a758ea354e7a665d0278d011c
3
+ metadata.gz: ec6437db60463bed7b865d5ac5059a48bd9352d83634200102457c5bad51cb1c
4
+ data.tar.gz: db39d74d08c633d7546b1686be1ca8bbb2d750d5296b5d2d8f47edba1f9ec4f6
5
5
  SHA512:
6
- metadata.gz: 3860a8c07dcb703d00a125df24af63ece484f905e91bca97bc841542f58e716064700324c371a2475b946d5c821cc539be3d669ce8ab888734654a37141c7002
7
- data.tar.gz: 8b3a8dfac3cf9f6fd300bb624e15272855b9319b6b6b6a815cb5de57d9618865ed84155fcd167dfaf53fc2b520ea0949e6abffdf912a946eecfc6b1ceb3b2e40
6
+ metadata.gz: e32af171e6615a73118e0fd1ac82a15912b8314d33e550e597d130d8db305230d1f25864b564933bd9f3e2a7f9f30a9a3ac3fd1a7b3f02f6ffc1016d7f30ff6f
7
+ data.tar.gz: 559f6275009040ad7b539bb7dfa140f2315561f09908c1e8b34d0e350661c16d143d718c21adc53f6359c306c8ff516f0d23a51cc3cfd0cef86d6b9cb0be5458
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.15.0](https://github.com/OneSignal/onesignal-ruby-api/compare/v5.14.0...v5.15.0) (2026-08-31)
4
+
5
+ ### Features
6
+
7
+ * add v5.15.0 package updates ([0d7db86](https://github.com/OneSignal/onesignal-ruby-api/commit/0d7db869ab72f1a7d32eb9ff1d35af94b5c0f705))
8
+ * add v5.15.0 package updates ([#128](https://github.com/OneSignal/onesignal-ruby-api/issues/128)) ([eca3f92](https://github.com/OneSignal/onesignal-ruby-api/commit/eca3f92f539d3dbb7833bff193ff7430177a32f2)), closes [OneSignal/api-client-libraries#459](https://github.com/OneSignal/api-client-libraries/issues/459)
9
+
10
+ ## [5.14.0](https://github.com/OneSignal/onesignal-ruby-api/compare/v5.13.0...v5.14.0) (2026-08-28)
11
+
12
+ ### Features
13
+
14
+ * add v5.14.0 package updates ([f5bef49](https://github.com/OneSignal/onesignal-ruby-api/commit/f5bef49250856e178d685c0844c92b1f236dec09))
15
+ * add v5.14.0 package updates ([#126](https://github.com/OneSignal/onesignal-ruby-api/issues/126)) ([a65294e](https://github.com/OneSignal/onesignal-ruby-api/commit/a65294ef20e67e16116d27dadb87111ed2a33c1c)), closes [OneSignal/api-client-libraries#452](https://github.com/OneSignal/api-client-libraries/issues/452)
16
+
3
17
  ## [5.13.0](https://github.com/OneSignal/onesignal-ruby-api/compare/v5.12.0...v5.13.0) (2026-08-25)
4
18
 
5
19
  ### Features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- onesignal (5.14.0)
4
+ onesignal (5.16.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -6,15 +6,15 @@ OneSignal - the Ruby gem for OneSignal
6
6
 
7
7
  A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
8
8
 
9
- - API version: 5.14.0
10
- - Package version: 5.14.0
9
+ - API version: 5.16.0
10
+ - Package version: 5.16.0
11
11
 
12
12
  ## Installation
13
13
 
14
14
  Add to your `Gemfile`:
15
15
 
16
16
  ```ruby
17
- gem 'onesignal', '~> 5.14.0'
17
+ gem 'onesignal', '~> 5.16.0'
18
18
  ```
19
19
 
20
20
  Then run `bundle install`.
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **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] |
7
+ | **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\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
8
8
  | **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] |
9
9
  | **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] |
10
10
  | **include_email_tokens** | **Array<String>** | Deprecated alias for `email_to`. 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. Prefer `email_to` in new integrations. | [optional] |
data/docs/DefaultApi.md CHANGED
@@ -24,12 +24,14 @@ All URIs are relative to *https://api.onesignal.com*
24
24
  | [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
25
25
  | [**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template |
26
26
  | [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
27
+ | [**estimate_notification_recipients**](DefaultApi.md#estimate_notification_recipients) | **POST** /notifications/count-unsaved | Estimate notification recipients |
27
28
  | [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events | Export CSV of Events |
28
29
  | [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
29
30
  | [**get_aliases**](DefaultApi.md#get_aliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
30
31
  | [**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
31
32
  | [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app |
32
33
  | [**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps |
34
+ | [**get_email_reputation**](DefaultApi.md#get_email_reputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics |
33
35
  | [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification |
34
36
  | [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History |
35
37
  | [**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications |
@@ -1737,6 +1739,82 @@ nil (empty response body)
1737
1739
  - **Accept**: application/json
1738
1740
 
1739
1741
 
1742
+ ## estimate_notification_recipients
1743
+
1744
+ > <EstimateNotificationRecipientsSuccessResponse> estimate_notification_recipients(estimate_notification_recipients_request)
1745
+
1746
+ Estimate notification recipients
1747
+
1748
+ Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
1749
+
1750
+ ### Examples
1751
+
1752
+ ```ruby
1753
+ require 'onesignal'
1754
+ # setup authorization
1755
+ OneSignal.configure do |config|
1756
+ # Configure Bearer authorization: rest_api_key
1757
+ config.rest_api_key = 'YOUR_REST_API_KEY'
1758
+
1759
+ end
1760
+
1761
+ api_instance = OneSignal::DefaultApi.new
1762
+ estimate_notification_recipients_request = OneSignal::EstimateNotificationRecipientsRequest.new({app_id: 'app_id_example'}) # EstimateNotificationRecipientsRequest |
1763
+
1764
+ begin
1765
+ # Estimate notification recipients
1766
+ result = api_instance.estimate_notification_recipients(estimate_notification_recipients_request)
1767
+ p result
1768
+ rescue OneSignal::ApiError => e
1769
+ puts "Error when calling DefaultApi->estimate_notification_recipients: #{e}"
1770
+ puts "Status Code: #{e.code}"
1771
+ # `e.error_messages` flattens any error-envelope shape to an Array<String>;
1772
+ # the raw body remains on `e.response_body`.
1773
+ puts "Error Messages: #{e.error_messages}"
1774
+ puts "Response Body: #{e.response_body}"
1775
+ end
1776
+ ```
1777
+
1778
+ #### Using the estimate_notification_recipients_with_http_info variant
1779
+
1780
+ This returns an Array which contains the response data, status code and headers.
1781
+
1782
+ > <Array(<EstimateNotificationRecipientsSuccessResponse>, Integer, Hash)> estimate_notification_recipients_with_http_info(estimate_notification_recipients_request)
1783
+
1784
+ ```ruby
1785
+ begin
1786
+ # Estimate notification recipients
1787
+ data, status_code, headers = api_instance.estimate_notification_recipients_with_http_info(estimate_notification_recipients_request)
1788
+ p status_code # => 2xx
1789
+ p headers # => { ... }
1790
+ p data # => <EstimateNotificationRecipientsSuccessResponse>
1791
+ rescue OneSignal::ApiError => e
1792
+ puts "Error when calling DefaultApi->estimate_notification_recipients_with_http_info: #{e}"
1793
+ puts "Status Code: #{e.code}"
1794
+ puts "Response Body: #{e.response_body}"
1795
+ end
1796
+ ```
1797
+
1798
+ ### Parameters
1799
+
1800
+ | Name | Type | Description | Notes |
1801
+ | ---- | ---- | ----------- | ----- |
1802
+ | **estimate_notification_recipients_request** | [**EstimateNotificationRecipientsRequest**](EstimateNotificationRecipientsRequest.md) | | |
1803
+
1804
+ ### Return type
1805
+
1806
+ [**EstimateNotificationRecipientsSuccessResponse**](EstimateNotificationRecipientsSuccessResponse.md)
1807
+
1808
+ ### Authorization
1809
+
1810
+ [rest_api_key](https://github.com/OneSignal/onesignal-ruby-api#configuration)
1811
+
1812
+ ### HTTP request headers
1813
+
1814
+ - **Content-Type**: application/json
1815
+ - **Accept**: application/json
1816
+
1817
+
1740
1818
  ## export_events
1741
1819
 
1742
1820
  > <ExportEventsSuccessResponse> export_events(notification_id, app_id)
@@ -2202,6 +2280,82 @@ This endpoint does not need any parameter.
2202
2280
  - **Accept**: application/json
2203
2281
 
2204
2282
 
2283
+ ## get_email_reputation
2284
+
2285
+ > <EmailReputationResponse> get_email_reputation(app_id)
2286
+
2287
+ Get email reputation statistics
2288
+
2289
+ The email bounce and spam complaint rates received for the app over the last 24 hours, 7 days, and 30 days. Rates are expressed as fractions of successfully delivered emails (for example, `0.02` means 2%). A window reports `0` for both rates when the app has not successfully delivered any email in that period.
2290
+
2291
+ ### Examples
2292
+
2293
+ ```ruby
2294
+ require 'onesignal'
2295
+ # setup authorization
2296
+ OneSignal.configure do |config|
2297
+ # Configure Bearer authorization: rest_api_key
2298
+ config.rest_api_key = 'YOUR_REST_API_KEY'
2299
+
2300
+ end
2301
+
2302
+ api_instance = OneSignal::DefaultApi.new
2303
+ app_id = 'YOUR_APP_ID' # String | Your OneSignal App ID in UUID v4 format.
2304
+
2305
+ begin
2306
+ # Get email reputation statistics
2307
+ result = api_instance.get_email_reputation(app_id)
2308
+ p result
2309
+ rescue OneSignal::ApiError => e
2310
+ puts "Error when calling DefaultApi->get_email_reputation: #{e}"
2311
+ puts "Status Code: #{e.code}"
2312
+ # `e.error_messages` flattens any error-envelope shape to an Array<String>;
2313
+ # the raw body remains on `e.response_body`.
2314
+ puts "Error Messages: #{e.error_messages}"
2315
+ puts "Response Body: #{e.response_body}"
2316
+ end
2317
+ ```
2318
+
2319
+ #### Using the get_email_reputation_with_http_info variant
2320
+
2321
+ This returns an Array which contains the response data, status code and headers.
2322
+
2323
+ > <Array(<EmailReputationResponse>, Integer, Hash)> get_email_reputation_with_http_info(app_id)
2324
+
2325
+ ```ruby
2326
+ begin
2327
+ # Get email reputation statistics
2328
+ data, status_code, headers = api_instance.get_email_reputation_with_http_info(app_id)
2329
+ p status_code # => 2xx
2330
+ p headers # => { ... }
2331
+ p data # => <EmailReputationResponse>
2332
+ rescue OneSignal::ApiError => e
2333
+ puts "Error when calling DefaultApi->get_email_reputation_with_http_info: #{e}"
2334
+ puts "Status Code: #{e.code}"
2335
+ puts "Response Body: #{e.response_body}"
2336
+ end
2337
+ ```
2338
+
2339
+ ### Parameters
2340
+
2341
+ | Name | Type | Description | Notes |
2342
+ | ---- | ---- | ----------- | ----- |
2343
+ | **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
2344
+
2345
+ ### Return type
2346
+
2347
+ [**EmailReputationResponse**](EmailReputationResponse.md)
2348
+
2349
+ ### Authorization
2350
+
2351
+ [rest_api_key](https://github.com/OneSignal/onesignal-ruby-api#configuration)
2352
+
2353
+ ### HTTP request headers
2354
+
2355
+ - **Content-Type**: Not defined
2356
+ - **Accept**: application/json
2357
+
2358
+
2205
2359
  ## get_notification
2206
2360
 
2207
2361
  > <NotificationWithMeta> get_notification(app_id, notification_id)
@@ -0,0 +1,22 @@
1
+ # OneSignal::EmailReputationResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **last_24_hours** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
8
+ | **last_7_days** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
9
+ | **last_30_days** | [**EmailReputationWindow**](EmailReputationWindow.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'onesignal'
15
+
16
+ instance = OneSignal::EmailReputationResponse.new(
17
+ last_24_hours: nil,
18
+ last_7_days: nil,
19
+ last_30_days: nil
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # OneSignal::EmailReputationWindow
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **bounce_rate** | **Float** | The fraction of successfully delivered emails that hard or soft bounced during the window. | [optional] |
8
+ | **complaint_rate** | **Float** | The fraction of successfully delivered emails that recipients reported as spam during the window. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'onesignal'
14
+
15
+ instance = OneSignal::EmailReputationWindow.new(
16
+ bounce_rate: 0.02,
17
+ complaint_rate: 0.001
18
+ )
19
+ ```
20
+
@@ -0,0 +1,28 @@
1
+ # OneSignal::EstimateNotificationRecipientsRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] &#x60;\&quot;All\&quot;&#x60; is a shorthand for every subscribed user: if the array includes the string &#x60;\&quot;All\&quot;&#x60; and the app has no segment actually named &#x60;All&#x60;, it targets all subscribers instead of a literal segment lookup. | [optional] |
8
+ | **excluded_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
9
+ | **app_id** | **String** | The OneSignal App ID for your app, which can be found in Keys &amp; IDs. | |
10
+ | **filters** | [**Array&lt;FilterExpression&gt;**](FilterExpression.md) | | [optional] |
11
+ | **include_aliases** | **Hash&lt;String, Array&lt;String&gt;&gt;** | 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: { \&quot;external_id\&quot;: [\&quot;exId1\&quot;, \&quot;extId2\&quot;], \&quot;internal_label\&quot;: [\&quot;id1\&quot;, \&quot;id2\&quot;] } Keys must match API spellings exactly (for example the label for External ID is the string &#x60;external_id&#x60;; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). 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] |
12
+ | **target_channel** | **String** | Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (&#x60;isIos&#x60;, &#x60;isAndroid&#x60;, etc.) are not supported by this endpoint. | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'onesignal'
18
+
19
+ instance = OneSignal::EstimateNotificationRecipientsRequest.new(
20
+ included_segments: nil,
21
+ excluded_segments: nil,
22
+ app_id: nil,
23
+ filters: nil,
24
+ include_aliases: nil,
25
+ target_channel: nil
26
+ )
27
+ ```
28
+
@@ -0,0 +1,24 @@
1
+ # OneSignal::EstimateNotificationRecipientsRequestAllOf
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **app_id** | **String** | The OneSignal App ID for your app, which can be found in Keys &amp; IDs. | [optional] |
8
+ | **filters** | [**Array&lt;FilterExpression&gt;**](FilterExpression.md) | | [optional] |
9
+ | **include_aliases** | **Hash&lt;String, Array&lt;String&gt;&gt;** | 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: { \&quot;external_id\&quot;: [\&quot;exId1\&quot;, \&quot;extId2\&quot;], \&quot;internal_label\&quot;: [\&quot;id1\&quot;, \&quot;id2\&quot;] } Keys must match API spellings exactly (for example the label for External ID is the string &#x60;external_id&#x60;; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). 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] |
10
+ | **target_channel** | **String** | Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (&#x60;isIos&#x60;, &#x60;isAndroid&#x60;, etc.) are not supported by this endpoint. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'onesignal'
16
+
17
+ instance = OneSignal::EstimateNotificationRecipientsRequestAllOf.new(
18
+ app_id: nil,
19
+ filters: nil,
20
+ include_aliases: nil,
21
+ target_channel: nil
22
+ )
23
+ ```
24
+
@@ -0,0 +1,26 @@
1
+ # OneSignal::EstimateNotificationRecipientsSuccessResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **count** | **Integer** | The estimated audience size based on the user targeting method you&#39;ve set on the message, and the specific platforms the message is targeted to send to. | [optional] |
8
+ | **uncapped_count** | **Integer** | The estimated audience size before the plan&#39;s web push subscriber cap is applied. Present only when &#x60;cap_applied&#x60; is &#x60;true&#x60;; &#x60;null&#x60; otherwise. | [optional] |
9
+ | **cap_applied** | **Boolean** | Whether &#x60;count&#x60; was reduced because the app is on a plan that caps the number of web push subscribers it can send to. | [optional] |
10
+ | **mobile_suppressed** | **Boolean** | The mobile equivalent of &#x60;cap_applied&#x60;. Whether mobile push deliveries will be dropped for this send because the org is over its plan&#39;s mobile push subscriber cap. &#x60;false&#x60; when the notification doesn&#39;t target any mobile push platforms. | [optional] |
11
+ | **mobile_excluded_count** | **Integer** | How many mobile push recipients the &#x60;count&#x60; excludes due to the plan&#39;s mobile push subscriber cap. &#x60;0&#x60; when &#x60;mobile_suppressed&#x60; is &#x60;false&#x60;. | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'onesignal'
17
+
18
+ instance = OneSignal::EstimateNotificationRecipientsSuccessResponse.new(
19
+ count: nil,
20
+ uncapped_count: nil,
21
+ cap_applied: nil,
22
+ mobile_suppressed: nil,
23
+ mobile_excluded_count: nil
24
+ )
25
+ ```
26
+
data/docs/Notification.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
7
+ | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] &#x60;\&quot;All\&quot;&#x60; is a shorthand for every subscribed user: if the array includes the string &#x60;\&quot;All\&quot;&#x60; and the app has no segment actually named &#x60;All&#x60;, it targets all subscribers instead of a literal segment lookup. | [optional] |
8
8
  | **excluded_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
9
9
  | **include_subscription_ids** | **Array&lt;String&gt;** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\&quot;1dd608f2-c6a1-11e3-851d-000c2940e62c\&quot;] Limit of 2,000 entries per REST API call | [optional] |
10
10
  | **include_email_tokens** | **Array&lt;String&gt;** | Deprecated alias for &#x60;email_to&#x60;. 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. Prefer &#x60;email_to&#x60; in new integrations. | [optional] |
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
7
+ | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] &#x60;\&quot;All\&quot;&#x60; is a shorthand for every subscribed user: if the array includes the string &#x60;\&quot;All\&quot;&#x60; and the app has no segment actually named &#x60;All&#x60;, it targets all subscribers instead of a literal segment lookup. | [optional] |
8
8
  | **excluded_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
9
9
  | **include_subscription_ids** | **Array&lt;String&gt;** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\&quot;1dd608f2-c6a1-11e3-851d-000c2940e62c\&quot;] Limit of 2,000 entries per REST API call | [optional] |
10
10
  | **include_email_tokens** | **Array&lt;String&gt;** | Deprecated alias for &#x60;email_to&#x60;. 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. Prefer &#x60;email_to&#x60; in new integrations. | [optional] |
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
7
+ | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] &#x60;\&quot;All\&quot;&#x60; is a shorthand for every subscribed user: if the array includes the string &#x60;\&quot;All\&quot;&#x60; and the app has no segment actually named &#x60;All&#x60;, it targets all subscribers instead of a literal segment lookup. | [optional] |
8
8
  | **excluded_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
9
9
  | **include_subscription_ids** | **Array&lt;String&gt;** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\&quot;1dd608f2-c6a1-11e3-851d-000c2940e62c\&quot;] Limit of 2,000 entries per REST API call | [optional] |
10
10
  | **include_email_tokens** | **Array&lt;String&gt;** | Deprecated alias for &#x60;email_to&#x60;. 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. Prefer &#x60;email_to&#x60; in new integrations. | [optional] |
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
7
+ | **included_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] &#x60;\&quot;All\&quot;&#x60; is a shorthand for every subscribed user: if the array includes the string &#x60;\&quot;All\&quot;&#x60; and the app has no segment actually named &#x60;All&#x60;, it targets all subscribers instead of a literal segment lookup. | [optional] |
8
8
  | **excluded_segments** | **Array&lt;String&gt;** | 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: [\&quot;Active Users\&quot;, \&quot;Inactive Users\&quot;] | [optional] |
9
9
 
10
10
  ## Example
@@ -1479,6 +1479,74 @@ module OneSignal
1479
1479
  return data, status_code, headers
1480
1480
  end
1481
1481
 
1482
+ # Estimate notification recipients
1483
+ # Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
1484
+ # @param estimate_notification_recipients_request [EstimateNotificationRecipientsRequest]
1485
+ # @param [Hash] opts the optional parameters
1486
+ # @return [EstimateNotificationRecipientsSuccessResponse]
1487
+ def estimate_notification_recipients(estimate_notification_recipients_request, opts = {})
1488
+ data, _status_code, _headers = estimate_notification_recipients_with_http_info(estimate_notification_recipients_request, opts)
1489
+ data
1490
+ end
1491
+
1492
+ # Estimate notification recipients
1493
+ # Returns the estimated number of recipients for a notification&#39;s targeting, without creating or sending anything. The returned &#x60;count&#x60; reflects the same audience-size estimate you would see under \&quot;Choose your target audience\&quot; when composing a message. It is based on the user targeting method you&#39;ve set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: &#x60;included_segments&#x60; is required (its &#x60;\&quot;All\&quot;&#x60; shorthand targets every subscriber), and &#x60;excluded_segments&#x60;, &#x60;filters&#x60;, &#x60;include_aliases&#x60;, and &#x60;target_channel&#x60; narrow that audience further. Use &#x60;target_channel&#x60; to select platforms. &#x60;include_subscription_ids&#x60; and the other raw subscription id/token fields, and the individual &#x60;isIos&#x60; / &#x60;isAndroid&#x60; / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
1494
+ # @param estimate_notification_recipients_request [EstimateNotificationRecipientsRequest]
1495
+ # @param [Hash] opts the optional parameters
1496
+ # @return [Array<(EstimateNotificationRecipientsSuccessResponse, Integer, Hash)>] EstimateNotificationRecipientsSuccessResponse data, response status code and response headers
1497
+ def estimate_notification_recipients_with_http_info(estimate_notification_recipients_request, opts = {})
1498
+ if @api_client.config.debugging
1499
+ @api_client.config.logger.debug 'Calling API: DefaultApi.estimate_notification_recipients ...'
1500
+ end
1501
+ # verify the required parameter 'estimate_notification_recipients_request' is set
1502
+ if @api_client.config.client_side_validation && estimate_notification_recipients_request.nil?
1503
+ fail ArgumentError, "Missing the required parameter 'estimate_notification_recipients_request' when calling DefaultApi.estimate_notification_recipients"
1504
+ end
1505
+ # resource path
1506
+ local_var_path = '/notifications/count-unsaved'
1507
+
1508
+ # query parameters
1509
+ query_params = opts[:query_params] || {}
1510
+
1511
+ # header parameters
1512
+ header_params = opts[:header_params] || {}
1513
+ # HTTP header 'Accept' (if needed)
1514
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1515
+ # HTTP header 'Content-Type'
1516
+ content_type = @api_client.select_header_content_type(['application/json'])
1517
+ if !content_type.nil?
1518
+ header_params['Content-Type'] = content_type
1519
+ end
1520
+
1521
+ # form parameters
1522
+ form_params = opts[:form_params] || {}
1523
+
1524
+ # http body (model)
1525
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(estimate_notification_recipients_request)
1526
+
1527
+ # return_type
1528
+ return_type = opts[:debug_return_type] || 'EstimateNotificationRecipientsSuccessResponse'
1529
+
1530
+ # auth_names
1531
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1532
+
1533
+ new_options = opts.merge(
1534
+ :operation => :"DefaultApi.estimate_notification_recipients",
1535
+ :header_params => header_params,
1536
+ :query_params => query_params,
1537
+ :form_params => form_params,
1538
+ :body => post_body,
1539
+ :auth_names => auth_names,
1540
+ :return_type => return_type
1541
+ )
1542
+
1543
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1544
+ if @api_client.config.debugging
1545
+ @api_client.config.logger.debug "API called: DefaultApi#estimate_notification_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1546
+ end
1547
+ return data, status_code, headers
1548
+ end
1549
+
1482
1550
  # Export CSV of Events
1483
1551
  # 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.
1484
1552
  # @param notification_id [String] The ID of the notification to export events from.
@@ -1879,6 +1947,69 @@ module OneSignal
1879
1947
  return data, status_code, headers
1880
1948
  end
1881
1949
 
1950
+ # Get email reputation statistics
1951
+ # The email bounce and spam complaint rates received for the app over the last 24 hours, 7 days, and 30 days. Rates are expressed as fractions of successfully delivered emails (for example, `0.02` means 2%). A window reports `0` for both rates when the app has not successfully delivered any email in that period.
1952
+ # @param app_id [String] Your OneSignal App ID in UUID v4 format.
1953
+ # @param [Hash] opts the optional parameters
1954
+ # @return [EmailReputationResponse]
1955
+ def get_email_reputation(app_id, opts = {})
1956
+ data, _status_code, _headers = get_email_reputation_with_http_info(app_id, opts)
1957
+ data
1958
+ end
1959
+
1960
+ # Get email reputation statistics
1961
+ # The email bounce and spam complaint rates received for the app over the last 24 hours, 7 days, and 30 days. Rates are expressed as fractions of successfully delivered emails (for example, &#x60;0.02&#x60; means 2%). A window reports &#x60;0&#x60; for both rates when the app has not successfully delivered any email in that period.
1962
+ # @param app_id [String] Your OneSignal App ID in UUID v4 format.
1963
+ # @param [Hash] opts the optional parameters
1964
+ # @return [Array<(EmailReputationResponse, Integer, Hash)>] EmailReputationResponse data, response status code and response headers
1965
+ def get_email_reputation_with_http_info(app_id, opts = {})
1966
+ if @api_client.config.debugging
1967
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_email_reputation ...'
1968
+ end
1969
+ # verify the required parameter 'app_id' is set
1970
+ if @api_client.config.client_side_validation && app_id.nil?
1971
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_email_reputation"
1972
+ end
1973
+ # resource path
1974
+ local_var_path = '/apps/{app_id}/email_analytics/delivery_metrics'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
1975
+
1976
+ # query parameters
1977
+ query_params = opts[:query_params] || {}
1978
+
1979
+ # header parameters
1980
+ header_params = opts[:header_params] || {}
1981
+ # HTTP header 'Accept' (if needed)
1982
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1983
+
1984
+ # form parameters
1985
+ form_params = opts[:form_params] || {}
1986
+
1987
+ # http body (model)
1988
+ post_body = opts[:debug_body]
1989
+
1990
+ # return_type
1991
+ return_type = opts[:debug_return_type] || 'EmailReputationResponse'
1992
+
1993
+ # auth_names
1994
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1995
+
1996
+ new_options = opts.merge(
1997
+ :operation => :"DefaultApi.get_email_reputation",
1998
+ :header_params => header_params,
1999
+ :query_params => query_params,
2000
+ :form_params => form_params,
2001
+ :body => post_body,
2002
+ :auth_names => auth_names,
2003
+ :return_type => return_type
2004
+ )
2005
+
2006
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2007
+ if @api_client.config.debugging
2008
+ @api_client.config.logger.debug "API called: DefaultApi#get_email_reputation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2009
+ end
2010
+ return data, status_code, headers
2011
+ end
2012
+
1882
2013
  # View notification
1883
2014
  # View the details of a single notification and outcomes associated with it
1884
2015
  # @param app_id [String]
@@ -89,7 +89,7 @@ module OneSignal
89
89
  url = build_request_url(path, opts)
90
90
  http_method = http_method.to_sym.downcase
91
91
 
92
- opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.14.0'
92
+ opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.16.0'
93
93
  header_params = @default_headers.merge(opts[:header_params] || {})
94
94
  query_params = opts[:query_params] || {}
95
95
  form_params = opts[:form_params] || {}
@@ -14,7 +14,7 @@ require 'time'
14
14
 
15
15
  module OneSignal
16
16
  class BasicNotification
17
- # 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\"]
17
+ # 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\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
18
18
  attr_accessor :included_segments
19
19
 
20
20
  # 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\"]