onesignal 1.0.1 → 2.2.1
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.
- checksums.yaml +4 -4
- data/README.md +114 -88
- data/docs/App.md +9 -1
- data/docs/BasicNotification.md +230 -0
- data/docs/BasicNotificationAllOf.md +202 -0
- data/docs/{NotificationAllOfAndroidBackgroundLayout.md → BasicNotificationAllOfAndroidBackgroundLayout.md} +2 -2
- data/docs/BeginLiveActivityRequest.md +20 -0
- data/docs/CancelNotificationSuccessResponse.md +18 -0
- data/docs/CreateNotificationSuccessResponse.md +24 -0
- data/docs/{InlineResponse2005.md → CreatePlayerSuccessResponse.md} +2 -2
- data/docs/{InlineResponse4002.md → CreateSegmentConflictResponse.md} +2 -2
- data/docs/CreateSegmentSuccessResponse.md +20 -0
- data/docs/CreateSubscriptionRequestBody.md +20 -0
- data/docs/CreateUserConflictResponse.md +18 -0
- data/docs/CreateUserConflictResponseErrorsInner.md +22 -0
- data/docs/CreateUserConflictResponseErrorsItemsMeta.md +18 -0
- data/docs/DefaultApi.md +1700 -301
- data/docs/DeletePlayerNotFoundResponse.md +18 -0
- data/docs/{InlineResponse2001.md → DeletePlayerSuccessResponse.md} +2 -2
- data/docs/DeleteSegmentNotFoundResponse.md +18 -0
- data/docs/DeleteSegmentSuccessResponse.md +18 -0
- data/docs/DeliveryData.md +5 -5
- data/docs/{InlineResponse2008.md → ExportEventsSuccessResponse.md} +2 -2
- data/docs/ExportPlayersRequestBody.md +2 -2
- data/docs/ExportPlayersSuccessResponse.md +18 -0
- data/docs/Filter.md +1 -1
- data/docs/FilterExpressions.md +1 -1
- data/docs/GenericError.md +18 -0
- data/docs/GenericErrorErrorsInner.md +20 -0
- data/docs/InlineResponse200.md +2 -8
- data/docs/InlineResponse2003.md +18 -0
- data/docs/InlineResponse201.md +2 -4
- data/docs/InlineResponse202.md +18 -0
- data/docs/Notification.md +22 -30
- data/docs/NotificationAllOf.md +1 -175
- data/docs/{InlineResponse2002.md → NotificationHistorySuccessResponse.md} +2 -2
- data/docs/NotificationTarget.md +5 -25
- data/docs/NotificationWithMeta.md +21 -29
- data/docs/PlatformDeliveryData.md +5 -1
- data/docs/PlatformDeliveryDataEmailAllOf.md +30 -0
- data/docs/PlatformDeliveryDataSmsAllOf.md +22 -0
- data/docs/Player.md +1 -1
- data/docs/PlayerNotificationTarget.md +5 -1
- data/docs/PlayerNotificationTargetIncludeAliases.md +18 -0
- data/docs/PropertiesDeltas.md +22 -0
- data/docs/PropertiesObject.md +38 -0
- data/docs/Purchase.md +4 -2
- data/docs/RateLimiterError.md +18 -0
- data/docs/SubscriptionObject.md +50 -0
- data/docs/TransferSubscriptionRequestBody.md +18 -0
- data/docs/UpdateLiveActivityRequest.md +24 -0
- data/docs/UpdateLiveActivitySuccessResponse.md +20 -0
- data/docs/{InlineResponse2007.md → UpdatePlayerSuccessResponse.md} +3 -3
- data/docs/UpdatePlayerTagsSuccessResponse.md +18 -0
- data/docs/UpdateSubscriptionRequestBody.md +18 -0
- data/docs/UpdateUserRequest.md +22 -0
- data/docs/User.md +24 -0
- data/docs/UserIdentityRequestBody.md +18 -0
- data/docs/UserIdentityResponse.md +18 -0
- data/docs/UserSubscriptionOptions.md +18 -0
- data/lib/onesignal/api/default_api.rb +1583 -221
- data/lib/onesignal/api_client.rb +2 -2
- data/lib/onesignal/api_error.rb +1 -1
- data/lib/onesignal/configuration.rb +6 -6
- data/lib/onesignal/models/app.rb +57 -7
- data/lib/onesignal/models/basic_notification.rb +1442 -0
- data/lib/onesignal/models/basic_notification_all_of.rb +1252 -0
- data/lib/onesignal/models/{notification_all_of_android_background_layout.rb → basic_notification_all_of_android_background_layout.rb} +4 -4
- data/lib/onesignal/models/begin_live_activity_request.rb +238 -0
- data/lib/onesignal/models/button.rb +1 -1
- data/lib/onesignal/models/cancel_notification_success_response.rb +219 -0
- data/lib/onesignal/models/create_notification_success_response.rb +248 -0
- data/lib/onesignal/models/{inline_response2005.rb → create_player_success_response.rb} +4 -4
- data/lib/onesignal/models/{inline_response4002.rb → create_segment_conflict_response.rb} +4 -4
- data/lib/onesignal/models/create_segment_success_response.rb +229 -0
- data/lib/onesignal/models/create_subscription_request_body.rb +228 -0
- data/lib/onesignal/models/{inline_response4001.rb → create_user_conflict_response.rb} +6 -15
- data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +237 -0
- data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +219 -0
- data/lib/onesignal/models/delete_player_not_found_response.rb +219 -0
- data/lib/onesignal/models/{inline_response2001.rb → delete_player_success_response.rb} +4 -4
- data/lib/onesignal/models/delete_segment_not_found_response.rb +219 -0
- data/lib/onesignal/models/delete_segment_success_response.rb +219 -0
- data/lib/onesignal/models/delivery_data.rb +6 -1
- data/lib/onesignal/models/{inline_response2008.rb → export_events_success_response.rb} +4 -4
- data/lib/onesignal/models/export_players_request_body.rb +3 -3
- data/lib/onesignal/models/export_players_success_response.rb +219 -0
- data/lib/onesignal/models/filter.rb +2 -2
- data/lib/onesignal/models/filter_expressions.rb +2 -2
- data/lib/onesignal/models/{inline_response400.rb → generic_error.rb} +5 -5
- data/lib/onesignal/models/generic_error_errors_inner.rb +228 -0
- data/lib/onesignal/models/get_notification_request_body.rb +1 -1
- data/lib/onesignal/models/inline_response200.rb +10 -46
- data/lib/onesignal/models/{inline_response4003.rb → inline_response2003.rb} +12 -12
- data/lib/onesignal/models/inline_response201.rb +8 -18
- data/lib/onesignal/models/inline_response202.rb +219 -0
- data/lib/onesignal/models/invalid_identifier_error.rb +1 -1
- data/lib/onesignal/models/notification.rb +173 -141
- data/lib/onesignal/models/notification200_errors.rb +1 -1
- data/lib/onesignal/models/notification_all_of.rb +6 -929
- data/lib/onesignal/models/{inline_response2002.rb → notification_history_success_response.rb} +4 -4
- data/lib/onesignal/models/notification_slice.rb +1 -1
- data/lib/onesignal/models/notification_target.rb +60 -126
- data/lib/onesignal/models/notification_with_meta.rb +168 -137
- data/lib/onesignal/models/notification_with_meta_all_of.rb +2 -1
- data/lib/onesignal/models/operator.rb +1 -1
- data/lib/onesignal/models/outcome_data.rb +1 -1
- data/lib/onesignal/models/outcomes_data.rb +1 -1
- data/lib/onesignal/models/platform_delivery_data.rb +25 -5
- data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +287 -0
- data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +243 -0
- data/lib/onesignal/models/player.rb +9 -6
- data/lib/onesignal/models/player_notification_target.rb +60 -5
- data/lib/onesignal/models/player_notification_target_include_aliases.rb +221 -0
- data/lib/onesignal/models/player_slice.rb +1 -1
- data/lib/onesignal/models/properties_deltas.rb +239 -0
- data/lib/onesignal/models/properties_object.rb +313 -0
- data/lib/onesignal/models/purchase.rb +15 -6
- data/lib/onesignal/models/rate_limiter_error.rb +221 -0
- data/lib/onesignal/models/segment.rb +1 -1
- data/lib/onesignal/models/segment_notification_target.rb +1 -1
- data/lib/onesignal/models/string_map.rb +1 -1
- data/lib/onesignal/models/{filter_notification_target.rb → subscription_object.rb} +145 -78
- data/lib/onesignal/models/transfer_subscription_request_body.rb +221 -0
- data/lib/onesignal/models/update_live_activity_request.rb +309 -0
- data/lib/onesignal/models/update_live_activity_success_response.rb +228 -0
- data/lib/onesignal/models/{inline_response2007.rb → update_player_success_response.rb} +5 -5
- data/lib/onesignal/models/update_player_tags_request_body.rb +1 -1
- data/lib/onesignal/models/update_player_tags_success_response.rb +219 -0
- data/lib/onesignal/models/update_subscription_request_body.rb +219 -0
- data/lib/onesignal/models/update_user_request.rb +239 -0
- data/lib/onesignal/models/user.rb +250 -0
- data/lib/onesignal/models/user_identity_request_body.rb +221 -0
- data/lib/onesignal/models/user_identity_response.rb +221 -0
- data/lib/onesignal/models/user_subscription_options.rb +219 -0
- data/lib/onesignal/version.rb +2 -2
- data/lib/onesignal.rb +43 -12
- data/onesignal.gemspec +1 -1
- data/spec/api/default_api_spec.rb +249 -12
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +4 -4
- data/spec/models/app_spec.rb +25 -1
- data/spec/models/{notification_all_of_android_background_layout_spec.rb → basic_notification_all_of_android_background_layout_spec.rb} +7 -7
- data/spec/models/basic_notification_all_of_spec.rb +590 -0
- data/spec/models/basic_notification_spec.rb +678 -0
- data/spec/models/begin_live_activity_request_spec.rb +40 -0
- data/spec/models/button_spec.rb +1 -1
- data/spec/models/cancel_notification_success_response_spec.rb +34 -0
- data/spec/models/create_notification_success_response_spec.rb +52 -0
- data/spec/models/{inline_response2005_spec.rb → create_player_success_response_spec.rb} +7 -7
- data/spec/models/{inline_response4001_spec.rb → create_segment_conflict_response_spec.rb} +7 -7
- data/spec/models/{inline_response4002_spec.rb → create_segment_success_response_spec.rb} +8 -8
- data/spec/models/create_subscription_request_body_spec.rb +40 -0
- data/spec/models/create_user_conflict_response_errors_inner_spec.rb +46 -0
- data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +34 -0
- data/spec/models/create_user_conflict_response_spec.rb +34 -0
- data/spec/models/delete_player_not_found_response_spec.rb +34 -0
- data/spec/models/{inline_response2001_spec.rb → delete_player_success_response_spec.rb} +7 -7
- data/spec/models/delete_segment_not_found_response_spec.rb +34 -0
- data/spec/models/delete_segment_success_response_spec.rb +34 -0
- data/spec/models/delivery_data_spec.rb +1 -1
- data/spec/models/{inline_response2008_spec.rb → export_events_success_response_spec.rb} +7 -7
- data/spec/models/export_players_request_body_spec.rb +1 -1
- data/spec/models/export_players_success_response_spec.rb +34 -0
- data/spec/models/filter_expressions_spec.rb +1 -1
- data/spec/models/filter_spec.rb +1 -1
- data/spec/models/generic_error_errors_inner_spec.rb +40 -0
- data/spec/models/{inline_response4003_spec.rb → generic_error_spec.rb} +8 -8
- data/spec/models/get_notification_request_body_spec.rb +1 -1
- data/spec/models/{inline_response2007_spec.rb → inline_response2003_spec.rb} +8 -8
- data/spec/models/inline_response200_spec.rb +2 -20
- data/spec/models/inline_response201_spec.rb +2 -8
- data/spec/models/{inline_response400_spec.rb → inline_response202_spec.rb} +8 -8
- data/spec/models/invalid_identifier_error_spec.rb +1 -1
- data/spec/models/notification200_errors_spec.rb +1 -1
- data/spec/models/notification_all_of_spec.rb +1 -527
- data/spec/models/{inline_response2002_spec.rb → notification_history_success_response_spec.rb} +7 -7
- data/spec/models/notification_slice_spec.rb +1 -1
- data/spec/models/notification_spec.rb +56 -76
- data/spec/models/notification_target_spec.rb +17 -73
- data/spec/models/notification_with_meta_all_of_spec.rb +1 -1
- data/spec/models/notification_with_meta_spec.rb +56 -76
- data/spec/models/operator_spec.rb +1 -1
- data/spec/models/outcome_data_spec.rb +1 -1
- data/spec/models/outcomes_data_spec.rb +1 -1
- data/spec/models/platform_delivery_data_email_all_of_spec.rb +70 -0
- data/spec/models/platform_delivery_data_sms_all_of_spec.rb +46 -0
- data/spec/models/platform_delivery_data_spec.rb +13 -1
- data/spec/models/player_notification_target_include_aliases_spec.rb +34 -0
- data/spec/models/player_notification_target_spec.rb +17 -1
- data/spec/models/player_slice_spec.rb +1 -1
- data/spec/models/player_spec.rb +1 -1
- data/spec/models/properties_deltas_spec.rb +46 -0
- data/spec/models/{filter_notification_target_spec.rb → properties_object_spec.rb} +18 -24
- data/spec/models/purchase_spec.rb +7 -1
- data/spec/models/rate_limiter_error_spec.rb +34 -0
- data/spec/models/segment_notification_target_spec.rb +1 -1
- data/spec/models/segment_spec.rb +1 -1
- data/spec/models/string_map_spec.rb +1 -1
- data/spec/models/subscription_object_spec.rb +134 -0
- data/spec/models/transfer_subscription_request_body_spec.rb +34 -0
- data/spec/models/update_live_activity_request_spec.rb +60 -0
- data/spec/models/update_live_activity_success_response_spec.rb +40 -0
- data/spec/models/update_player_success_response_spec.rb +34 -0
- data/spec/models/update_player_tags_request_body_spec.rb +1 -1
- data/spec/models/update_player_tags_success_response_spec.rb +34 -0
- data/spec/models/update_subscription_request_body_spec.rb +34 -0
- data/spec/models/update_user_request_spec.rb +46 -0
- data/spec/models/user_identity_request_body_spec.rb +34 -0
- data/spec/models/user_identity_response_spec.rb +34 -0
- data/spec/models/user_spec.rb +52 -0
- data/spec/models/user_subscription_options_spec.rb +34 -0
- data/spec/spec_helper.rb +1 -1
- metadata +193 -72
- data/docs/FilterNotificationTarget.md +0 -40
- data/docs/InlineResponse400.md +0 -18
- data/docs/InlineResponse4001.md +0 -20
- data/docs/InlineResponse4003.md +0 -18
data/docs/DefaultApi.md
CHANGED
@@ -1,33 +1,125 @@
|
|
1
1
|
# OneSignal::DefaultApi
|
2
2
|
|
3
|
-
All URIs are relative to *https://onesignal.com
|
3
|
+
All URIs are relative to *https://api.onesignal.com*
|
4
4
|
|
5
5
|
| Method | HTTP request | Description |
|
6
6
|
| ------ | ------------ | ----------- |
|
7
|
+
| [**begin_live_activity**](DefaultApi.md#begin_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity |
|
7
8
|
| [**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
|
8
9
|
| [**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app |
|
9
10
|
| [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification |
|
10
11
|
| [**create_player**](DefaultApi.md#create_player) | **POST** /players | Add a device |
|
11
12
|
| [**create_segments**](DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments |
|
13
|
+
| [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | |
|
14
|
+
| [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | |
|
15
|
+
| [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | |
|
12
16
|
| [**delete_player**](DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record |
|
13
17
|
| [**delete_segments**](DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments |
|
14
|
-
| [**
|
18
|
+
| [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
|
19
|
+
| [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
|
20
|
+
| [**end_live_activity**](DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity |
|
21
|
+
| [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
|
22
|
+
| [**export_players**](DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players |
|
23
|
+
| [**fetch_aliases**](DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
|
24
|
+
| [**fetch_user**](DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
|
25
|
+
| [**fetch_user_identity**](DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
|
15
26
|
| [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app |
|
16
27
|
| [**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps |
|
28
|
+
| [**get_eligible_iams**](DefaultApi.md#get_eligible_iams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | |
|
17
29
|
| [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification |
|
18
30
|
| [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History |
|
19
31
|
| [**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications |
|
20
32
|
| [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes |
|
21
33
|
| [**get_player**](DefaultApi.md#get_player) | **GET** /players/{player_id} | View device |
|
22
34
|
| [**get_players**](DefaultApi.md#get_players) | **GET** /players | View devices |
|
35
|
+
| [**identify_user_by_alias**](DefaultApi.md#identify_user_by_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
|
36
|
+
| [**identify_user_by_subscription_id**](DefaultApi.md#identify_user_by_subscription_id) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
|
37
|
+
| [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | |
|
23
38
|
| [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app |
|
39
|
+
| [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push |
|
24
40
|
| [**update_player**](DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device |
|
25
41
|
| [**update_player_tags**](DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id |
|
42
|
+
| [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | |
|
43
|
+
| [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
|
44
|
+
|
45
|
+
|
46
|
+
## begin_live_activity
|
47
|
+
|
48
|
+
> begin_live_activity(app_id, activity_id, begin_live_activity_request)
|
49
|
+
|
50
|
+
Start Live Activity
|
51
|
+
|
52
|
+
Starts a Live Activity
|
53
|
+
|
54
|
+
### Examples
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
require 'onesignal'
|
58
|
+
# setup authorization
|
59
|
+
OneSignal.configure do |config|
|
60
|
+
# Configure Bearer authorization: user_key
|
61
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
62
|
+
# Configure Bearer authorization: app_key
|
63
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
api_instance = OneSignal::DefaultApi.new
|
68
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
69
|
+
activity_id = 'activity_id_example' # String | Live Activity record ID
|
70
|
+
begin_live_activity_request = OneSignal::BeginLiveActivityRequest.new({push_token: 'push_token_example', subscription_id: 'subscription_id_example'}) # BeginLiveActivityRequest |
|
71
|
+
|
72
|
+
begin
|
73
|
+
# Start Live Activity
|
74
|
+
api_instance.begin_live_activity(app_id, activity_id, begin_live_activity_request)
|
75
|
+
rescue OneSignal::ApiError => e
|
76
|
+
puts "Error when calling DefaultApi->begin_live_activity: #{e}"
|
77
|
+
end
|
78
|
+
```
|
79
|
+
|
80
|
+
#### Using the begin_live_activity_with_http_info variant
|
81
|
+
|
82
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
83
|
+
|
84
|
+
> <Array(nil, Integer, Hash)> begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request)
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
begin
|
88
|
+
# Start Live Activity
|
89
|
+
data, status_code, headers = api_instance.begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request)
|
90
|
+
p status_code # => 2xx
|
91
|
+
p headers # => { ... }
|
92
|
+
p data # => nil
|
93
|
+
rescue OneSignal::ApiError => e
|
94
|
+
puts "Error when calling DefaultApi->begin_live_activity_with_http_info: #{e}"
|
95
|
+
end
|
96
|
+
```
|
97
|
+
|
98
|
+
### Parameters
|
99
|
+
|
100
|
+
| Name | Type | Description | Notes |
|
101
|
+
| ---- | ---- | ----------- | ----- |
|
102
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
103
|
+
| **activity_id** | **String** | Live Activity record ID | |
|
104
|
+
| **begin_live_activity_request** | [**BeginLiveActivityRequest**](BeginLiveActivityRequest.md) | | |
|
105
|
+
|
106
|
+
### Return type
|
107
|
+
|
108
|
+
nil (empty response body)
|
109
|
+
|
110
|
+
### Authorization
|
111
|
+
|
112
|
+
[app_key](../README.md#app_key)
|
113
|
+
|
114
|
+
### HTTP request headers
|
115
|
+
|
116
|
+
- **Content-Type**: application/json
|
117
|
+
- **Accept**: application/json
|
26
118
|
|
27
119
|
|
28
120
|
## cancel_notification
|
29
121
|
|
30
|
-
> <
|
122
|
+
> <CancelNotificationSuccessResponse> cancel_notification(app_id, notification_id)
|
31
123
|
|
32
124
|
Stop a scheduled or currently outgoing notification
|
33
125
|
|
@@ -39,8 +131,10 @@ Used to stop a scheduled or currently outgoing notification
|
|
39
131
|
require 'onesignal'
|
40
132
|
# setup authorization
|
41
133
|
OneSignal.configure do |config|
|
134
|
+
# Configure Bearer authorization: user_key
|
135
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
42
136
|
# Configure Bearer authorization: app_key
|
43
|
-
config.app_key = '
|
137
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
44
138
|
|
45
139
|
end
|
46
140
|
|
@@ -61,7 +155,7 @@ end
|
|
61
155
|
|
62
156
|
This returns an Array which contains the response data, status code and headers.
|
63
157
|
|
64
|
-
> <Array(<
|
158
|
+
> <Array(<CancelNotificationSuccessResponse>, Integer, Hash)> cancel_notification_with_http_info(app_id, notification_id)
|
65
159
|
|
66
160
|
```ruby
|
67
161
|
begin
|
@@ -69,7 +163,7 @@ begin
|
|
69
163
|
data, status_code, headers = api_instance.cancel_notification_with_http_info(app_id, notification_id)
|
70
164
|
p status_code # => 2xx
|
71
165
|
p headers # => { ... }
|
72
|
-
p data # => <
|
166
|
+
p data # => <CancelNotificationSuccessResponse>
|
73
167
|
rescue OneSignal::ApiError => e
|
74
168
|
puts "Error when calling DefaultApi->cancel_notification_with_http_info: #{e}"
|
75
169
|
end
|
@@ -84,7 +178,7 @@ end
|
|
84
178
|
|
85
179
|
### Return type
|
86
180
|
|
87
|
-
[**
|
181
|
+
[**CancelNotificationSuccessResponse**](CancelNotificationSuccessResponse.md)
|
88
182
|
|
89
183
|
### Authorization
|
90
184
|
|
@@ -111,12 +205,14 @@ require 'onesignal'
|
|
111
205
|
# setup authorization
|
112
206
|
OneSignal.configure do |config|
|
113
207
|
# Configure Bearer authorization: user_key
|
114
|
-
config.user_key = '
|
208
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
209
|
+
# Configure Bearer authorization: user_key
|
210
|
+
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
115
211
|
|
116
212
|
end
|
117
213
|
|
118
214
|
api_instance = OneSignal::DefaultApi.new
|
119
|
-
app = OneSignal::App.new
|
215
|
+
app = OneSignal::App.new # App |
|
120
216
|
|
121
217
|
begin
|
122
218
|
# Create an app
|
@@ -167,7 +263,7 @@ end
|
|
167
263
|
|
168
264
|
## create_notification
|
169
265
|
|
170
|
-
> <
|
266
|
+
> <CreateNotificationSuccessResponse> create_notification(notification)
|
171
267
|
|
172
268
|
Create notification
|
173
269
|
|
@@ -179,8 +275,10 @@ Sends notifications to your users
|
|
179
275
|
require 'onesignal'
|
180
276
|
# setup authorization
|
181
277
|
OneSignal.configure do |config|
|
278
|
+
# Configure Bearer authorization: user_key
|
279
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
182
280
|
# Configure Bearer authorization: app_key
|
183
|
-
config.app_key = '
|
281
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
184
282
|
|
185
283
|
end
|
186
284
|
|
@@ -200,7 +298,7 @@ end
|
|
200
298
|
|
201
299
|
This returns an Array which contains the response data, status code and headers.
|
202
300
|
|
203
|
-
> <Array(<
|
301
|
+
> <Array(<CreateNotificationSuccessResponse>, Integer, Hash)> create_notification_with_http_info(notification)
|
204
302
|
|
205
303
|
```ruby
|
206
304
|
begin
|
@@ -208,7 +306,7 @@ begin
|
|
208
306
|
data, status_code, headers = api_instance.create_notification_with_http_info(notification)
|
209
307
|
p status_code # => 2xx
|
210
308
|
p headers # => { ... }
|
211
|
-
p data # => <
|
309
|
+
p data # => <CreateNotificationSuccessResponse>
|
212
310
|
rescue OneSignal::ApiError => e
|
213
311
|
puts "Error when calling DefaultApi->create_notification_with_http_info: #{e}"
|
214
312
|
end
|
@@ -222,7 +320,7 @@ end
|
|
222
320
|
|
223
321
|
### Return type
|
224
322
|
|
225
|
-
[**
|
323
|
+
[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md)
|
226
324
|
|
227
325
|
### Authorization
|
228
326
|
|
@@ -236,7 +334,7 @@ end
|
|
236
334
|
|
237
335
|
## create_player
|
238
336
|
|
239
|
-
> <
|
337
|
+
> <CreatePlayerSuccessResponse> create_player(player)
|
240
338
|
|
241
339
|
Add a device
|
242
340
|
|
@@ -248,13 +346,15 @@ Register a new device to one of your OneSignal apps 🚧 Don't use this Thi
|
|
248
346
|
require 'onesignal'
|
249
347
|
# setup authorization
|
250
348
|
OneSignal.configure do |config|
|
349
|
+
# Configure Bearer authorization: user_key
|
350
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
251
351
|
# Configure Bearer authorization: app_key
|
252
|
-
config.app_key = '
|
352
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
253
353
|
|
254
354
|
end
|
255
355
|
|
256
356
|
api_instance = OneSignal::DefaultApi.new
|
257
|
-
player = OneSignal::Player.new({
|
357
|
+
player = OneSignal::Player.new({device_type: 37}) # Player |
|
258
358
|
|
259
359
|
begin
|
260
360
|
# Add a device
|
@@ -269,7 +369,7 @@ end
|
|
269
369
|
|
270
370
|
This returns an Array which contains the response data, status code and headers.
|
271
371
|
|
272
|
-
> <Array(<
|
372
|
+
> <Array(<CreatePlayerSuccessResponse>, Integer, Hash)> create_player_with_http_info(player)
|
273
373
|
|
274
374
|
```ruby
|
275
375
|
begin
|
@@ -277,7 +377,7 @@ begin
|
|
277
377
|
data, status_code, headers = api_instance.create_player_with_http_info(player)
|
278
378
|
p status_code # => 2xx
|
279
379
|
p headers # => { ... }
|
280
|
-
p data # => <
|
380
|
+
p data # => <CreatePlayerSuccessResponse>
|
281
381
|
rescue OneSignal::ApiError => e
|
282
382
|
puts "Error when calling DefaultApi->create_player_with_http_info: #{e}"
|
283
383
|
end
|
@@ -291,7 +391,7 @@ end
|
|
291
391
|
|
292
392
|
### Return type
|
293
393
|
|
294
|
-
[**
|
394
|
+
[**CreatePlayerSuccessResponse**](CreatePlayerSuccessResponse.md)
|
295
395
|
|
296
396
|
### Authorization
|
297
397
|
|
@@ -305,7 +405,7 @@ end
|
|
305
405
|
|
306
406
|
## create_segments
|
307
407
|
|
308
|
-
> <
|
408
|
+
> <CreateSegmentSuccessResponse> create_segments(app_id, opts)
|
309
409
|
|
310
410
|
Create Segments
|
311
411
|
|
@@ -317,8 +417,10 @@ Create segments visible and usable in the dashboard and API - Required: OneSigna
|
|
317
417
|
require 'onesignal'
|
318
418
|
# setup authorization
|
319
419
|
OneSignal.configure do |config|
|
420
|
+
# Configure Bearer authorization: user_key
|
421
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
320
422
|
# Configure Bearer authorization: app_key
|
321
|
-
config.app_key = '
|
423
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
322
424
|
|
323
425
|
end
|
324
426
|
|
@@ -341,7 +443,7 @@ end
|
|
341
443
|
|
342
444
|
This returns an Array which contains the response data, status code and headers.
|
343
445
|
|
344
|
-
> <Array(<
|
446
|
+
> <Array(<CreateSegmentSuccessResponse>, Integer, Hash)> create_segments_with_http_info(app_id, opts)
|
345
447
|
|
346
448
|
```ruby
|
347
449
|
begin
|
@@ -349,7 +451,7 @@ begin
|
|
349
451
|
data, status_code, headers = api_instance.create_segments_with_http_info(app_id, opts)
|
350
452
|
p status_code # => 2xx
|
351
453
|
p headers # => { ... }
|
352
|
-
p data # => <
|
454
|
+
p data # => <CreateSegmentSuccessResponse>
|
353
455
|
rescue OneSignal::ApiError => e
|
354
456
|
puts "Error when calling DefaultApi->create_segments_with_http_info: #{e}"
|
355
457
|
end
|
@@ -364,7 +466,7 @@ end
|
|
364
466
|
|
365
467
|
### Return type
|
366
468
|
|
367
|
-
[**
|
469
|
+
[**CreateSegmentSuccessResponse**](CreateSegmentSuccessResponse.md)
|
368
470
|
|
369
471
|
### Authorization
|
370
472
|
|
@@ -376,13 +478,13 @@ end
|
|
376
478
|
- **Accept**: application/json
|
377
479
|
|
378
480
|
|
379
|
-
##
|
481
|
+
## create_subscription
|
380
482
|
|
381
|
-
> <
|
483
|
+
> <InlineResponse201> create_subscription(app_id, alias_label, alias_id, create_subscription_request_body)
|
382
484
|
|
383
|
-
Delete a user record
|
384
485
|
|
385
|
-
|
486
|
+
|
487
|
+
Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
|
386
488
|
|
387
489
|
### Examples
|
388
490
|
|
@@ -390,39 +492,43 @@ Delete player - Required: Used to delete a single, specific Player ID record fro
|
|
390
492
|
require 'onesignal'
|
391
493
|
# setup authorization
|
392
494
|
OneSignal.configure do |config|
|
495
|
+
# Configure Bearer authorization: user_key
|
496
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
393
497
|
# Configure Bearer authorization: app_key
|
394
|
-
config.app_key = '
|
498
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
395
499
|
|
396
500
|
end
|
397
501
|
|
398
502
|
api_instance = OneSignal::DefaultApi.new
|
399
|
-
app_id = 'app_id_example' # String |
|
400
|
-
|
503
|
+
app_id = 'app_id_example' # String |
|
504
|
+
alias_label = 'alias_label_example' # String |
|
505
|
+
alias_id = 'alias_id_example' # String |
|
506
|
+
create_subscription_request_body = OneSignal::CreateSubscriptionRequestBody.new # CreateSubscriptionRequestBody |
|
401
507
|
|
402
508
|
begin
|
403
|
-
|
404
|
-
result = api_instance.
|
509
|
+
|
510
|
+
result = api_instance.create_subscription(app_id, alias_label, alias_id, create_subscription_request_body)
|
405
511
|
p result
|
406
512
|
rescue OneSignal::ApiError => e
|
407
|
-
puts "Error when calling DefaultApi->
|
513
|
+
puts "Error when calling DefaultApi->create_subscription: #{e}"
|
408
514
|
end
|
409
515
|
```
|
410
516
|
|
411
|
-
#### Using the
|
517
|
+
#### Using the create_subscription_with_http_info variant
|
412
518
|
|
413
519
|
This returns an Array which contains the response data, status code and headers.
|
414
520
|
|
415
|
-
> <Array(<
|
521
|
+
> <Array(<InlineResponse201>, Integer, Hash)> create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body)
|
416
522
|
|
417
523
|
```ruby
|
418
524
|
begin
|
419
|
-
|
420
|
-
data, status_code, headers = api_instance.
|
525
|
+
|
526
|
+
data, status_code, headers = api_instance.create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body)
|
421
527
|
p status_code # => 2xx
|
422
528
|
p headers # => { ... }
|
423
|
-
p data # => <
|
529
|
+
p data # => <InlineResponse201>
|
424
530
|
rescue OneSignal::ApiError => e
|
425
|
-
puts "Error when calling DefaultApi->
|
531
|
+
puts "Error when calling DefaultApi->create_subscription_with_http_info: #{e}"
|
426
532
|
end
|
427
533
|
```
|
428
534
|
|
@@ -430,12 +536,14 @@ end
|
|
430
536
|
|
431
537
|
| Name | Type | Description | Notes |
|
432
538
|
| ---- | ---- | ----------- | ----- |
|
433
|
-
| **app_id** | **String** |
|
434
|
-
| **
|
539
|
+
| **app_id** | **String** | | |
|
540
|
+
| **alias_label** | **String** | | |
|
541
|
+
| **alias_id** | **String** | | |
|
542
|
+
| **create_subscription_request_body** | [**CreateSubscriptionRequestBody**](CreateSubscriptionRequestBody.md) | | |
|
435
543
|
|
436
544
|
### Return type
|
437
545
|
|
438
|
-
[**
|
546
|
+
[**InlineResponse201**](InlineResponse201.md)
|
439
547
|
|
440
548
|
### Authorization
|
441
549
|
|
@@ -443,17 +551,17 @@ end
|
|
443
551
|
|
444
552
|
### HTTP request headers
|
445
553
|
|
446
|
-
- **Content-Type**:
|
554
|
+
- **Content-Type**: application/json
|
447
555
|
- **Accept**: application/json
|
448
556
|
|
449
557
|
|
450
|
-
##
|
558
|
+
## create_user
|
451
559
|
|
452
|
-
> <
|
560
|
+
> <User> create_user(app_id, user)
|
453
561
|
|
454
|
-
Delete Segments
|
455
562
|
|
456
|
-
|
563
|
+
|
564
|
+
Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
|
457
565
|
|
458
566
|
### Examples
|
459
567
|
|
@@ -461,39 +569,41 @@ Delete segments (not user devices) - Required: OneSignal Paid Plan You can delet
|
|
461
569
|
require 'onesignal'
|
462
570
|
# setup authorization
|
463
571
|
OneSignal.configure do |config|
|
572
|
+
# Configure Bearer authorization: user_key
|
573
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
464
574
|
# Configure Bearer authorization: app_key
|
465
|
-
config.app_key = '
|
575
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
466
576
|
|
467
577
|
end
|
468
578
|
|
469
579
|
api_instance = OneSignal::DefaultApi.new
|
470
|
-
app_id = 'app_id_example' # String |
|
471
|
-
|
580
|
+
app_id = 'app_id_example' # String |
|
581
|
+
user = OneSignal::User.new # User |
|
472
582
|
|
473
583
|
begin
|
474
|
-
|
475
|
-
result = api_instance.
|
584
|
+
|
585
|
+
result = api_instance.create_user(app_id, user)
|
476
586
|
p result
|
477
587
|
rescue OneSignal::ApiError => e
|
478
|
-
puts "Error when calling DefaultApi->
|
588
|
+
puts "Error when calling DefaultApi->create_user: #{e}"
|
479
589
|
end
|
480
590
|
```
|
481
591
|
|
482
|
-
#### Using the
|
592
|
+
#### Using the create_user_with_http_info variant
|
483
593
|
|
484
594
|
This returns an Array which contains the response data, status code and headers.
|
485
595
|
|
486
|
-
> <Array(<
|
596
|
+
> <Array(<User>, Integer, Hash)> create_user_with_http_info(app_id, user)
|
487
597
|
|
488
598
|
```ruby
|
489
599
|
begin
|
490
|
-
|
491
|
-
data, status_code, headers = api_instance.
|
600
|
+
|
601
|
+
data, status_code, headers = api_instance.create_user_with_http_info(app_id, user)
|
492
602
|
p status_code # => 2xx
|
493
603
|
p headers # => { ... }
|
494
|
-
p data # => <
|
604
|
+
p data # => <User>
|
495
605
|
rescue OneSignal::ApiError => e
|
496
|
-
puts "Error when calling DefaultApi->
|
606
|
+
puts "Error when calling DefaultApi->create_user_with_http_info: #{e}"
|
497
607
|
end
|
498
608
|
```
|
499
609
|
|
@@ -501,12 +611,12 @@ end
|
|
501
611
|
|
502
612
|
| Name | Type | Description | Notes |
|
503
613
|
| ---- | ---- | ----------- | ----- |
|
504
|
-
| **app_id** | **String** |
|
505
|
-
| **
|
614
|
+
| **app_id** | **String** | | |
|
615
|
+
| **user** | [**User**](User.md) | | |
|
506
616
|
|
507
617
|
### Return type
|
508
618
|
|
509
|
-
[**
|
619
|
+
[**User**](User.md)
|
510
620
|
|
511
621
|
### Authorization
|
512
622
|
|
@@ -514,17 +624,17 @@ end
|
|
514
624
|
|
515
625
|
### HTTP request headers
|
516
626
|
|
517
|
-
- **Content-Type**:
|
627
|
+
- **Content-Type**: application/json
|
518
628
|
- **Accept**: application/json
|
519
629
|
|
520
630
|
|
521
|
-
##
|
631
|
+
## delete_alias
|
522
632
|
|
523
|
-
> <
|
633
|
+
> <InlineResponse200> delete_alias(app_id, alias_label, alias_id, alias_label_to_delete)
|
524
634
|
|
525
|
-
CSV export
|
526
635
|
|
527
|
-
|
636
|
+
|
637
|
+
Deletes an alias by alias label
|
528
638
|
|
529
639
|
### Examples
|
530
640
|
|
@@ -532,41 +642,43 @@ Generate a compressed CSV export of all of your current user data This method ca
|
|
532
642
|
require 'onesignal'
|
533
643
|
# setup authorization
|
534
644
|
OneSignal.configure do |config|
|
645
|
+
# Configure Bearer authorization: user_key
|
646
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
535
647
|
# Configure Bearer authorization: app_key
|
536
|
-
config.app_key = '
|
648
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
537
649
|
|
538
650
|
end
|
539
651
|
|
540
652
|
api_instance = OneSignal::DefaultApi.new
|
541
|
-
app_id = 'app_id_example' # String |
|
542
|
-
|
543
|
-
|
544
|
-
|
653
|
+
app_id = 'app_id_example' # String |
|
654
|
+
alias_label = 'alias_label_example' # String |
|
655
|
+
alias_id = 'alias_id_example' # String |
|
656
|
+
alias_label_to_delete = 'alias_label_to_delete_example' # String |
|
545
657
|
|
546
658
|
begin
|
547
|
-
|
548
|
-
result = api_instance.
|
659
|
+
|
660
|
+
result = api_instance.delete_alias(app_id, alias_label, alias_id, alias_label_to_delete)
|
549
661
|
p result
|
550
662
|
rescue OneSignal::ApiError => e
|
551
|
-
puts "Error when calling DefaultApi->
|
663
|
+
puts "Error when calling DefaultApi->delete_alias: #{e}"
|
552
664
|
end
|
553
665
|
```
|
554
666
|
|
555
|
-
#### Using the
|
667
|
+
#### Using the delete_alias_with_http_info variant
|
556
668
|
|
557
669
|
This returns an Array which contains the response data, status code and headers.
|
558
670
|
|
559
|
-
> <Array(<
|
671
|
+
> <Array(<InlineResponse200>, Integer, Hash)> delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete)
|
560
672
|
|
561
673
|
```ruby
|
562
674
|
begin
|
563
|
-
|
564
|
-
data, status_code, headers = api_instance.
|
675
|
+
|
676
|
+
data, status_code, headers = api_instance.delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete)
|
565
677
|
p status_code # => 2xx
|
566
678
|
p headers # => { ... }
|
567
|
-
p data # => <
|
679
|
+
p data # => <InlineResponse200>
|
568
680
|
rescue OneSignal::ApiError => e
|
569
|
-
puts "Error when calling DefaultApi->
|
681
|
+
puts "Error when calling DefaultApi->delete_alias_with_http_info: #{e}"
|
570
682
|
end
|
571
683
|
```
|
572
684
|
|
@@ -574,12 +686,14 @@ end
|
|
574
686
|
|
575
687
|
| Name | Type | Description | Notes |
|
576
688
|
| ---- | ---- | ----------- | ----- |
|
577
|
-
| **app_id** | **String** |
|
578
|
-
| **
|
689
|
+
| **app_id** | **String** | | |
|
690
|
+
| **alias_label** | **String** | | |
|
691
|
+
| **alias_id** | **String** | | |
|
692
|
+
| **alias_label_to_delete** | **String** | | |
|
579
693
|
|
580
694
|
### Return type
|
581
695
|
|
582
|
-
[**
|
696
|
+
[**InlineResponse200**](InlineResponse200.md)
|
583
697
|
|
584
698
|
### Authorization
|
585
699
|
|
@@ -587,17 +701,17 @@ end
|
|
587
701
|
|
588
702
|
### HTTP request headers
|
589
703
|
|
590
|
-
- **Content-Type**:
|
704
|
+
- **Content-Type**: Not defined
|
591
705
|
- **Accept**: application/json
|
592
706
|
|
593
707
|
|
594
|
-
##
|
708
|
+
## delete_player
|
595
709
|
|
596
|
-
> <
|
710
|
+
> <DeletePlayerSuccessResponse> delete_player(app_id, player_id)
|
597
711
|
|
598
|
-
|
712
|
+
Delete a user record
|
599
713
|
|
600
|
-
|
714
|
+
Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
|
601
715
|
|
602
716
|
### Examples
|
603
717
|
|
@@ -606,37 +720,40 @@ require 'onesignal'
|
|
606
720
|
# setup authorization
|
607
721
|
OneSignal.configure do |config|
|
608
722
|
# Configure Bearer authorization: user_key
|
609
|
-
config.user_key = '
|
723
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
724
|
+
# Configure Bearer authorization: app_key
|
725
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
610
726
|
|
611
727
|
end
|
612
728
|
|
613
729
|
api_instance = OneSignal::DefaultApi.new
|
614
|
-
app_id = 'app_id_example' # String |
|
730
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
731
|
+
player_id = 'player_id_example' # String | The OneSignal player_id
|
615
732
|
|
616
733
|
begin
|
617
|
-
#
|
618
|
-
result = api_instance.
|
734
|
+
# Delete a user record
|
735
|
+
result = api_instance.delete_player(app_id, player_id)
|
619
736
|
p result
|
620
737
|
rescue OneSignal::ApiError => e
|
621
|
-
puts "Error when calling DefaultApi->
|
738
|
+
puts "Error when calling DefaultApi->delete_player: #{e}"
|
622
739
|
end
|
623
740
|
```
|
624
741
|
|
625
|
-
#### Using the
|
742
|
+
#### Using the delete_player_with_http_info variant
|
626
743
|
|
627
744
|
This returns an Array which contains the response data, status code and headers.
|
628
745
|
|
629
|
-
> <Array(<
|
746
|
+
> <Array(<DeletePlayerSuccessResponse>, Integer, Hash)> delete_player_with_http_info(app_id, player_id)
|
630
747
|
|
631
748
|
```ruby
|
632
749
|
begin
|
633
|
-
#
|
634
|
-
data, status_code, headers = api_instance.
|
750
|
+
# Delete a user record
|
751
|
+
data, status_code, headers = api_instance.delete_player_with_http_info(app_id, player_id)
|
635
752
|
p status_code # => 2xx
|
636
753
|
p headers # => { ... }
|
637
|
-
p data # => <
|
754
|
+
p data # => <DeletePlayerSuccessResponse>
|
638
755
|
rescue OneSignal::ApiError => e
|
639
|
-
puts "Error when calling DefaultApi->
|
756
|
+
puts "Error when calling DefaultApi->delete_player_with_http_info: #{e}"
|
640
757
|
end
|
641
758
|
```
|
642
759
|
|
@@ -644,15 +761,16 @@ end
|
|
644
761
|
|
645
762
|
| Name | Type | Description | Notes |
|
646
763
|
| ---- | ---- | ----------- | ----- |
|
647
|
-
| **app_id** | **String** |
|
764
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
765
|
+
| **player_id** | **String** | The OneSignal player_id | |
|
648
766
|
|
649
767
|
### Return type
|
650
768
|
|
651
|
-
[**
|
769
|
+
[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md)
|
652
770
|
|
653
771
|
### Authorization
|
654
772
|
|
655
|
-
[
|
773
|
+
[app_key](../README.md#app_key)
|
656
774
|
|
657
775
|
### HTTP request headers
|
658
776
|
|
@@ -660,13 +778,13 @@ end
|
|
660
778
|
- **Accept**: application/json
|
661
779
|
|
662
780
|
|
663
|
-
##
|
781
|
+
## delete_segments
|
664
782
|
|
665
|
-
> <
|
783
|
+
> <DeleteSegmentSuccessResponse> delete_segments(app_id, segment_id)
|
666
784
|
|
667
|
-
|
785
|
+
Delete Segments
|
668
786
|
|
669
|
-
|
787
|
+
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.
|
670
788
|
|
671
789
|
### Examples
|
672
790
|
|
@@ -675,50 +793,57 @@ require 'onesignal'
|
|
675
793
|
# setup authorization
|
676
794
|
OneSignal.configure do |config|
|
677
795
|
# Configure Bearer authorization: user_key
|
678
|
-
config.user_key = '
|
796
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
797
|
+
# Configure Bearer authorization: app_key
|
798
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
679
799
|
|
680
800
|
end
|
681
801
|
|
682
802
|
api_instance = OneSignal::DefaultApi.new
|
803
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
804
|
+
segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
683
805
|
|
684
806
|
begin
|
685
|
-
#
|
686
|
-
result = api_instance.
|
807
|
+
# Delete Segments
|
808
|
+
result = api_instance.delete_segments(app_id, segment_id)
|
687
809
|
p result
|
688
810
|
rescue OneSignal::ApiError => e
|
689
|
-
puts "Error when calling DefaultApi->
|
811
|
+
puts "Error when calling DefaultApi->delete_segments: #{e}"
|
690
812
|
end
|
691
813
|
```
|
692
814
|
|
693
|
-
#### Using the
|
815
|
+
#### Using the delete_segments_with_http_info variant
|
694
816
|
|
695
817
|
This returns an Array which contains the response data, status code and headers.
|
696
818
|
|
697
|
-
> <Array(<
|
819
|
+
> <Array(<DeleteSegmentSuccessResponse>, Integer, Hash)> delete_segments_with_http_info(app_id, segment_id)
|
698
820
|
|
699
821
|
```ruby
|
700
822
|
begin
|
701
|
-
#
|
702
|
-
data, status_code, headers = api_instance.
|
823
|
+
# Delete Segments
|
824
|
+
data, status_code, headers = api_instance.delete_segments_with_http_info(app_id, segment_id)
|
703
825
|
p status_code # => 2xx
|
704
826
|
p headers # => { ... }
|
705
|
-
p data # => <
|
827
|
+
p data # => <DeleteSegmentSuccessResponse>
|
706
828
|
rescue OneSignal::ApiError => e
|
707
|
-
puts "Error when calling DefaultApi->
|
829
|
+
puts "Error when calling DefaultApi->delete_segments_with_http_info: #{e}"
|
708
830
|
end
|
709
831
|
```
|
710
832
|
|
711
833
|
### Parameters
|
712
834
|
|
713
|
-
|
835
|
+
| Name | Type | Description | Notes |
|
836
|
+
| ---- | ---- | ----------- | ----- |
|
837
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
838
|
+
| **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | |
|
714
839
|
|
715
840
|
### Return type
|
716
841
|
|
717
|
-
[**
|
842
|
+
[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md)
|
718
843
|
|
719
844
|
### Authorization
|
720
845
|
|
721
|
-
[
|
846
|
+
[app_key](../README.md#app_key)
|
722
847
|
|
723
848
|
### HTTP request headers
|
724
849
|
|
@@ -726,13 +851,13 @@ This endpoint does not need any parameter.
|
|
726
851
|
- **Accept**: application/json
|
727
852
|
|
728
853
|
|
729
|
-
##
|
854
|
+
## delete_subscription
|
730
855
|
|
731
|
-
>
|
856
|
+
> delete_subscription(app_id, subscription_id)
|
732
857
|
|
733
|
-
View notification
|
734
858
|
|
735
|
-
|
859
|
+
|
860
|
+
Deletes the Subscription.
|
736
861
|
|
737
862
|
### Examples
|
738
863
|
|
@@ -740,39 +865,40 @@ View the details of a single notification and outcomes associated with it
|
|
740
865
|
require 'onesignal'
|
741
866
|
# setup authorization
|
742
867
|
OneSignal.configure do |config|
|
868
|
+
# Configure Bearer authorization: user_key
|
869
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
743
870
|
# Configure Bearer authorization: app_key
|
744
|
-
config.app_key = '
|
871
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
745
872
|
|
746
873
|
end
|
747
874
|
|
748
875
|
api_instance = OneSignal::DefaultApi.new
|
749
876
|
app_id = 'app_id_example' # String |
|
750
|
-
|
877
|
+
subscription_id = 'subscription_id_example' # String |
|
751
878
|
|
752
879
|
begin
|
753
|
-
|
754
|
-
|
755
|
-
p result
|
880
|
+
|
881
|
+
api_instance.delete_subscription(app_id, subscription_id)
|
756
882
|
rescue OneSignal::ApiError => e
|
757
|
-
puts "Error when calling DefaultApi->
|
883
|
+
puts "Error when calling DefaultApi->delete_subscription: #{e}"
|
758
884
|
end
|
759
885
|
```
|
760
886
|
|
761
|
-
#### Using the
|
887
|
+
#### Using the delete_subscription_with_http_info variant
|
762
888
|
|
763
|
-
This returns an Array which contains the response data, status code and headers.
|
889
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
764
890
|
|
765
|
-
> <Array(
|
891
|
+
> <Array(nil, Integer, Hash)> delete_subscription_with_http_info(app_id, subscription_id)
|
766
892
|
|
767
893
|
```ruby
|
768
894
|
begin
|
769
|
-
|
770
|
-
data, status_code, headers = api_instance.
|
895
|
+
|
896
|
+
data, status_code, headers = api_instance.delete_subscription_with_http_info(app_id, subscription_id)
|
771
897
|
p status_code # => 2xx
|
772
898
|
p headers # => { ... }
|
773
|
-
p data # =>
|
899
|
+
p data # => nil
|
774
900
|
rescue OneSignal::ApiError => e
|
775
|
-
puts "Error when calling DefaultApi->
|
901
|
+
puts "Error when calling DefaultApi->delete_subscription_with_http_info: #{e}"
|
776
902
|
end
|
777
903
|
```
|
778
904
|
|
@@ -781,11 +907,11 @@ end
|
|
781
907
|
| Name | Type | Description | Notes |
|
782
908
|
| ---- | ---- | ----------- | ----- |
|
783
909
|
| **app_id** | **String** | | |
|
784
|
-
| **
|
910
|
+
| **subscription_id** | **String** | | |
|
785
911
|
|
786
912
|
### Return type
|
787
913
|
|
788
|
-
|
914
|
+
nil (empty response body)
|
789
915
|
|
790
916
|
### Authorization
|
791
917
|
|
@@ -797,13 +923,13 @@ end
|
|
797
923
|
- **Accept**: application/json
|
798
924
|
|
799
925
|
|
800
|
-
##
|
926
|
+
## delete_user
|
801
927
|
|
802
|
-
>
|
928
|
+
> delete_user(app_id, alias_label, alias_id)
|
803
929
|
|
804
|
-
Notification History
|
805
930
|
|
806
|
-
|
931
|
+
|
932
|
+
Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
|
807
933
|
|
808
934
|
### Examples
|
809
935
|
|
@@ -811,39 +937,41 @@ Notification History
|
|
811
937
|
require 'onesignal'
|
812
938
|
# setup authorization
|
813
939
|
OneSignal.configure do |config|
|
940
|
+
# Configure Bearer authorization: user_key
|
941
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
814
942
|
# Configure Bearer authorization: app_key
|
815
|
-
config.app_key = '
|
943
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
816
944
|
|
817
945
|
end
|
818
946
|
|
819
947
|
api_instance = OneSignal::DefaultApi.new
|
820
|
-
|
821
|
-
|
948
|
+
app_id = 'app_id_example' # String |
|
949
|
+
alias_label = 'alias_label_example' # String |
|
950
|
+
alias_id = 'alias_id_example' # String |
|
822
951
|
|
823
952
|
begin
|
824
|
-
|
825
|
-
|
826
|
-
p result
|
953
|
+
|
954
|
+
api_instance.delete_user(app_id, alias_label, alias_id)
|
827
955
|
rescue OneSignal::ApiError => e
|
828
|
-
puts "Error when calling DefaultApi->
|
956
|
+
puts "Error when calling DefaultApi->delete_user: #{e}"
|
829
957
|
end
|
830
958
|
```
|
831
959
|
|
832
|
-
#### Using the
|
960
|
+
#### Using the delete_user_with_http_info variant
|
833
961
|
|
834
|
-
This returns an Array which contains the response data, status code and headers.
|
962
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
835
963
|
|
836
|
-
> <Array(
|
964
|
+
> <Array(nil, Integer, Hash)> delete_user_with_http_info(app_id, alias_label, alias_id)
|
837
965
|
|
838
966
|
```ruby
|
839
967
|
begin
|
840
|
-
|
841
|
-
data, status_code, headers = api_instance.
|
968
|
+
|
969
|
+
data, status_code, headers = api_instance.delete_user_with_http_info(app_id, alias_label, alias_id)
|
842
970
|
p status_code # => 2xx
|
843
971
|
p headers # => { ... }
|
844
|
-
p data # =>
|
972
|
+
p data # => nil
|
845
973
|
rescue OneSignal::ApiError => e
|
846
|
-
puts "Error when calling DefaultApi->
|
974
|
+
puts "Error when calling DefaultApi->delete_user_with_http_info: #{e}"
|
847
975
|
end
|
848
976
|
```
|
849
977
|
|
@@ -851,12 +979,13 @@ end
|
|
851
979
|
|
852
980
|
| Name | Type | Description | Notes |
|
853
981
|
| ---- | ---- | ----------- | ----- |
|
854
|
-
| **
|
855
|
-
| **
|
982
|
+
| **app_id** | **String** | | |
|
983
|
+
| **alias_label** | **String** | | |
|
984
|
+
| **alias_id** | **String** | | |
|
856
985
|
|
857
986
|
### Return type
|
858
987
|
|
859
|
-
|
988
|
+
nil (empty response body)
|
860
989
|
|
861
990
|
### Authorization
|
862
991
|
|
@@ -864,17 +993,17 @@ end
|
|
864
993
|
|
865
994
|
### HTTP request headers
|
866
995
|
|
867
|
-
- **Content-Type**:
|
996
|
+
- **Content-Type**: Not defined
|
868
997
|
- **Accept**: application/json
|
869
998
|
|
870
999
|
|
871
|
-
##
|
1000
|
+
## end_live_activity
|
872
1001
|
|
873
|
-
>
|
1002
|
+
> end_live_activity(app_id, activity_id, subscription_id)
|
874
1003
|
|
875
|
-
|
1004
|
+
Stop Live Activity
|
876
1005
|
|
877
|
-
|
1006
|
+
Stops a Live Activity
|
878
1007
|
|
879
1008
|
### Examples
|
880
1009
|
|
@@ -882,41 +1011,846 @@ View the details of multiple notifications
|
|
882
1011
|
require 'onesignal'
|
883
1012
|
# setup authorization
|
884
1013
|
OneSignal.configure do |config|
|
1014
|
+
# Configure Bearer authorization: user_key
|
1015
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
885
1016
|
# Configure Bearer authorization: app_key
|
886
|
-
config.app_key = '
|
1017
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
887
1018
|
|
888
1019
|
end
|
889
1020
|
|
890
1021
|
api_instance = OneSignal::DefaultApi.new
|
891
|
-
app_id = 'app_id_example' # String | The
|
892
|
-
|
893
|
-
|
894
|
-
offset: 56, # Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
|
895
|
-
kind: 0 # Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
|
896
|
-
}
|
1022
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
1023
|
+
activity_id = 'activity_id_example' # String | Live Activity record ID
|
1024
|
+
subscription_id = 'subscription_id_example' # String | Subscription ID
|
897
1025
|
|
898
1026
|
begin
|
899
|
-
#
|
900
|
-
|
901
|
-
p result
|
1027
|
+
# Stop Live Activity
|
1028
|
+
api_instance.end_live_activity(app_id, activity_id, subscription_id)
|
902
1029
|
rescue OneSignal::ApiError => e
|
903
|
-
puts "Error when calling DefaultApi->
|
1030
|
+
puts "Error when calling DefaultApi->end_live_activity: #{e}"
|
904
1031
|
end
|
905
1032
|
```
|
906
1033
|
|
907
|
-
#### Using the
|
1034
|
+
#### Using the end_live_activity_with_http_info variant
|
908
1035
|
|
909
|
-
This returns an Array which contains the response data, status code and headers.
|
1036
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
910
1037
|
|
911
|
-
> <Array(
|
1038
|
+
> <Array(nil, Integer, Hash)> end_live_activity_with_http_info(app_id, activity_id, subscription_id)
|
912
1039
|
|
913
1040
|
```ruby
|
914
1041
|
begin
|
915
|
-
#
|
916
|
-
data, status_code, headers = api_instance.
|
1042
|
+
# Stop Live Activity
|
1043
|
+
data, status_code, headers = api_instance.end_live_activity_with_http_info(app_id, activity_id, subscription_id)
|
917
1044
|
p status_code # => 2xx
|
918
1045
|
p headers # => { ... }
|
919
|
-
p data # =>
|
1046
|
+
p data # => nil
|
1047
|
+
rescue OneSignal::ApiError => e
|
1048
|
+
puts "Error when calling DefaultApi->end_live_activity_with_http_info: #{e}"
|
1049
|
+
end
|
1050
|
+
```
|
1051
|
+
|
1052
|
+
### Parameters
|
1053
|
+
|
1054
|
+
| Name | Type | Description | Notes |
|
1055
|
+
| ---- | ---- | ----------- | ----- |
|
1056
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
1057
|
+
| **activity_id** | **String** | Live Activity record ID | |
|
1058
|
+
| **subscription_id** | **String** | Subscription ID | |
|
1059
|
+
|
1060
|
+
### Return type
|
1061
|
+
|
1062
|
+
nil (empty response body)
|
1063
|
+
|
1064
|
+
### Authorization
|
1065
|
+
|
1066
|
+
[app_key](../README.md#app_key)
|
1067
|
+
|
1068
|
+
### HTTP request headers
|
1069
|
+
|
1070
|
+
- **Content-Type**: Not defined
|
1071
|
+
- **Accept**: application/json
|
1072
|
+
|
1073
|
+
|
1074
|
+
## export_events
|
1075
|
+
|
1076
|
+
> <ExportEventsSuccessResponse> export_events(notification_id, app_id)
|
1077
|
+
|
1078
|
+
Export CSV of Events
|
1079
|
+
|
1080
|
+
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.
|
1081
|
+
|
1082
|
+
### Examples
|
1083
|
+
|
1084
|
+
```ruby
|
1085
|
+
require 'onesignal'
|
1086
|
+
# setup authorization
|
1087
|
+
OneSignal.configure do |config|
|
1088
|
+
# Configure Bearer authorization: user_key
|
1089
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1090
|
+
# Configure Bearer authorization: app_key
|
1091
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1092
|
+
|
1093
|
+
end
|
1094
|
+
|
1095
|
+
api_instance = OneSignal::DefaultApi.new
|
1096
|
+
notification_id = 'notification_id_example' # String | The ID of the notification to export events from.
|
1097
|
+
app_id = 'app_id_example' # String | The ID of the app that the notification belongs to.
|
1098
|
+
|
1099
|
+
begin
|
1100
|
+
# Export CSV of Events
|
1101
|
+
result = api_instance.export_events(notification_id, app_id)
|
1102
|
+
p result
|
1103
|
+
rescue OneSignal::ApiError => e
|
1104
|
+
puts "Error when calling DefaultApi->export_events: #{e}"
|
1105
|
+
end
|
1106
|
+
```
|
1107
|
+
|
1108
|
+
#### Using the export_events_with_http_info variant
|
1109
|
+
|
1110
|
+
This returns an Array which contains the response data, status code and headers.
|
1111
|
+
|
1112
|
+
> <Array(<ExportEventsSuccessResponse>, Integer, Hash)> export_events_with_http_info(notification_id, app_id)
|
1113
|
+
|
1114
|
+
```ruby
|
1115
|
+
begin
|
1116
|
+
# Export CSV of Events
|
1117
|
+
data, status_code, headers = api_instance.export_events_with_http_info(notification_id, app_id)
|
1118
|
+
p status_code # => 2xx
|
1119
|
+
p headers # => { ... }
|
1120
|
+
p data # => <ExportEventsSuccessResponse>
|
1121
|
+
rescue OneSignal::ApiError => e
|
1122
|
+
puts "Error when calling DefaultApi->export_events_with_http_info: #{e}"
|
1123
|
+
end
|
1124
|
+
```
|
1125
|
+
|
1126
|
+
### Parameters
|
1127
|
+
|
1128
|
+
| Name | Type | Description | Notes |
|
1129
|
+
| ---- | ---- | ----------- | ----- |
|
1130
|
+
| **notification_id** | **String** | The ID of the notification to export events from. | |
|
1131
|
+
| **app_id** | **String** | The ID of the app that the notification belongs to. | |
|
1132
|
+
|
1133
|
+
### Return type
|
1134
|
+
|
1135
|
+
[**ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md)
|
1136
|
+
|
1137
|
+
### Authorization
|
1138
|
+
|
1139
|
+
[app_key](../README.md#app_key)
|
1140
|
+
|
1141
|
+
### HTTP request headers
|
1142
|
+
|
1143
|
+
- **Content-Type**: Not defined
|
1144
|
+
- **Accept**: application/json
|
1145
|
+
|
1146
|
+
|
1147
|
+
## export_players
|
1148
|
+
|
1149
|
+
> <ExportPlayersSuccessResponse> export_players(app_id, opts)
|
1150
|
+
|
1151
|
+
Export CSV of Players
|
1152
|
+
|
1153
|
+
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. |
|
1154
|
+
|
1155
|
+
### Examples
|
1156
|
+
|
1157
|
+
```ruby
|
1158
|
+
require 'onesignal'
|
1159
|
+
# setup authorization
|
1160
|
+
OneSignal.configure do |config|
|
1161
|
+
# Configure Bearer authorization: user_key
|
1162
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1163
|
+
# Configure Bearer authorization: app_key
|
1164
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1165
|
+
|
1166
|
+
end
|
1167
|
+
|
1168
|
+
api_instance = OneSignal::DefaultApi.new
|
1169
|
+
app_id = 'app_id_example' # String | The app ID that you want to export devices from
|
1170
|
+
opts = {
|
1171
|
+
export_players_request_body: OneSignal::ExportPlayersRequestBody.new # ExportPlayersRequestBody |
|
1172
|
+
}
|
1173
|
+
|
1174
|
+
begin
|
1175
|
+
# Export CSV of Players
|
1176
|
+
result = api_instance.export_players(app_id, opts)
|
1177
|
+
p result
|
1178
|
+
rescue OneSignal::ApiError => e
|
1179
|
+
puts "Error when calling DefaultApi->export_players: #{e}"
|
1180
|
+
end
|
1181
|
+
```
|
1182
|
+
|
1183
|
+
#### Using the export_players_with_http_info variant
|
1184
|
+
|
1185
|
+
This returns an Array which contains the response data, status code and headers.
|
1186
|
+
|
1187
|
+
> <Array(<ExportPlayersSuccessResponse>, Integer, Hash)> export_players_with_http_info(app_id, opts)
|
1188
|
+
|
1189
|
+
```ruby
|
1190
|
+
begin
|
1191
|
+
# Export CSV of Players
|
1192
|
+
data, status_code, headers = api_instance.export_players_with_http_info(app_id, opts)
|
1193
|
+
p status_code # => 2xx
|
1194
|
+
p headers # => { ... }
|
1195
|
+
p data # => <ExportPlayersSuccessResponse>
|
1196
|
+
rescue OneSignal::ApiError => e
|
1197
|
+
puts "Error when calling DefaultApi->export_players_with_http_info: #{e}"
|
1198
|
+
end
|
1199
|
+
```
|
1200
|
+
|
1201
|
+
### Parameters
|
1202
|
+
|
1203
|
+
| Name | Type | Description | Notes |
|
1204
|
+
| ---- | ---- | ----------- | ----- |
|
1205
|
+
| **app_id** | **String** | The app ID that you want to export devices from | |
|
1206
|
+
| **export_players_request_body** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md) | | [optional] |
|
1207
|
+
|
1208
|
+
### Return type
|
1209
|
+
|
1210
|
+
[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md)
|
1211
|
+
|
1212
|
+
### Authorization
|
1213
|
+
|
1214
|
+
[app_key](../README.md#app_key)
|
1215
|
+
|
1216
|
+
### HTTP request headers
|
1217
|
+
|
1218
|
+
- **Content-Type**: application/json
|
1219
|
+
- **Accept**: application/json
|
1220
|
+
|
1221
|
+
|
1222
|
+
## fetch_aliases
|
1223
|
+
|
1224
|
+
> <UserIdentityResponse> fetch_aliases(app_id, subscription_id)
|
1225
|
+
|
1226
|
+
|
1227
|
+
|
1228
|
+
Lists all Aliases for the User identified by :subscription_id.
|
1229
|
+
|
1230
|
+
### Examples
|
1231
|
+
|
1232
|
+
```ruby
|
1233
|
+
require 'onesignal'
|
1234
|
+
# setup authorization
|
1235
|
+
OneSignal.configure do |config|
|
1236
|
+
# Configure Bearer authorization: user_key
|
1237
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1238
|
+
# Configure Bearer authorization: app_key
|
1239
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1240
|
+
|
1241
|
+
end
|
1242
|
+
|
1243
|
+
api_instance = OneSignal::DefaultApi.new
|
1244
|
+
app_id = 'app_id_example' # String |
|
1245
|
+
subscription_id = 'subscription_id_example' # String |
|
1246
|
+
|
1247
|
+
begin
|
1248
|
+
|
1249
|
+
result = api_instance.fetch_aliases(app_id, subscription_id)
|
1250
|
+
p result
|
1251
|
+
rescue OneSignal::ApiError => e
|
1252
|
+
puts "Error when calling DefaultApi->fetch_aliases: #{e}"
|
1253
|
+
end
|
1254
|
+
```
|
1255
|
+
|
1256
|
+
#### Using the fetch_aliases_with_http_info variant
|
1257
|
+
|
1258
|
+
This returns an Array which contains the response data, status code and headers.
|
1259
|
+
|
1260
|
+
> <Array(<UserIdentityResponse>, Integer, Hash)> fetch_aliases_with_http_info(app_id, subscription_id)
|
1261
|
+
|
1262
|
+
```ruby
|
1263
|
+
begin
|
1264
|
+
|
1265
|
+
data, status_code, headers = api_instance.fetch_aliases_with_http_info(app_id, subscription_id)
|
1266
|
+
p status_code # => 2xx
|
1267
|
+
p headers # => { ... }
|
1268
|
+
p data # => <UserIdentityResponse>
|
1269
|
+
rescue OneSignal::ApiError => e
|
1270
|
+
puts "Error when calling DefaultApi->fetch_aliases_with_http_info: #{e}"
|
1271
|
+
end
|
1272
|
+
```
|
1273
|
+
|
1274
|
+
### Parameters
|
1275
|
+
|
1276
|
+
| Name | Type | Description | Notes |
|
1277
|
+
| ---- | ---- | ----------- | ----- |
|
1278
|
+
| **app_id** | **String** | | |
|
1279
|
+
| **subscription_id** | **String** | | |
|
1280
|
+
|
1281
|
+
### Return type
|
1282
|
+
|
1283
|
+
[**UserIdentityResponse**](UserIdentityResponse.md)
|
1284
|
+
|
1285
|
+
### Authorization
|
1286
|
+
|
1287
|
+
[app_key](../README.md#app_key)
|
1288
|
+
|
1289
|
+
### HTTP request headers
|
1290
|
+
|
1291
|
+
- **Content-Type**: Not defined
|
1292
|
+
- **Accept**: application/json
|
1293
|
+
|
1294
|
+
|
1295
|
+
## fetch_user
|
1296
|
+
|
1297
|
+
> <User> fetch_user(app_id, alias_label, alias_id)
|
1298
|
+
|
1299
|
+
|
1300
|
+
|
1301
|
+
Returns the User’s properties, Aliases, and Subscriptions.
|
1302
|
+
|
1303
|
+
### Examples
|
1304
|
+
|
1305
|
+
```ruby
|
1306
|
+
require 'onesignal'
|
1307
|
+
# setup authorization
|
1308
|
+
OneSignal.configure do |config|
|
1309
|
+
# Configure Bearer authorization: user_key
|
1310
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1311
|
+
# Configure Bearer authorization: app_key
|
1312
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1313
|
+
|
1314
|
+
end
|
1315
|
+
|
1316
|
+
api_instance = OneSignal::DefaultApi.new
|
1317
|
+
app_id = 'app_id_example' # String |
|
1318
|
+
alias_label = 'alias_label_example' # String |
|
1319
|
+
alias_id = 'alias_id_example' # String |
|
1320
|
+
|
1321
|
+
begin
|
1322
|
+
|
1323
|
+
result = api_instance.fetch_user(app_id, alias_label, alias_id)
|
1324
|
+
p result
|
1325
|
+
rescue OneSignal::ApiError => e
|
1326
|
+
puts "Error when calling DefaultApi->fetch_user: #{e}"
|
1327
|
+
end
|
1328
|
+
```
|
1329
|
+
|
1330
|
+
#### Using the fetch_user_with_http_info variant
|
1331
|
+
|
1332
|
+
This returns an Array which contains the response data, status code and headers.
|
1333
|
+
|
1334
|
+
> <Array(<User>, Integer, Hash)> fetch_user_with_http_info(app_id, alias_label, alias_id)
|
1335
|
+
|
1336
|
+
```ruby
|
1337
|
+
begin
|
1338
|
+
|
1339
|
+
data, status_code, headers = api_instance.fetch_user_with_http_info(app_id, alias_label, alias_id)
|
1340
|
+
p status_code # => 2xx
|
1341
|
+
p headers # => { ... }
|
1342
|
+
p data # => <User>
|
1343
|
+
rescue OneSignal::ApiError => e
|
1344
|
+
puts "Error when calling DefaultApi->fetch_user_with_http_info: #{e}"
|
1345
|
+
end
|
1346
|
+
```
|
1347
|
+
|
1348
|
+
### Parameters
|
1349
|
+
|
1350
|
+
| Name | Type | Description | Notes |
|
1351
|
+
| ---- | ---- | ----------- | ----- |
|
1352
|
+
| **app_id** | **String** | | |
|
1353
|
+
| **alias_label** | **String** | | |
|
1354
|
+
| **alias_id** | **String** | | |
|
1355
|
+
|
1356
|
+
### Return type
|
1357
|
+
|
1358
|
+
[**User**](User.md)
|
1359
|
+
|
1360
|
+
### Authorization
|
1361
|
+
|
1362
|
+
[app_key](../README.md#app_key)
|
1363
|
+
|
1364
|
+
### HTTP request headers
|
1365
|
+
|
1366
|
+
- **Content-Type**: Not defined
|
1367
|
+
- **Accept**: application/json
|
1368
|
+
|
1369
|
+
|
1370
|
+
## fetch_user_identity
|
1371
|
+
|
1372
|
+
> <InlineResponse200> fetch_user_identity(app_id, alias_label, alias_id)
|
1373
|
+
|
1374
|
+
|
1375
|
+
|
1376
|
+
Lists all Aliases for the User identified by (:alias_label, :alias_id).
|
1377
|
+
|
1378
|
+
### Examples
|
1379
|
+
|
1380
|
+
```ruby
|
1381
|
+
require 'onesignal'
|
1382
|
+
# setup authorization
|
1383
|
+
OneSignal.configure do |config|
|
1384
|
+
# Configure Bearer authorization: user_key
|
1385
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1386
|
+
# Configure Bearer authorization: app_key
|
1387
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1388
|
+
|
1389
|
+
end
|
1390
|
+
|
1391
|
+
api_instance = OneSignal::DefaultApi.new
|
1392
|
+
app_id = 'app_id_example' # String |
|
1393
|
+
alias_label = 'alias_label_example' # String |
|
1394
|
+
alias_id = 'alias_id_example' # String |
|
1395
|
+
|
1396
|
+
begin
|
1397
|
+
|
1398
|
+
result = api_instance.fetch_user_identity(app_id, alias_label, alias_id)
|
1399
|
+
p result
|
1400
|
+
rescue OneSignal::ApiError => e
|
1401
|
+
puts "Error when calling DefaultApi->fetch_user_identity: #{e}"
|
1402
|
+
end
|
1403
|
+
```
|
1404
|
+
|
1405
|
+
#### Using the fetch_user_identity_with_http_info variant
|
1406
|
+
|
1407
|
+
This returns an Array which contains the response data, status code and headers.
|
1408
|
+
|
1409
|
+
> <Array(<InlineResponse200>, Integer, Hash)> fetch_user_identity_with_http_info(app_id, alias_label, alias_id)
|
1410
|
+
|
1411
|
+
```ruby
|
1412
|
+
begin
|
1413
|
+
|
1414
|
+
data, status_code, headers = api_instance.fetch_user_identity_with_http_info(app_id, alias_label, alias_id)
|
1415
|
+
p status_code # => 2xx
|
1416
|
+
p headers # => { ... }
|
1417
|
+
p data # => <InlineResponse200>
|
1418
|
+
rescue OneSignal::ApiError => e
|
1419
|
+
puts "Error when calling DefaultApi->fetch_user_identity_with_http_info: #{e}"
|
1420
|
+
end
|
1421
|
+
```
|
1422
|
+
|
1423
|
+
### Parameters
|
1424
|
+
|
1425
|
+
| Name | Type | Description | Notes |
|
1426
|
+
| ---- | ---- | ----------- | ----- |
|
1427
|
+
| **app_id** | **String** | | |
|
1428
|
+
| **alias_label** | **String** | | |
|
1429
|
+
| **alias_id** | **String** | | |
|
1430
|
+
|
1431
|
+
### Return type
|
1432
|
+
|
1433
|
+
[**InlineResponse200**](InlineResponse200.md)
|
1434
|
+
|
1435
|
+
### Authorization
|
1436
|
+
|
1437
|
+
[app_key](../README.md#app_key)
|
1438
|
+
|
1439
|
+
### HTTP request headers
|
1440
|
+
|
1441
|
+
- **Content-Type**: Not defined
|
1442
|
+
- **Accept**: application/json
|
1443
|
+
|
1444
|
+
|
1445
|
+
## get_app
|
1446
|
+
|
1447
|
+
> <App> get_app(app_id)
|
1448
|
+
|
1449
|
+
View an app
|
1450
|
+
|
1451
|
+
View the details of a single OneSignal app
|
1452
|
+
|
1453
|
+
### Examples
|
1454
|
+
|
1455
|
+
```ruby
|
1456
|
+
require 'onesignal'
|
1457
|
+
# setup authorization
|
1458
|
+
OneSignal.configure do |config|
|
1459
|
+
# Configure Bearer authorization: user_key
|
1460
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1461
|
+
# Configure Bearer authorization: user_key
|
1462
|
+
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1463
|
+
|
1464
|
+
end
|
1465
|
+
|
1466
|
+
api_instance = OneSignal::DefaultApi.new
|
1467
|
+
app_id = 'app_id_example' # String | An app id
|
1468
|
+
|
1469
|
+
begin
|
1470
|
+
# View an app
|
1471
|
+
result = api_instance.get_app(app_id)
|
1472
|
+
p result
|
1473
|
+
rescue OneSignal::ApiError => e
|
1474
|
+
puts "Error when calling DefaultApi->get_app: #{e}"
|
1475
|
+
end
|
1476
|
+
```
|
1477
|
+
|
1478
|
+
#### Using the get_app_with_http_info variant
|
1479
|
+
|
1480
|
+
This returns an Array which contains the response data, status code and headers.
|
1481
|
+
|
1482
|
+
> <Array(<App>, Integer, Hash)> get_app_with_http_info(app_id)
|
1483
|
+
|
1484
|
+
```ruby
|
1485
|
+
begin
|
1486
|
+
# View an app
|
1487
|
+
data, status_code, headers = api_instance.get_app_with_http_info(app_id)
|
1488
|
+
p status_code # => 2xx
|
1489
|
+
p headers # => { ... }
|
1490
|
+
p data # => <App>
|
1491
|
+
rescue OneSignal::ApiError => e
|
1492
|
+
puts "Error when calling DefaultApi->get_app_with_http_info: #{e}"
|
1493
|
+
end
|
1494
|
+
```
|
1495
|
+
|
1496
|
+
### Parameters
|
1497
|
+
|
1498
|
+
| Name | Type | Description | Notes |
|
1499
|
+
| ---- | ---- | ----------- | ----- |
|
1500
|
+
| **app_id** | **String** | An app id | |
|
1501
|
+
|
1502
|
+
### Return type
|
1503
|
+
|
1504
|
+
[**App**](App.md)
|
1505
|
+
|
1506
|
+
### Authorization
|
1507
|
+
|
1508
|
+
[user_key](../README.md#user_key)
|
1509
|
+
|
1510
|
+
### HTTP request headers
|
1511
|
+
|
1512
|
+
- **Content-Type**: Not defined
|
1513
|
+
- **Accept**: application/json
|
1514
|
+
|
1515
|
+
|
1516
|
+
## get_apps
|
1517
|
+
|
1518
|
+
> <Array<App>> get_apps
|
1519
|
+
|
1520
|
+
View apps
|
1521
|
+
|
1522
|
+
View the details of all of your current OneSignal apps
|
1523
|
+
|
1524
|
+
### Examples
|
1525
|
+
|
1526
|
+
```ruby
|
1527
|
+
require 'onesignal'
|
1528
|
+
# setup authorization
|
1529
|
+
OneSignal.configure do |config|
|
1530
|
+
# Configure Bearer authorization: user_key
|
1531
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1532
|
+
# Configure Bearer authorization: user_key
|
1533
|
+
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1534
|
+
|
1535
|
+
end
|
1536
|
+
|
1537
|
+
api_instance = OneSignal::DefaultApi.new
|
1538
|
+
|
1539
|
+
begin
|
1540
|
+
# View apps
|
1541
|
+
result = api_instance.get_apps
|
1542
|
+
p result
|
1543
|
+
rescue OneSignal::ApiError => e
|
1544
|
+
puts "Error when calling DefaultApi->get_apps: #{e}"
|
1545
|
+
end
|
1546
|
+
```
|
1547
|
+
|
1548
|
+
#### Using the get_apps_with_http_info variant
|
1549
|
+
|
1550
|
+
This returns an Array which contains the response data, status code and headers.
|
1551
|
+
|
1552
|
+
> <Array(<Array<App>>, Integer, Hash)> get_apps_with_http_info
|
1553
|
+
|
1554
|
+
```ruby
|
1555
|
+
begin
|
1556
|
+
# View apps
|
1557
|
+
data, status_code, headers = api_instance.get_apps_with_http_info
|
1558
|
+
p status_code # => 2xx
|
1559
|
+
p headers # => { ... }
|
1560
|
+
p data # => <Array<App>>
|
1561
|
+
rescue OneSignal::ApiError => e
|
1562
|
+
puts "Error when calling DefaultApi->get_apps_with_http_info: #{e}"
|
1563
|
+
end
|
1564
|
+
```
|
1565
|
+
|
1566
|
+
### Parameters
|
1567
|
+
|
1568
|
+
This endpoint does not need any parameter.
|
1569
|
+
|
1570
|
+
### Return type
|
1571
|
+
|
1572
|
+
[**Array<App>**](App.md)
|
1573
|
+
|
1574
|
+
### Authorization
|
1575
|
+
|
1576
|
+
[user_key](../README.md#user_key)
|
1577
|
+
|
1578
|
+
### HTTP request headers
|
1579
|
+
|
1580
|
+
- **Content-Type**: Not defined
|
1581
|
+
- **Accept**: application/json
|
1582
|
+
|
1583
|
+
|
1584
|
+
## get_eligible_iams
|
1585
|
+
|
1586
|
+
> <InlineResponse2003> get_eligible_iams(app_id, subscription_id)
|
1587
|
+
|
1588
|
+
|
1589
|
+
|
1590
|
+
Manifest of In-App Messages the Subscription is eligible to display by the SDK.
|
1591
|
+
|
1592
|
+
### Examples
|
1593
|
+
|
1594
|
+
```ruby
|
1595
|
+
require 'onesignal'
|
1596
|
+
# setup authorization
|
1597
|
+
OneSignal.configure do |config|
|
1598
|
+
# Configure Bearer authorization: user_key
|
1599
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1600
|
+
# Configure Bearer authorization: app_key
|
1601
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1602
|
+
|
1603
|
+
end
|
1604
|
+
|
1605
|
+
api_instance = OneSignal::DefaultApi.new
|
1606
|
+
app_id = 'app_id_example' # String |
|
1607
|
+
subscription_id = 'subscription_id_example' # String |
|
1608
|
+
|
1609
|
+
begin
|
1610
|
+
|
1611
|
+
result = api_instance.get_eligible_iams(app_id, subscription_id)
|
1612
|
+
p result
|
1613
|
+
rescue OneSignal::ApiError => e
|
1614
|
+
puts "Error when calling DefaultApi->get_eligible_iams: #{e}"
|
1615
|
+
end
|
1616
|
+
```
|
1617
|
+
|
1618
|
+
#### Using the get_eligible_iams_with_http_info variant
|
1619
|
+
|
1620
|
+
This returns an Array which contains the response data, status code and headers.
|
1621
|
+
|
1622
|
+
> <Array(<InlineResponse2003>, Integer, Hash)> get_eligible_iams_with_http_info(app_id, subscription_id)
|
1623
|
+
|
1624
|
+
```ruby
|
1625
|
+
begin
|
1626
|
+
|
1627
|
+
data, status_code, headers = api_instance.get_eligible_iams_with_http_info(app_id, subscription_id)
|
1628
|
+
p status_code # => 2xx
|
1629
|
+
p headers # => { ... }
|
1630
|
+
p data # => <InlineResponse2003>
|
1631
|
+
rescue OneSignal::ApiError => e
|
1632
|
+
puts "Error when calling DefaultApi->get_eligible_iams_with_http_info: #{e}"
|
1633
|
+
end
|
1634
|
+
```
|
1635
|
+
|
1636
|
+
### Parameters
|
1637
|
+
|
1638
|
+
| Name | Type | Description | Notes |
|
1639
|
+
| ---- | ---- | ----------- | ----- |
|
1640
|
+
| **app_id** | **String** | | |
|
1641
|
+
| **subscription_id** | **String** | | |
|
1642
|
+
|
1643
|
+
### Return type
|
1644
|
+
|
1645
|
+
[**InlineResponse2003**](InlineResponse2003.md)
|
1646
|
+
|
1647
|
+
### Authorization
|
1648
|
+
|
1649
|
+
[app_key](../README.md#app_key)
|
1650
|
+
|
1651
|
+
### HTTP request headers
|
1652
|
+
|
1653
|
+
- **Content-Type**: Not defined
|
1654
|
+
- **Accept**: application/json
|
1655
|
+
|
1656
|
+
|
1657
|
+
## get_notification
|
1658
|
+
|
1659
|
+
> <NotificationWithMeta> get_notification(app_id, notification_id)
|
1660
|
+
|
1661
|
+
View notification
|
1662
|
+
|
1663
|
+
View the details of a single notification and outcomes associated with it
|
1664
|
+
|
1665
|
+
### Examples
|
1666
|
+
|
1667
|
+
```ruby
|
1668
|
+
require 'onesignal'
|
1669
|
+
# setup authorization
|
1670
|
+
OneSignal.configure do |config|
|
1671
|
+
# Configure Bearer authorization: user_key
|
1672
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1673
|
+
# Configure Bearer authorization: app_key
|
1674
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1675
|
+
|
1676
|
+
end
|
1677
|
+
|
1678
|
+
api_instance = OneSignal::DefaultApi.new
|
1679
|
+
app_id = 'app_id_example' # String |
|
1680
|
+
notification_id = 'notification_id_example' # String |
|
1681
|
+
|
1682
|
+
begin
|
1683
|
+
# View notification
|
1684
|
+
result = api_instance.get_notification(app_id, notification_id)
|
1685
|
+
p result
|
1686
|
+
rescue OneSignal::ApiError => e
|
1687
|
+
puts "Error when calling DefaultApi->get_notification: #{e}"
|
1688
|
+
end
|
1689
|
+
```
|
1690
|
+
|
1691
|
+
#### Using the get_notification_with_http_info variant
|
1692
|
+
|
1693
|
+
This returns an Array which contains the response data, status code and headers.
|
1694
|
+
|
1695
|
+
> <Array(<NotificationWithMeta>, Integer, Hash)> get_notification_with_http_info(app_id, notification_id)
|
1696
|
+
|
1697
|
+
```ruby
|
1698
|
+
begin
|
1699
|
+
# View notification
|
1700
|
+
data, status_code, headers = api_instance.get_notification_with_http_info(app_id, notification_id)
|
1701
|
+
p status_code # => 2xx
|
1702
|
+
p headers # => { ... }
|
1703
|
+
p data # => <NotificationWithMeta>
|
1704
|
+
rescue OneSignal::ApiError => e
|
1705
|
+
puts "Error when calling DefaultApi->get_notification_with_http_info: #{e}"
|
1706
|
+
end
|
1707
|
+
```
|
1708
|
+
|
1709
|
+
### Parameters
|
1710
|
+
|
1711
|
+
| Name | Type | Description | Notes |
|
1712
|
+
| ---- | ---- | ----------- | ----- |
|
1713
|
+
| **app_id** | **String** | | |
|
1714
|
+
| **notification_id** | **String** | | |
|
1715
|
+
|
1716
|
+
### Return type
|
1717
|
+
|
1718
|
+
[**NotificationWithMeta**](NotificationWithMeta.md)
|
1719
|
+
|
1720
|
+
### Authorization
|
1721
|
+
|
1722
|
+
[app_key](../README.md#app_key)
|
1723
|
+
|
1724
|
+
### HTTP request headers
|
1725
|
+
|
1726
|
+
- **Content-Type**: Not defined
|
1727
|
+
- **Accept**: application/json
|
1728
|
+
|
1729
|
+
|
1730
|
+
## get_notification_history
|
1731
|
+
|
1732
|
+
> <NotificationHistorySuccessResponse> get_notification_history(notification_id, get_notification_request_body)
|
1733
|
+
|
1734
|
+
Notification History
|
1735
|
+
|
1736
|
+
-> 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.
|
1737
|
+
|
1738
|
+
### Examples
|
1739
|
+
|
1740
|
+
```ruby
|
1741
|
+
require 'onesignal'
|
1742
|
+
# setup authorization
|
1743
|
+
OneSignal.configure do |config|
|
1744
|
+
# Configure Bearer authorization: user_key
|
1745
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1746
|
+
# Configure Bearer authorization: app_key
|
1747
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1748
|
+
|
1749
|
+
end
|
1750
|
+
|
1751
|
+
api_instance = OneSignal::DefaultApi.new
|
1752
|
+
notification_id = 'notification_id_example' # String | The \"id\" of the message found in the Notification object
|
1753
|
+
get_notification_request_body = OneSignal::GetNotificationRequestBody.new # GetNotificationRequestBody |
|
1754
|
+
|
1755
|
+
begin
|
1756
|
+
# Notification History
|
1757
|
+
result = api_instance.get_notification_history(notification_id, get_notification_request_body)
|
1758
|
+
p result
|
1759
|
+
rescue OneSignal::ApiError => e
|
1760
|
+
puts "Error when calling DefaultApi->get_notification_history: #{e}"
|
1761
|
+
end
|
1762
|
+
```
|
1763
|
+
|
1764
|
+
#### Using the get_notification_history_with_http_info variant
|
1765
|
+
|
1766
|
+
This returns an Array which contains the response data, status code and headers.
|
1767
|
+
|
1768
|
+
> <Array(<NotificationHistorySuccessResponse>, Integer, Hash)> get_notification_history_with_http_info(notification_id, get_notification_request_body)
|
1769
|
+
|
1770
|
+
```ruby
|
1771
|
+
begin
|
1772
|
+
# Notification History
|
1773
|
+
data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id, get_notification_request_body)
|
1774
|
+
p status_code # => 2xx
|
1775
|
+
p headers # => { ... }
|
1776
|
+
p data # => <NotificationHistorySuccessResponse>
|
1777
|
+
rescue OneSignal::ApiError => e
|
1778
|
+
puts "Error when calling DefaultApi->get_notification_history_with_http_info: #{e}"
|
1779
|
+
end
|
1780
|
+
```
|
1781
|
+
|
1782
|
+
### Parameters
|
1783
|
+
|
1784
|
+
| Name | Type | Description | Notes |
|
1785
|
+
| ---- | ---- | ----------- | ----- |
|
1786
|
+
| **notification_id** | **String** | The \"id\" of the message found in the Notification object | |
|
1787
|
+
| **get_notification_request_body** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md) | | |
|
1788
|
+
|
1789
|
+
### Return type
|
1790
|
+
|
1791
|
+
[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md)
|
1792
|
+
|
1793
|
+
### Authorization
|
1794
|
+
|
1795
|
+
[app_key](../README.md#app_key)
|
1796
|
+
|
1797
|
+
### HTTP request headers
|
1798
|
+
|
1799
|
+
- **Content-Type**: application/json
|
1800
|
+
- **Accept**: application/json
|
1801
|
+
|
1802
|
+
|
1803
|
+
## get_notifications
|
1804
|
+
|
1805
|
+
> <NotificationSlice> get_notifications(app_id, opts)
|
1806
|
+
|
1807
|
+
View notifications
|
1808
|
+
|
1809
|
+
View the details of multiple notifications
|
1810
|
+
|
1811
|
+
### Examples
|
1812
|
+
|
1813
|
+
```ruby
|
1814
|
+
require 'onesignal'
|
1815
|
+
# setup authorization
|
1816
|
+
OneSignal.configure do |config|
|
1817
|
+
# Configure Bearer authorization: user_key
|
1818
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1819
|
+
# Configure Bearer authorization: app_key
|
1820
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1821
|
+
|
1822
|
+
end
|
1823
|
+
|
1824
|
+
api_instance = OneSignal::DefaultApi.new
|
1825
|
+
app_id = 'app_id_example' # String | The app ID that you want to view notifications from
|
1826
|
+
opts = {
|
1827
|
+
limit: 56, # Integer | How many notifications to return. Max is 50. Default is 50.
|
1828
|
+
offset: 56, # Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
|
1829
|
+
kind: 0 # Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
|
1830
|
+
}
|
1831
|
+
|
1832
|
+
begin
|
1833
|
+
# View notifications
|
1834
|
+
result = api_instance.get_notifications(app_id, opts)
|
1835
|
+
p result
|
1836
|
+
rescue OneSignal::ApiError => e
|
1837
|
+
puts "Error when calling DefaultApi->get_notifications: #{e}"
|
1838
|
+
end
|
1839
|
+
```
|
1840
|
+
|
1841
|
+
#### Using the get_notifications_with_http_info variant
|
1842
|
+
|
1843
|
+
This returns an Array which contains the response data, status code and headers.
|
1844
|
+
|
1845
|
+
> <Array(<NotificationSlice>, Integer, Hash)> get_notifications_with_http_info(app_id, opts)
|
1846
|
+
|
1847
|
+
```ruby
|
1848
|
+
begin
|
1849
|
+
# View notifications
|
1850
|
+
data, status_code, headers = api_instance.get_notifications_with_http_info(app_id, opts)
|
1851
|
+
p status_code # => 2xx
|
1852
|
+
p headers # => { ... }
|
1853
|
+
p data # => <NotificationSlice>
|
920
1854
|
rescue OneSignal::ApiError => e
|
921
1855
|
puts "Error when calling DefaultApi->get_notifications_with_http_info: #{e}"
|
922
1856
|
end
|
@@ -926,14 +1860,328 @@ end
|
|
926
1860
|
|
927
1861
|
| Name | Type | Description | Notes |
|
928
1862
|
| ---- | ---- | ----------- | ----- |
|
929
|
-
| **app_id** | **String** | The app ID that you want to view notifications from | |
|
930
|
-
| **limit** | **Integer** | How many notifications to return. Max is 50. Default is 50. | [optional] |
|
931
|
-
| **offset** | **Integer** | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] |
|
932
|
-
| **kind** | **Integer** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] |
|
1863
|
+
| **app_id** | **String** | The app ID that you want to view notifications from | |
|
1864
|
+
| **limit** | **Integer** | How many notifications to return. Max is 50. Default is 50. | [optional] |
|
1865
|
+
| **offset** | **Integer** | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] |
|
1866
|
+
| **kind** | **Integer** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] |
|
1867
|
+
|
1868
|
+
### Return type
|
1869
|
+
|
1870
|
+
[**NotificationSlice**](NotificationSlice.md)
|
1871
|
+
|
1872
|
+
### Authorization
|
1873
|
+
|
1874
|
+
[app_key](../README.md#app_key)
|
1875
|
+
|
1876
|
+
### HTTP request headers
|
1877
|
+
|
1878
|
+
- **Content-Type**: Not defined
|
1879
|
+
- **Accept**: application/json
|
1880
|
+
|
1881
|
+
|
1882
|
+
## get_outcomes
|
1883
|
+
|
1884
|
+
> <OutcomesData> get_outcomes(app_id, outcome_names, opts)
|
1885
|
+
|
1886
|
+
View Outcomes
|
1887
|
+
|
1888
|
+
View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it.
|
1889
|
+
|
1890
|
+
### Examples
|
1891
|
+
|
1892
|
+
```ruby
|
1893
|
+
require 'onesignal'
|
1894
|
+
# setup authorization
|
1895
|
+
OneSignal.configure do |config|
|
1896
|
+
# Configure Bearer authorization: user_key
|
1897
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1898
|
+
# Configure Bearer authorization: app_key
|
1899
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1900
|
+
|
1901
|
+
end
|
1902
|
+
|
1903
|
+
api_instance = OneSignal::DefaultApi.new
|
1904
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
1905
|
+
outcome_names = 'outcome_names_example' # String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum
|
1906
|
+
opts = {
|
1907
|
+
outcome_names2: 'outcome_names_example', # String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name.
|
1908
|
+
outcome_time_range: 'outcome_time_range_example', # String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted.
|
1909
|
+
outcome_platforms: 'outcome_platforms_example', # String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
|
1910
|
+
outcome_attribution: 'outcome_attribution_example' # String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
|
1911
|
+
}
|
1912
|
+
|
1913
|
+
begin
|
1914
|
+
# View Outcomes
|
1915
|
+
result = api_instance.get_outcomes(app_id, outcome_names, opts)
|
1916
|
+
p result
|
1917
|
+
rescue OneSignal::ApiError => e
|
1918
|
+
puts "Error when calling DefaultApi->get_outcomes: #{e}"
|
1919
|
+
end
|
1920
|
+
```
|
1921
|
+
|
1922
|
+
#### Using the get_outcomes_with_http_info variant
|
1923
|
+
|
1924
|
+
This returns an Array which contains the response data, status code and headers.
|
1925
|
+
|
1926
|
+
> <Array(<OutcomesData>, Integer, Hash)> get_outcomes_with_http_info(app_id, outcome_names, opts)
|
1927
|
+
|
1928
|
+
```ruby
|
1929
|
+
begin
|
1930
|
+
# View Outcomes
|
1931
|
+
data, status_code, headers = api_instance.get_outcomes_with_http_info(app_id, outcome_names, opts)
|
1932
|
+
p status_code # => 2xx
|
1933
|
+
p headers # => { ... }
|
1934
|
+
p data # => <OutcomesData>
|
1935
|
+
rescue OneSignal::ApiError => e
|
1936
|
+
puts "Error when calling DefaultApi->get_outcomes_with_http_info: #{e}"
|
1937
|
+
end
|
1938
|
+
```
|
1939
|
+
|
1940
|
+
### Parameters
|
1941
|
+
|
1942
|
+
| Name | Type | Description | Notes |
|
1943
|
+
| ---- | ---- | ----------- | ----- |
|
1944
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
1945
|
+
| **outcome_names** | **String** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | |
|
1946
|
+
| **outcome_names2** | **String** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | [optional] |
|
1947
|
+
| **outcome_time_range** | **String** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] |
|
1948
|
+
| **outcome_platforms** | **String** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] |
|
1949
|
+
| **outcome_attribution** | **String** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] |
|
1950
|
+
|
1951
|
+
### Return type
|
1952
|
+
|
1953
|
+
[**OutcomesData**](OutcomesData.md)
|
1954
|
+
|
1955
|
+
### Authorization
|
1956
|
+
|
1957
|
+
[app_key](../README.md#app_key)
|
1958
|
+
|
1959
|
+
### HTTP request headers
|
1960
|
+
|
1961
|
+
- **Content-Type**: Not defined
|
1962
|
+
- **Accept**: application/json
|
1963
|
+
|
1964
|
+
|
1965
|
+
## get_player
|
1966
|
+
|
1967
|
+
> <Player> get_player(app_id, player_id, opts)
|
1968
|
+
|
1969
|
+
View device
|
1970
|
+
|
1971
|
+
View the details of an existing device in one of your OneSignal apps
|
1972
|
+
|
1973
|
+
### Examples
|
1974
|
+
|
1975
|
+
```ruby
|
1976
|
+
require 'onesignal'
|
1977
|
+
# setup authorization
|
1978
|
+
OneSignal.configure do |config|
|
1979
|
+
# Configure Bearer authorization: user_key
|
1980
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1981
|
+
# Configure Bearer authorization: app_key
|
1982
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1983
|
+
|
1984
|
+
end
|
1985
|
+
|
1986
|
+
api_instance = OneSignal::DefaultApi.new
|
1987
|
+
app_id = 'app_id_example' # String | Your app_id for this device
|
1988
|
+
player_id = 'player_id_example' # String | Player's OneSignal ID
|
1989
|
+
opts = {
|
1990
|
+
email_auth_hash: 'email_auth_hash_example' # String | Email - Only required if you have enabled Identity Verification and device_type is email (11).
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
begin
|
1994
|
+
# View device
|
1995
|
+
result = api_instance.get_player(app_id, player_id, opts)
|
1996
|
+
p result
|
1997
|
+
rescue OneSignal::ApiError => e
|
1998
|
+
puts "Error when calling DefaultApi->get_player: #{e}"
|
1999
|
+
end
|
2000
|
+
```
|
2001
|
+
|
2002
|
+
#### Using the get_player_with_http_info variant
|
2003
|
+
|
2004
|
+
This returns an Array which contains the response data, status code and headers.
|
2005
|
+
|
2006
|
+
> <Array(<Player>, Integer, Hash)> get_player_with_http_info(app_id, player_id, opts)
|
2007
|
+
|
2008
|
+
```ruby
|
2009
|
+
begin
|
2010
|
+
# View device
|
2011
|
+
data, status_code, headers = api_instance.get_player_with_http_info(app_id, player_id, opts)
|
2012
|
+
p status_code # => 2xx
|
2013
|
+
p headers # => { ... }
|
2014
|
+
p data # => <Player>
|
2015
|
+
rescue OneSignal::ApiError => e
|
2016
|
+
puts "Error when calling DefaultApi->get_player_with_http_info: #{e}"
|
2017
|
+
end
|
2018
|
+
```
|
2019
|
+
|
2020
|
+
### Parameters
|
2021
|
+
|
2022
|
+
| Name | Type | Description | Notes |
|
2023
|
+
| ---- | ---- | ----------- | ----- |
|
2024
|
+
| **app_id** | **String** | Your app_id for this device | |
|
2025
|
+
| **player_id** | **String** | Player's OneSignal ID | |
|
2026
|
+
| **email_auth_hash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] |
|
2027
|
+
|
2028
|
+
### Return type
|
2029
|
+
|
2030
|
+
[**Player**](Player.md)
|
2031
|
+
|
2032
|
+
### Authorization
|
2033
|
+
|
2034
|
+
[app_key](../README.md#app_key)
|
2035
|
+
|
2036
|
+
### HTTP request headers
|
2037
|
+
|
2038
|
+
- **Content-Type**: Not defined
|
2039
|
+
- **Accept**: application/json
|
2040
|
+
|
2041
|
+
|
2042
|
+
## get_players
|
2043
|
+
|
2044
|
+
> <PlayerSlice> get_players(app_id, opts)
|
2045
|
+
|
2046
|
+
View devices
|
2047
|
+
|
2048
|
+
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.
|
2049
|
+
|
2050
|
+
### Examples
|
2051
|
+
|
2052
|
+
```ruby
|
2053
|
+
require 'onesignal'
|
2054
|
+
# setup authorization
|
2055
|
+
OneSignal.configure do |config|
|
2056
|
+
# Configure Bearer authorization: user_key
|
2057
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2058
|
+
# Configure Bearer authorization: app_key
|
2059
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2060
|
+
|
2061
|
+
end
|
2062
|
+
|
2063
|
+
api_instance = OneSignal::DefaultApi.new
|
2064
|
+
app_id = 'app_id_example' # String | The app ID that you want to view players from
|
2065
|
+
opts = {
|
2066
|
+
limit: 56, # Integer | How many devices to return. Max is 300. Default is 300
|
2067
|
+
offset: 56 # Integer | Result offset. Default is 0. Results are sorted by id;
|
2068
|
+
}
|
2069
|
+
|
2070
|
+
begin
|
2071
|
+
# View devices
|
2072
|
+
result = api_instance.get_players(app_id, opts)
|
2073
|
+
p result
|
2074
|
+
rescue OneSignal::ApiError => e
|
2075
|
+
puts "Error when calling DefaultApi->get_players: #{e}"
|
2076
|
+
end
|
2077
|
+
```
|
2078
|
+
|
2079
|
+
#### Using the get_players_with_http_info variant
|
2080
|
+
|
2081
|
+
This returns an Array which contains the response data, status code and headers.
|
2082
|
+
|
2083
|
+
> <Array(<PlayerSlice>, Integer, Hash)> get_players_with_http_info(app_id, opts)
|
2084
|
+
|
2085
|
+
```ruby
|
2086
|
+
begin
|
2087
|
+
# View devices
|
2088
|
+
data, status_code, headers = api_instance.get_players_with_http_info(app_id, opts)
|
2089
|
+
p status_code # => 2xx
|
2090
|
+
p headers # => { ... }
|
2091
|
+
p data # => <PlayerSlice>
|
2092
|
+
rescue OneSignal::ApiError => e
|
2093
|
+
puts "Error when calling DefaultApi->get_players_with_http_info: #{e}"
|
2094
|
+
end
|
2095
|
+
```
|
2096
|
+
|
2097
|
+
### Parameters
|
2098
|
+
|
2099
|
+
| Name | Type | Description | Notes |
|
2100
|
+
| ---- | ---- | ----------- | ----- |
|
2101
|
+
| **app_id** | **String** | The app ID that you want to view players from | |
|
2102
|
+
| **limit** | **Integer** | How many devices to return. Max is 300. Default is 300 | [optional] |
|
2103
|
+
| **offset** | **Integer** | Result offset. Default is 0. Results are sorted by id; | [optional] |
|
2104
|
+
|
2105
|
+
### Return type
|
2106
|
+
|
2107
|
+
[**PlayerSlice**](PlayerSlice.md)
|
2108
|
+
|
2109
|
+
### Authorization
|
2110
|
+
|
2111
|
+
[app_key](../README.md#app_key)
|
2112
|
+
|
2113
|
+
### HTTP request headers
|
2114
|
+
|
2115
|
+
- **Content-Type**: Not defined
|
2116
|
+
- **Accept**: application/json
|
2117
|
+
|
2118
|
+
|
2119
|
+
## identify_user_by_alias
|
2120
|
+
|
2121
|
+
> <InlineResponse200> identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body)
|
2122
|
+
|
2123
|
+
|
2124
|
+
|
2125
|
+
Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
|
2126
|
+
|
2127
|
+
### Examples
|
2128
|
+
|
2129
|
+
```ruby
|
2130
|
+
require 'onesignal'
|
2131
|
+
# setup authorization
|
2132
|
+
OneSignal.configure do |config|
|
2133
|
+
# Configure Bearer authorization: user_key
|
2134
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2135
|
+
# Configure Bearer authorization: app_key
|
2136
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2137
|
+
|
2138
|
+
end
|
2139
|
+
|
2140
|
+
api_instance = OneSignal::DefaultApi.new
|
2141
|
+
app_id = 'app_id_example' # String |
|
2142
|
+
alias_label = 'alias_label_example' # String |
|
2143
|
+
alias_id = 'alias_id_example' # String |
|
2144
|
+
user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody |
|
2145
|
+
|
2146
|
+
begin
|
2147
|
+
|
2148
|
+
result = api_instance.identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body)
|
2149
|
+
p result
|
2150
|
+
rescue OneSignal::ApiError => e
|
2151
|
+
puts "Error when calling DefaultApi->identify_user_by_alias: #{e}"
|
2152
|
+
end
|
2153
|
+
```
|
2154
|
+
|
2155
|
+
#### Using the identify_user_by_alias_with_http_info variant
|
2156
|
+
|
2157
|
+
This returns an Array which contains the response data, status code and headers.
|
2158
|
+
|
2159
|
+
> <Array(<InlineResponse200>, Integer, Hash)> identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body)
|
2160
|
+
|
2161
|
+
```ruby
|
2162
|
+
begin
|
2163
|
+
|
2164
|
+
data, status_code, headers = api_instance.identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body)
|
2165
|
+
p status_code # => 2xx
|
2166
|
+
p headers # => { ... }
|
2167
|
+
p data # => <InlineResponse200>
|
2168
|
+
rescue OneSignal::ApiError => e
|
2169
|
+
puts "Error when calling DefaultApi->identify_user_by_alias_with_http_info: #{e}"
|
2170
|
+
end
|
2171
|
+
```
|
2172
|
+
|
2173
|
+
### Parameters
|
2174
|
+
|
2175
|
+
| Name | Type | Description | Notes |
|
2176
|
+
| ---- | ---- | ----------- | ----- |
|
2177
|
+
| **app_id** | **String** | | |
|
2178
|
+
| **alias_label** | **String** | | |
|
2179
|
+
| **alias_id** | **String** | | |
|
2180
|
+
| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | |
|
933
2181
|
|
934
2182
|
### Return type
|
935
2183
|
|
936
|
-
[**
|
2184
|
+
[**InlineResponse200**](InlineResponse200.md)
|
937
2185
|
|
938
2186
|
### Authorization
|
939
2187
|
|
@@ -941,17 +2189,17 @@ end
|
|
941
2189
|
|
942
2190
|
### HTTP request headers
|
943
2191
|
|
944
|
-
- **Content-Type**:
|
2192
|
+
- **Content-Type**: application/json
|
945
2193
|
- **Accept**: application/json
|
946
2194
|
|
947
2195
|
|
948
|
-
##
|
2196
|
+
## identify_user_by_subscription_id
|
949
2197
|
|
950
|
-
> <
|
2198
|
+
> <UserIdentityResponse> identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body)
|
951
2199
|
|
952
|
-
View Outcomes
|
953
2200
|
|
954
|
-
|
2201
|
+
|
2202
|
+
Upserts one or more Aliases for the User identified by :subscription_id.
|
955
2203
|
|
956
2204
|
### Examples
|
957
2205
|
|
@@ -959,45 +2207,42 @@ View the details of all the outcomes associated with your app 🚧 Require
|
|
959
2207
|
require 'onesignal'
|
960
2208
|
# setup authorization
|
961
2209
|
OneSignal.configure do |config|
|
2210
|
+
# Configure Bearer authorization: user_key
|
2211
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
962
2212
|
# Configure Bearer authorization: app_key
|
963
|
-
config.app_key = '
|
2213
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
964
2214
|
|
965
2215
|
end
|
966
2216
|
|
967
2217
|
api_instance = OneSignal::DefaultApi.new
|
968
|
-
app_id = 'app_id_example' # String |
|
969
|
-
|
970
|
-
|
971
|
-
outcome_names2: 'outcome_names_example', # String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name.
|
972
|
-
outcome_time_range: 'outcome_time_range_example', # String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted.
|
973
|
-
outcome_platforms: 'outcome_platforms_example', # String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
|
974
|
-
outcome_attribution: 'outcome_attribution_example' # String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
|
975
|
-
}
|
2218
|
+
app_id = 'app_id_example' # String |
|
2219
|
+
subscription_id = 'subscription_id_example' # String |
|
2220
|
+
user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody |
|
976
2221
|
|
977
2222
|
begin
|
978
|
-
|
979
|
-
result = api_instance.
|
2223
|
+
|
2224
|
+
result = api_instance.identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body)
|
980
2225
|
p result
|
981
2226
|
rescue OneSignal::ApiError => e
|
982
|
-
puts "Error when calling DefaultApi->
|
2227
|
+
puts "Error when calling DefaultApi->identify_user_by_subscription_id: #{e}"
|
983
2228
|
end
|
984
2229
|
```
|
985
2230
|
|
986
|
-
#### Using the
|
2231
|
+
#### Using the identify_user_by_subscription_id_with_http_info variant
|
987
2232
|
|
988
2233
|
This returns an Array which contains the response data, status code and headers.
|
989
2234
|
|
990
|
-
> <Array(<
|
2235
|
+
> <Array(<UserIdentityResponse>, Integer, Hash)> identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body)
|
991
2236
|
|
992
2237
|
```ruby
|
993
2238
|
begin
|
994
|
-
|
995
|
-
data, status_code, headers = api_instance.
|
2239
|
+
|
2240
|
+
data, status_code, headers = api_instance.identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body)
|
996
2241
|
p status_code # => 2xx
|
997
2242
|
p headers # => { ... }
|
998
|
-
p data # => <
|
2243
|
+
p data # => <UserIdentityResponse>
|
999
2244
|
rescue OneSignal::ApiError => e
|
1000
|
-
puts "Error when calling DefaultApi->
|
2245
|
+
puts "Error when calling DefaultApi->identify_user_by_subscription_id_with_http_info: #{e}"
|
1001
2246
|
end
|
1002
2247
|
```
|
1003
2248
|
|
@@ -1005,16 +2250,13 @@ end
|
|
1005
2250
|
|
1006
2251
|
| Name | Type | Description | Notes |
|
1007
2252
|
| ---- | ---- | ----------- | ----- |
|
1008
|
-
| **app_id** | **String** |
|
1009
|
-
| **
|
1010
|
-
| **
|
1011
|
-
| **outcome_time_range** | **String** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] |
|
1012
|
-
| **outcome_platforms** | **String** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] |
|
1013
|
-
| **outcome_attribution** | **String** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] |
|
2253
|
+
| **app_id** | **String** | | |
|
2254
|
+
| **subscription_id** | **String** | | |
|
2255
|
+
| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | |
|
1014
2256
|
|
1015
2257
|
### Return type
|
1016
2258
|
|
1017
|
-
[**
|
2259
|
+
[**UserIdentityResponse**](UserIdentityResponse.md)
|
1018
2260
|
|
1019
2261
|
### Authorization
|
1020
2262
|
|
@@ -1022,17 +2264,17 @@ end
|
|
1022
2264
|
|
1023
2265
|
### HTTP request headers
|
1024
2266
|
|
1025
|
-
- **Content-Type**:
|
2267
|
+
- **Content-Type**: application/json
|
1026
2268
|
- **Accept**: application/json
|
1027
2269
|
|
1028
2270
|
|
1029
|
-
##
|
2271
|
+
## transfer_subscription
|
1030
2272
|
|
1031
|
-
> <
|
2273
|
+
> <UserIdentityResponse> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
|
1032
2274
|
|
1033
|
-
View device
|
1034
2275
|
|
1035
|
-
|
2276
|
+
|
2277
|
+
Transfers this Subscription to the User identified by the identity in the payload.
|
1036
2278
|
|
1037
2279
|
### Examples
|
1038
2280
|
|
@@ -1040,42 +2282,42 @@ View the details of an existing device in one of your OneSignal apps
|
|
1040
2282
|
require 'onesignal'
|
1041
2283
|
# setup authorization
|
1042
2284
|
OneSignal.configure do |config|
|
2285
|
+
# Configure Bearer authorization: user_key
|
2286
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1043
2287
|
# Configure Bearer authorization: app_key
|
1044
|
-
config.app_key = '
|
2288
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1045
2289
|
|
1046
2290
|
end
|
1047
2291
|
|
1048
2292
|
api_instance = OneSignal::DefaultApi.new
|
1049
|
-
app_id = 'app_id_example' # String |
|
1050
|
-
|
1051
|
-
|
1052
|
-
email_auth_hash: 'email_auth_hash_example' # String | Email - Only required if you have enabled Identity Verification and device_type is email (11).
|
1053
|
-
}
|
2293
|
+
app_id = 'app_id_example' # String |
|
2294
|
+
subscription_id = 'subscription_id_example' # String |
|
2295
|
+
transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody |
|
1054
2296
|
|
1055
2297
|
begin
|
1056
|
-
|
1057
|
-
result = api_instance.
|
2298
|
+
|
2299
|
+
result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
|
1058
2300
|
p result
|
1059
2301
|
rescue OneSignal::ApiError => e
|
1060
|
-
puts "Error when calling DefaultApi->
|
2302
|
+
puts "Error when calling DefaultApi->transfer_subscription: #{e}"
|
1061
2303
|
end
|
1062
2304
|
```
|
1063
2305
|
|
1064
|
-
#### Using the
|
2306
|
+
#### Using the transfer_subscription_with_http_info variant
|
1065
2307
|
|
1066
2308
|
This returns an Array which contains the response data, status code and headers.
|
1067
2309
|
|
1068
|
-
> <Array(<
|
2310
|
+
> <Array(<UserIdentityResponse>, Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
|
1069
2311
|
|
1070
2312
|
```ruby
|
1071
2313
|
begin
|
1072
|
-
|
1073
|
-
data, status_code, headers = api_instance.
|
2314
|
+
|
2315
|
+
data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
|
1074
2316
|
p status_code # => 2xx
|
1075
2317
|
p headers # => { ... }
|
1076
|
-
p data # => <
|
2318
|
+
p data # => <UserIdentityResponse>
|
1077
2319
|
rescue OneSignal::ApiError => e
|
1078
|
-
puts "Error when calling DefaultApi->
|
2320
|
+
puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}"
|
1079
2321
|
end
|
1080
2322
|
```
|
1081
2323
|
|
@@ -1083,13 +2325,13 @@ end
|
|
1083
2325
|
|
1084
2326
|
| Name | Type | Description | Notes |
|
1085
2327
|
| ---- | ---- | ----------- | ----- |
|
1086
|
-
| **app_id** | **String** |
|
1087
|
-
| **
|
1088
|
-
| **
|
2328
|
+
| **app_id** | **String** | | |
|
2329
|
+
| **subscription_id** | **String** | | |
|
2330
|
+
| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | |
|
1089
2331
|
|
1090
2332
|
### Return type
|
1091
2333
|
|
1092
|
-
[**
|
2334
|
+
[**UserIdentityResponse**](UserIdentityResponse.md)
|
1093
2335
|
|
1094
2336
|
### Authorization
|
1095
2337
|
|
@@ -1097,17 +2339,17 @@ end
|
|
1097
2339
|
|
1098
2340
|
### HTTP request headers
|
1099
2341
|
|
1100
|
-
- **Content-Type**:
|
2342
|
+
- **Content-Type**: application/json
|
1101
2343
|
- **Accept**: application/json
|
1102
2344
|
|
1103
2345
|
|
1104
|
-
##
|
2346
|
+
## update_app
|
1105
2347
|
|
1106
|
-
> <
|
2348
|
+
> <App> update_app(app_id, app)
|
1107
2349
|
|
1108
|
-
|
2350
|
+
Update an app
|
1109
2351
|
|
1110
|
-
|
2352
|
+
Updates the name or configuration settings of an existing OneSignal app
|
1111
2353
|
|
1112
2354
|
### Examples
|
1113
2355
|
|
@@ -1115,42 +2357,41 @@ View the details of multiple devices in one of your OneSignal apps Unavailable f
|
|
1115
2357
|
require 'onesignal'
|
1116
2358
|
# setup authorization
|
1117
2359
|
OneSignal.configure do |config|
|
1118
|
-
# Configure Bearer authorization:
|
1119
|
-
config.
|
2360
|
+
# Configure Bearer authorization: user_key
|
2361
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2362
|
+
# Configure Bearer authorization: user_key
|
2363
|
+
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1120
2364
|
|
1121
2365
|
end
|
1122
2366
|
|
1123
2367
|
api_instance = OneSignal::DefaultApi.new
|
1124
|
-
app_id = 'app_id_example' # String |
|
1125
|
-
|
1126
|
-
limit: 56, # Integer | How many devices to return. Max is 300. Default is 300
|
1127
|
-
offset: 56 # Integer | Result offset. Default is 0. Results are sorted by id;
|
1128
|
-
}
|
2368
|
+
app_id = 'app_id_example' # String | An app id
|
2369
|
+
app = OneSignal::App.new # App |
|
1129
2370
|
|
1130
2371
|
begin
|
1131
|
-
#
|
1132
|
-
result = api_instance.
|
2372
|
+
# Update an app
|
2373
|
+
result = api_instance.update_app(app_id, app)
|
1133
2374
|
p result
|
1134
2375
|
rescue OneSignal::ApiError => e
|
1135
|
-
puts "Error when calling DefaultApi->
|
2376
|
+
puts "Error when calling DefaultApi->update_app: #{e}"
|
1136
2377
|
end
|
1137
2378
|
```
|
1138
2379
|
|
1139
|
-
#### Using the
|
2380
|
+
#### Using the update_app_with_http_info variant
|
1140
2381
|
|
1141
2382
|
This returns an Array which contains the response data, status code and headers.
|
1142
2383
|
|
1143
|
-
> <Array(<
|
2384
|
+
> <Array(<App>, Integer, Hash)> update_app_with_http_info(app_id, app)
|
1144
2385
|
|
1145
2386
|
```ruby
|
1146
2387
|
begin
|
1147
|
-
#
|
1148
|
-
data, status_code, headers = api_instance.
|
2388
|
+
# Update an app
|
2389
|
+
data, status_code, headers = api_instance.update_app_with_http_info(app_id, app)
|
1149
2390
|
p status_code # => 2xx
|
1150
2391
|
p headers # => { ... }
|
1151
|
-
p data # => <
|
2392
|
+
p data # => <App>
|
1152
2393
|
rescue OneSignal::ApiError => e
|
1153
|
-
puts "Error when calling DefaultApi->
|
2394
|
+
puts "Error when calling DefaultApi->update_app_with_http_info: #{e}"
|
1154
2395
|
end
|
1155
2396
|
```
|
1156
2397
|
|
@@ -1158,31 +2399,30 @@ end
|
|
1158
2399
|
|
1159
2400
|
| Name | Type | Description | Notes |
|
1160
2401
|
| ---- | ---- | ----------- | ----- |
|
1161
|
-
| **app_id** | **String** |
|
1162
|
-
| **
|
1163
|
-
| **offset** | **Integer** | Result offset. Default is 0. Results are sorted by id; | [optional] |
|
2402
|
+
| **app_id** | **String** | An app id | |
|
2403
|
+
| **app** | [**App**](App.md) | | |
|
1164
2404
|
|
1165
2405
|
### Return type
|
1166
2406
|
|
1167
|
-
[**
|
2407
|
+
[**App**](App.md)
|
1168
2408
|
|
1169
2409
|
### Authorization
|
1170
2410
|
|
1171
|
-
[
|
2411
|
+
[user_key](../README.md#user_key)
|
1172
2412
|
|
1173
2413
|
### HTTP request headers
|
1174
2414
|
|
1175
|
-
- **Content-Type**:
|
2415
|
+
- **Content-Type**: application/json
|
1176
2416
|
- **Accept**: application/json
|
1177
2417
|
|
1178
2418
|
|
1179
|
-
##
|
2419
|
+
## update_live_activity
|
1180
2420
|
|
1181
|
-
> <
|
2421
|
+
> <UpdateLiveActivitySuccessResponse> update_live_activity(app_id, activity_id, update_live_activity_request)
|
1182
2422
|
|
1183
|
-
Update
|
2423
|
+
Update a Live Activity via Push
|
1184
2424
|
|
1185
|
-
Updates
|
2425
|
+
Updates a specified live activity.
|
1186
2426
|
|
1187
2427
|
### Examples
|
1188
2428
|
|
@@ -1191,38 +2431,41 @@ require 'onesignal'
|
|
1191
2431
|
# setup authorization
|
1192
2432
|
OneSignal.configure do |config|
|
1193
2433
|
# Configure Bearer authorization: user_key
|
1194
|
-
config.user_key = '
|
2434
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2435
|
+
# Configure Bearer authorization: app_key
|
2436
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1195
2437
|
|
1196
2438
|
end
|
1197
2439
|
|
1198
2440
|
api_instance = OneSignal::DefaultApi.new
|
1199
|
-
app_id = 'app_id_example' # String |
|
1200
|
-
|
2441
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
2442
|
+
activity_id = 'activity_id_example' # String | Live Activity record ID
|
2443
|
+
update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'headings', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest |
|
1201
2444
|
|
1202
2445
|
begin
|
1203
|
-
# Update
|
1204
|
-
result = api_instance.
|
2446
|
+
# Update a Live Activity via Push
|
2447
|
+
result = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request)
|
1205
2448
|
p result
|
1206
2449
|
rescue OneSignal::ApiError => e
|
1207
|
-
puts "Error when calling DefaultApi->
|
2450
|
+
puts "Error when calling DefaultApi->update_live_activity: #{e}"
|
1208
2451
|
end
|
1209
2452
|
```
|
1210
2453
|
|
1211
|
-
#### Using the
|
2454
|
+
#### Using the update_live_activity_with_http_info variant
|
1212
2455
|
|
1213
2456
|
This returns an Array which contains the response data, status code and headers.
|
1214
2457
|
|
1215
|
-
> <Array(<
|
2458
|
+
> <Array(<UpdateLiveActivitySuccessResponse>, Integer, Hash)> update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request)
|
1216
2459
|
|
1217
2460
|
```ruby
|
1218
2461
|
begin
|
1219
|
-
# Update
|
1220
|
-
data, status_code, headers = api_instance.
|
2462
|
+
# Update a Live Activity via Push
|
2463
|
+
data, status_code, headers = api_instance.update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request)
|
1221
2464
|
p status_code # => 2xx
|
1222
2465
|
p headers # => { ... }
|
1223
|
-
p data # => <
|
2466
|
+
p data # => <UpdateLiveActivitySuccessResponse>
|
1224
2467
|
rescue OneSignal::ApiError => e
|
1225
|
-
puts "Error when calling DefaultApi->
|
2468
|
+
puts "Error when calling DefaultApi->update_live_activity_with_http_info: #{e}"
|
1226
2469
|
end
|
1227
2470
|
```
|
1228
2471
|
|
@@ -1230,16 +2473,17 @@ end
|
|
1230
2473
|
|
1231
2474
|
| Name | Type | Description | Notes |
|
1232
2475
|
| ---- | ---- | ----------- | ----- |
|
1233
|
-
| **app_id** | **String** |
|
1234
|
-
| **
|
2476
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
2477
|
+
| **activity_id** | **String** | Live Activity record ID | |
|
2478
|
+
| **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md) | | |
|
1235
2479
|
|
1236
2480
|
### Return type
|
1237
2481
|
|
1238
|
-
[**
|
2482
|
+
[**UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md)
|
1239
2483
|
|
1240
2484
|
### Authorization
|
1241
2485
|
|
1242
|
-
[
|
2486
|
+
[app_key](../README.md#app_key)
|
1243
2487
|
|
1244
2488
|
### HTTP request headers
|
1245
2489
|
|
@@ -1249,7 +2493,7 @@ end
|
|
1249
2493
|
|
1250
2494
|
## update_player
|
1251
2495
|
|
1252
|
-
> <
|
2496
|
+
> <UpdatePlayerSuccessResponse> update_player(player_id, player)
|
1253
2497
|
|
1254
2498
|
Edit device
|
1255
2499
|
|
@@ -1261,14 +2505,16 @@ Update an existing device in one of your OneSignal apps
|
|
1261
2505
|
require 'onesignal'
|
1262
2506
|
# setup authorization
|
1263
2507
|
OneSignal.configure do |config|
|
2508
|
+
# Configure Bearer authorization: user_key
|
2509
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1264
2510
|
# Configure Bearer authorization: app_key
|
1265
|
-
config.app_key = '
|
2511
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1266
2512
|
|
1267
2513
|
end
|
1268
2514
|
|
1269
2515
|
api_instance = OneSignal::DefaultApi.new
|
1270
2516
|
player_id = 'player_id_example' # String | Player's OneSignal ID
|
1271
|
-
player = OneSignal::Player.new({
|
2517
|
+
player = OneSignal::Player.new({device_type: 37}) # Player |
|
1272
2518
|
|
1273
2519
|
begin
|
1274
2520
|
# Edit device
|
@@ -1283,7 +2529,7 @@ end
|
|
1283
2529
|
|
1284
2530
|
This returns an Array which contains the response data, status code and headers.
|
1285
2531
|
|
1286
|
-
> <Array(<
|
2532
|
+
> <Array(<UpdatePlayerSuccessResponse>, Integer, Hash)> update_player_with_http_info(player_id, player)
|
1287
2533
|
|
1288
2534
|
```ruby
|
1289
2535
|
begin
|
@@ -1291,7 +2537,7 @@ begin
|
|
1291
2537
|
data, status_code, headers = api_instance.update_player_with_http_info(player_id, player)
|
1292
2538
|
p status_code # => 2xx
|
1293
2539
|
p headers # => { ... }
|
1294
|
-
p data # => <
|
2540
|
+
p data # => <UpdatePlayerSuccessResponse>
|
1295
2541
|
rescue OneSignal::ApiError => e
|
1296
2542
|
puts "Error when calling DefaultApi->update_player_with_http_info: #{e}"
|
1297
2543
|
end
|
@@ -1306,7 +2552,7 @@ end
|
|
1306
2552
|
|
1307
2553
|
### Return type
|
1308
2554
|
|
1309
|
-
[**
|
2555
|
+
[**UpdatePlayerSuccessResponse**](UpdatePlayerSuccessResponse.md)
|
1310
2556
|
|
1311
2557
|
### Authorization
|
1312
2558
|
|
@@ -1320,7 +2566,7 @@ end
|
|
1320
2566
|
|
1321
2567
|
## update_player_tags
|
1322
2568
|
|
1323
|
-
> <
|
2569
|
+
> <UpdatePlayerTagsSuccessResponse> update_player_tags(app_id, external_user_id, opts)
|
1324
2570
|
|
1325
2571
|
Edit tags with external user id
|
1326
2572
|
|
@@ -1332,8 +2578,10 @@ Update an existing device's tags in one of your OneSignal apps using the Externa
|
|
1332
2578
|
require 'onesignal'
|
1333
2579
|
# setup authorization
|
1334
2580
|
OneSignal.configure do |config|
|
2581
|
+
# Configure Bearer authorization: user_key
|
2582
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1335
2583
|
# Configure Bearer authorization: app_key
|
1336
|
-
config.app_key = '
|
2584
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1337
2585
|
|
1338
2586
|
end
|
1339
2587
|
|
@@ -1357,7 +2605,7 @@ end
|
|
1357
2605
|
|
1358
2606
|
This returns an Array which contains the response data, status code and headers.
|
1359
2607
|
|
1360
|
-
> <Array(<
|
2608
|
+
> <Array(<UpdatePlayerTagsSuccessResponse>, Integer, Hash)> update_player_tags_with_http_info(app_id, external_user_id, opts)
|
1361
2609
|
|
1362
2610
|
```ruby
|
1363
2611
|
begin
|
@@ -1365,7 +2613,7 @@ begin
|
|
1365
2613
|
data, status_code, headers = api_instance.update_player_tags_with_http_info(app_id, external_user_id, opts)
|
1366
2614
|
p status_code # => 2xx
|
1367
2615
|
p headers # => { ... }
|
1368
|
-
p data # => <
|
2616
|
+
p data # => <UpdatePlayerTagsSuccessResponse>
|
1369
2617
|
rescue OneSignal::ApiError => e
|
1370
2618
|
puts "Error when calling DefaultApi->update_player_tags_with_http_info: #{e}"
|
1371
2619
|
end
|
@@ -1381,7 +2629,158 @@ end
|
|
1381
2629
|
|
1382
2630
|
### Return type
|
1383
2631
|
|
1384
|
-
[**
|
2632
|
+
[**UpdatePlayerTagsSuccessResponse**](UpdatePlayerTagsSuccessResponse.md)
|
2633
|
+
|
2634
|
+
### Authorization
|
2635
|
+
|
2636
|
+
[app_key](../README.md#app_key)
|
2637
|
+
|
2638
|
+
### HTTP request headers
|
2639
|
+
|
2640
|
+
- **Content-Type**: application/json
|
2641
|
+
- **Accept**: application/json
|
2642
|
+
|
2643
|
+
|
2644
|
+
## update_subscription
|
2645
|
+
|
2646
|
+
> update_subscription(app_id, subscription_id, update_subscription_request_body)
|
2647
|
+
|
2648
|
+
|
2649
|
+
|
2650
|
+
Updates an existing Subscription’s properties.
|
2651
|
+
|
2652
|
+
### Examples
|
2653
|
+
|
2654
|
+
```ruby
|
2655
|
+
require 'onesignal'
|
2656
|
+
# setup authorization
|
2657
|
+
OneSignal.configure do |config|
|
2658
|
+
# Configure Bearer authorization: user_key
|
2659
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2660
|
+
# Configure Bearer authorization: app_key
|
2661
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2662
|
+
|
2663
|
+
end
|
2664
|
+
|
2665
|
+
api_instance = OneSignal::DefaultApi.new
|
2666
|
+
app_id = 'app_id_example' # String |
|
2667
|
+
subscription_id = 'subscription_id_example' # String |
|
2668
|
+
update_subscription_request_body = OneSignal::UpdateSubscriptionRequestBody.new # UpdateSubscriptionRequestBody |
|
2669
|
+
|
2670
|
+
begin
|
2671
|
+
|
2672
|
+
api_instance.update_subscription(app_id, subscription_id, update_subscription_request_body)
|
2673
|
+
rescue OneSignal::ApiError => e
|
2674
|
+
puts "Error when calling DefaultApi->update_subscription: #{e}"
|
2675
|
+
end
|
2676
|
+
```
|
2677
|
+
|
2678
|
+
#### Using the update_subscription_with_http_info variant
|
2679
|
+
|
2680
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
2681
|
+
|
2682
|
+
> <Array(nil, Integer, Hash)> update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body)
|
2683
|
+
|
2684
|
+
```ruby
|
2685
|
+
begin
|
2686
|
+
|
2687
|
+
data, status_code, headers = api_instance.update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body)
|
2688
|
+
p status_code # => 2xx
|
2689
|
+
p headers # => { ... }
|
2690
|
+
p data # => nil
|
2691
|
+
rescue OneSignal::ApiError => e
|
2692
|
+
puts "Error when calling DefaultApi->update_subscription_with_http_info: #{e}"
|
2693
|
+
end
|
2694
|
+
```
|
2695
|
+
|
2696
|
+
### Parameters
|
2697
|
+
|
2698
|
+
| Name | Type | Description | Notes |
|
2699
|
+
| ---- | ---- | ----------- | ----- |
|
2700
|
+
| **app_id** | **String** | | |
|
2701
|
+
| **subscription_id** | **String** | | |
|
2702
|
+
| **update_subscription_request_body** | [**UpdateSubscriptionRequestBody**](UpdateSubscriptionRequestBody.md) | | |
|
2703
|
+
|
2704
|
+
### Return type
|
2705
|
+
|
2706
|
+
nil (empty response body)
|
2707
|
+
|
2708
|
+
### Authorization
|
2709
|
+
|
2710
|
+
[app_key](../README.md#app_key)
|
2711
|
+
|
2712
|
+
### HTTP request headers
|
2713
|
+
|
2714
|
+
- **Content-Type**: application/json
|
2715
|
+
- **Accept**: application/json
|
2716
|
+
|
2717
|
+
|
2718
|
+
## update_user
|
2719
|
+
|
2720
|
+
> <InlineResponse202> update_user(app_id, alias_label, alias_id, update_user_request)
|
2721
|
+
|
2722
|
+
|
2723
|
+
|
2724
|
+
Updates an existing User’s properties.
|
2725
|
+
|
2726
|
+
### Examples
|
2727
|
+
|
2728
|
+
```ruby
|
2729
|
+
require 'onesignal'
|
2730
|
+
# setup authorization
|
2731
|
+
OneSignal.configure do |config|
|
2732
|
+
# Configure Bearer authorization: user_key
|
2733
|
+
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2734
|
+
# Configure Bearer authorization: app_key
|
2735
|
+
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2736
|
+
|
2737
|
+
end
|
2738
|
+
|
2739
|
+
api_instance = OneSignal::DefaultApi.new
|
2740
|
+
app_id = 'app_id_example' # String |
|
2741
|
+
alias_label = 'alias_label_example' # String |
|
2742
|
+
alias_id = 'alias_id_example' # String |
|
2743
|
+
update_user_request = OneSignal::UpdateUserRequest.new # UpdateUserRequest |
|
2744
|
+
|
2745
|
+
begin
|
2746
|
+
|
2747
|
+
result = api_instance.update_user(app_id, alias_label, alias_id, update_user_request)
|
2748
|
+
p result
|
2749
|
+
rescue OneSignal::ApiError => e
|
2750
|
+
puts "Error when calling DefaultApi->update_user: #{e}"
|
2751
|
+
end
|
2752
|
+
```
|
2753
|
+
|
2754
|
+
#### Using the update_user_with_http_info variant
|
2755
|
+
|
2756
|
+
This returns an Array which contains the response data, status code and headers.
|
2757
|
+
|
2758
|
+
> <Array(<InlineResponse202>, Integer, Hash)> update_user_with_http_info(app_id, alias_label, alias_id, update_user_request)
|
2759
|
+
|
2760
|
+
```ruby
|
2761
|
+
begin
|
2762
|
+
|
2763
|
+
data, status_code, headers = api_instance.update_user_with_http_info(app_id, alias_label, alias_id, update_user_request)
|
2764
|
+
p status_code # => 2xx
|
2765
|
+
p headers # => { ... }
|
2766
|
+
p data # => <InlineResponse202>
|
2767
|
+
rescue OneSignal::ApiError => e
|
2768
|
+
puts "Error when calling DefaultApi->update_user_with_http_info: #{e}"
|
2769
|
+
end
|
2770
|
+
```
|
2771
|
+
|
2772
|
+
### Parameters
|
2773
|
+
|
2774
|
+
| Name | Type | Description | Notes |
|
2775
|
+
| ---- | ---- | ----------- | ----- |
|
2776
|
+
| **app_id** | **String** | | |
|
2777
|
+
| **alias_label** | **String** | | |
|
2778
|
+
| **alias_id** | **String** | | |
|
2779
|
+
| **update_user_request** | [**UpdateUserRequest**](UpdateUserRequest.md) | | |
|
2780
|
+
|
2781
|
+
### Return type
|
2782
|
+
|
2783
|
+
[**InlineResponse202**](InlineResponse202.md)
|
1385
2784
|
|
1386
2785
|
### Authorization
|
1387
2786
|
|