onesignal 1.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +74 -0
- data/README.md +112 -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 +1591 -266
- 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 +178 -53
- data/docs/FilterNotificationTarget.md +0 -40
- data/docs/InlineResponse400.md +0 -18
- data/docs/InlineResponse4001.md +0 -20
- data/docs/InlineResponse4003.md +0 -18
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.0
|
6
|
+
The version of the OpenAPI document: 1.4.0
|
7
7
|
Contact: devrel@onesignal.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
@@ -19,12 +19,92 @@ module OneSignal
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Start Live Activity
|
23
|
+
# Starts a Live Activity
|
24
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
25
|
+
# @param activity_id [String] Live Activity record ID
|
26
|
+
# @param begin_live_activity_request [BeginLiveActivityRequest]
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @return [nil]
|
29
|
+
def begin_live_activity(app_id, activity_id, begin_live_activity_request, opts = {})
|
30
|
+
begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts)
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# Start Live Activity
|
35
|
+
# Starts a Live Activity
|
36
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
37
|
+
# @param activity_id [String] Live Activity record ID
|
38
|
+
# @param begin_live_activity_request [BeginLiveActivityRequest]
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
41
|
+
def begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.begin_live_activity ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'app_id' is set
|
46
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.begin_live_activity"
|
48
|
+
end
|
49
|
+
# verify the required parameter 'activity_id' is set
|
50
|
+
if @api_client.config.client_side_validation && activity_id.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.begin_live_activity"
|
52
|
+
end
|
53
|
+
# verify the required parameter 'begin_live_activity_request' is set
|
54
|
+
if @api_client.config.client_side_validation && begin_live_activity_request.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'begin_live_activity_request' when calling DefaultApi.begin_live_activity"
|
56
|
+
end
|
57
|
+
# resource path
|
58
|
+
local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s))
|
59
|
+
|
60
|
+
# query parameters
|
61
|
+
query_params = opts[:query_params] || {}
|
62
|
+
|
63
|
+
# header parameters
|
64
|
+
header_params = opts[:header_params] || {}
|
65
|
+
# HTTP header 'Accept' (if needed)
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
67
|
+
# HTTP header 'Content-Type'
|
68
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
69
|
+
if !content_type.nil?
|
70
|
+
header_params['Content-Type'] = content_type
|
71
|
+
end
|
72
|
+
|
73
|
+
# form parameters
|
74
|
+
form_params = opts[:form_params] || {}
|
75
|
+
|
76
|
+
# http body (model)
|
77
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(begin_live_activity_request)
|
78
|
+
|
79
|
+
# return_type
|
80
|
+
return_type = opts[:debug_return_type]
|
81
|
+
|
82
|
+
# auth_names
|
83
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
84
|
+
|
85
|
+
new_options = opts.merge(
|
86
|
+
:operation => :"DefaultApi.begin_live_activity",
|
87
|
+
:header_params => header_params,
|
88
|
+
:query_params => query_params,
|
89
|
+
:form_params => form_params,
|
90
|
+
:body => post_body,
|
91
|
+
:auth_names => auth_names,
|
92
|
+
:return_type => return_type
|
93
|
+
)
|
94
|
+
|
95
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug "API called: DefaultApi#begin_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
98
|
+
end
|
99
|
+
return data, status_code, headers
|
100
|
+
end
|
101
|
+
|
22
102
|
# Stop a scheduled or currently outgoing notification
|
23
103
|
# Used to stop a scheduled or currently outgoing notification
|
24
104
|
# @param app_id [String]
|
25
105
|
# @param notification_id [String]
|
26
106
|
# @param [Hash] opts the optional parameters
|
27
|
-
# @return [
|
107
|
+
# @return [CancelNotificationSuccessResponse]
|
28
108
|
def cancel_notification(app_id, notification_id, opts = {})
|
29
109
|
data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts)
|
30
110
|
data
|
@@ -35,7 +115,7 @@ module OneSignal
|
|
35
115
|
# @param app_id [String]
|
36
116
|
# @param notification_id [String]
|
37
117
|
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [Array<(
|
118
|
+
# @return [Array<(CancelNotificationSuccessResponse, Integer, Hash)>] CancelNotificationSuccessResponse data, response status code and response headers
|
39
119
|
def cancel_notification_with_http_info(app_id, notification_id, opts = {})
|
40
120
|
if @api_client.config.debugging
|
41
121
|
@api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...'
|
@@ -67,7 +147,7 @@ module OneSignal
|
|
67
147
|
post_body = opts[:debug_body]
|
68
148
|
|
69
149
|
# return_type
|
70
|
-
return_type = opts[:debug_return_type] || '
|
150
|
+
return_type = opts[:debug_return_type] || 'CancelNotificationSuccessResponse'
|
71
151
|
|
72
152
|
# auth_names
|
73
153
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -161,7 +241,7 @@ module OneSignal
|
|
161
241
|
# Sends notifications to your users
|
162
242
|
# @param notification [Notification]
|
163
243
|
# @param [Hash] opts the optional parameters
|
164
|
-
# @return [
|
244
|
+
# @return [CreateNotificationSuccessResponse]
|
165
245
|
def create_notification(notification, opts = {})
|
166
246
|
data, _status_code, _headers = create_notification_with_http_info(notification, opts)
|
167
247
|
data
|
@@ -171,7 +251,7 @@ module OneSignal
|
|
171
251
|
# Sends notifications to your users
|
172
252
|
# @param notification [Notification]
|
173
253
|
# @param [Hash] opts the optional parameters
|
174
|
-
# @return [Array<(
|
254
|
+
# @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers
|
175
255
|
def create_notification_with_http_info(notification, opts = {})
|
176
256
|
if @api_client.config.debugging
|
177
257
|
@api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...'
|
@@ -203,7 +283,7 @@ module OneSignal
|
|
203
283
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(notification)
|
204
284
|
|
205
285
|
# return_type
|
206
|
-
return_type = opts[:debug_return_type] || '
|
286
|
+
return_type = opts[:debug_return_type] || 'CreateNotificationSuccessResponse'
|
207
287
|
|
208
288
|
# auth_names
|
209
289
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -229,7 +309,7 @@ module OneSignal
|
|
229
309
|
# Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
|
230
310
|
# @param player [Player]
|
231
311
|
# @param [Hash] opts the optional parameters
|
232
|
-
# @return [
|
312
|
+
# @return [CreatePlayerSuccessResponse]
|
233
313
|
def create_player(player, opts = {})
|
234
314
|
data, _status_code, _headers = create_player_with_http_info(player, opts)
|
235
315
|
data
|
@@ -239,7 +319,7 @@ module OneSignal
|
|
239
319
|
# Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
|
240
320
|
# @param player [Player]
|
241
321
|
# @param [Hash] opts the optional parameters
|
242
|
-
# @return [Array<(
|
322
|
+
# @return [Array<(CreatePlayerSuccessResponse, Integer, Hash)>] CreatePlayerSuccessResponse data, response status code and response headers
|
243
323
|
def create_player_with_http_info(player, opts = {})
|
244
324
|
if @api_client.config.debugging
|
245
325
|
@api_client.config.logger.debug 'Calling API: DefaultApi.create_player ...'
|
@@ -271,7 +351,7 @@ module OneSignal
|
|
271
351
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(player)
|
272
352
|
|
273
353
|
# return_type
|
274
|
-
return_type = opts[:debug_return_type] || '
|
354
|
+
return_type = opts[:debug_return_type] || 'CreatePlayerSuccessResponse'
|
275
355
|
|
276
356
|
# auth_names
|
277
357
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -298,7 +378,7 @@ module OneSignal
|
|
298
378
|
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
299
379
|
# @param [Hash] opts the optional parameters
|
300
380
|
# @option opts [Segment] :segment
|
301
|
-
# @return [
|
381
|
+
# @return [CreateSegmentSuccessResponse]
|
302
382
|
def create_segments(app_id, opts = {})
|
303
383
|
data, _status_code, _headers = create_segments_with_http_info(app_id, opts)
|
304
384
|
data
|
@@ -309,7 +389,7 @@ module OneSignal
|
|
309
389
|
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
310
390
|
# @param [Hash] opts the optional parameters
|
311
391
|
# @option opts [Segment] :segment
|
312
|
-
# @return [Array<(
|
392
|
+
# @return [Array<(CreateSegmentSuccessResponse, Integer, Hash)>] CreateSegmentSuccessResponse data, response status code and response headers
|
313
393
|
def create_segments_with_http_info(app_id, opts = {})
|
314
394
|
if @api_client.config.debugging
|
315
395
|
@api_client.config.logger.debug 'Calling API: DefaultApi.create_segments ...'
|
@@ -341,7 +421,7 @@ module OneSignal
|
|
341
421
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'segment'])
|
342
422
|
|
343
423
|
# return_type
|
344
|
-
return_type = opts[:debug_return_type] || '
|
424
|
+
return_type = opts[:debug_return_type] || 'CreateSegmentSuccessResponse'
|
345
425
|
|
346
426
|
# auth_names
|
347
427
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -363,61 +443,75 @@ module OneSignal
|
|
363
443
|
return data, status_code, headers
|
364
444
|
end
|
365
445
|
|
366
|
-
#
|
367
|
-
#
|
368
|
-
# @param
|
369
|
-
# @param
|
446
|
+
# Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
|
447
|
+
# @param app_id [String]
|
448
|
+
# @param alias_label [String]
|
449
|
+
# @param alias_id [String]
|
450
|
+
# @param create_subscription_request_body [CreateSubscriptionRequestBody]
|
370
451
|
# @param [Hash] opts the optional parameters
|
371
|
-
# @return [
|
372
|
-
def
|
373
|
-
data, _status_code, _headers =
|
452
|
+
# @return [InlineResponse201]
|
453
|
+
def create_subscription(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
|
454
|
+
data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts)
|
374
455
|
data
|
375
456
|
end
|
376
457
|
|
377
|
-
#
|
378
|
-
#
|
379
|
-
# @param
|
380
|
-
# @param
|
458
|
+
# Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
|
459
|
+
# @param app_id [String]
|
460
|
+
# @param alias_label [String]
|
461
|
+
# @param alias_id [String]
|
462
|
+
# @param create_subscription_request_body [CreateSubscriptionRequestBody]
|
381
463
|
# @param [Hash] opts the optional parameters
|
382
|
-
# @return [Array<(
|
383
|
-
def
|
464
|
+
# @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers
|
465
|
+
def create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
|
384
466
|
if @api_client.config.debugging
|
385
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
467
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.create_subscription ...'
|
386
468
|
end
|
387
469
|
# verify the required parameter 'app_id' is set
|
388
470
|
if @api_client.config.client_side_validation && app_id.nil?
|
389
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
471
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_subscription"
|
390
472
|
end
|
391
|
-
# verify the required parameter '
|
392
|
-
if @api_client.config.client_side_validation &&
|
393
|
-
fail ArgumentError, "Missing the required parameter '
|
473
|
+
# verify the required parameter 'alias_label' is set
|
474
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
475
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.create_subscription"
|
476
|
+
end
|
477
|
+
# verify the required parameter 'alias_id' is set
|
478
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
479
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_subscription"
|
480
|
+
end
|
481
|
+
# verify the required parameter 'create_subscription_request_body' is set
|
482
|
+
if @api_client.config.client_side_validation && create_subscription_request_body.nil?
|
483
|
+
fail ArgumentError, "Missing the required parameter 'create_subscription_request_body' when calling DefaultApi.create_subscription"
|
394
484
|
end
|
395
485
|
# resource path
|
396
|
-
local_var_path = '/
|
486
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))
|
397
487
|
|
398
488
|
# query parameters
|
399
489
|
query_params = opts[:query_params] || {}
|
400
|
-
query_params[:'app_id'] = app_id
|
401
490
|
|
402
491
|
# header parameters
|
403
492
|
header_params = opts[:header_params] || {}
|
404
493
|
# HTTP header 'Accept' (if needed)
|
405
494
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
495
|
+
# HTTP header 'Content-Type'
|
496
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
497
|
+
if !content_type.nil?
|
498
|
+
header_params['Content-Type'] = content_type
|
499
|
+
end
|
406
500
|
|
407
501
|
# form parameters
|
408
502
|
form_params = opts[:form_params] || {}
|
409
503
|
|
410
504
|
# http body (model)
|
411
|
-
post_body = opts[:debug_body]
|
505
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_subscription_request_body)
|
412
506
|
|
413
507
|
# return_type
|
414
|
-
return_type = opts[:debug_return_type] || '
|
508
|
+
return_type = opts[:debug_return_type] || 'InlineResponse201'
|
415
509
|
|
416
510
|
# auth_names
|
417
511
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
418
512
|
|
419
513
|
new_options = opts.merge(
|
420
|
-
:operation => :"DefaultApi.
|
514
|
+
:operation => :"DefaultApi.create_subscription",
|
421
515
|
:header_params => header_params,
|
422
516
|
:query_params => query_params,
|
423
517
|
:form_params => form_params,
|
@@ -426,44 +520,42 @@ module OneSignal
|
|
426
520
|
:return_type => return_type
|
427
521
|
)
|
428
522
|
|
429
|
-
data, status_code, headers = @api_client.call_api(:
|
523
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
430
524
|
if @api_client.config.debugging
|
431
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
525
|
+
@api_client.config.logger.debug "API called: DefaultApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
432
526
|
end
|
433
527
|
return data, status_code, headers
|
434
528
|
end
|
435
529
|
|
436
|
-
#
|
437
|
-
#
|
438
|
-
# @param
|
439
|
-
# @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
530
|
+
# 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.
|
531
|
+
# @param app_id [String]
|
532
|
+
# @param user [User]
|
440
533
|
# @param [Hash] opts the optional parameters
|
441
|
-
# @return [
|
442
|
-
def
|
443
|
-
data, _status_code, _headers =
|
534
|
+
# @return [User]
|
535
|
+
def create_user(app_id, user, opts = {})
|
536
|
+
data, _status_code, _headers = create_user_with_http_info(app_id, user, opts)
|
444
537
|
data
|
445
538
|
end
|
446
539
|
|
447
|
-
#
|
448
|
-
#
|
449
|
-
# @param
|
450
|
-
# @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
540
|
+
# 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.
|
541
|
+
# @param app_id [String]
|
542
|
+
# @param user [User]
|
451
543
|
# @param [Hash] opts the optional parameters
|
452
|
-
# @return [Array<(
|
453
|
-
def
|
544
|
+
# @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
|
545
|
+
def create_user_with_http_info(app_id, user, opts = {})
|
454
546
|
if @api_client.config.debugging
|
455
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
547
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.create_user ...'
|
456
548
|
end
|
457
549
|
# verify the required parameter 'app_id' is set
|
458
550
|
if @api_client.config.client_side_validation && app_id.nil?
|
459
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
551
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_user"
|
460
552
|
end
|
461
|
-
# verify the required parameter '
|
462
|
-
if @api_client.config.client_side_validation &&
|
463
|
-
fail ArgumentError, "Missing the required parameter '
|
553
|
+
# verify the required parameter 'user' is set
|
554
|
+
if @api_client.config.client_side_validation && user.nil?
|
555
|
+
fail ArgumentError, "Missing the required parameter 'user' when calling DefaultApi.create_user"
|
464
556
|
end
|
465
557
|
# resource path
|
466
|
-
local_var_path = '/apps/{app_id}/
|
558
|
+
local_var_path = '/apps/{app_id}/users'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
467
559
|
|
468
560
|
# query parameters
|
469
561
|
query_params = opts[:query_params] || {}
|
@@ -472,21 +564,26 @@ module OneSignal
|
|
472
564
|
header_params = opts[:header_params] || {}
|
473
565
|
# HTTP header 'Accept' (if needed)
|
474
566
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
567
|
+
# HTTP header 'Content-Type'
|
568
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
569
|
+
if !content_type.nil?
|
570
|
+
header_params['Content-Type'] = content_type
|
571
|
+
end
|
475
572
|
|
476
573
|
# form parameters
|
477
574
|
form_params = opts[:form_params] || {}
|
478
575
|
|
479
576
|
# http body (model)
|
480
|
-
post_body = opts[:debug_body]
|
577
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
|
481
578
|
|
482
579
|
# return_type
|
483
|
-
return_type = opts[:debug_return_type] || '
|
580
|
+
return_type = opts[:debug_return_type] || 'User'
|
484
581
|
|
485
582
|
# auth_names
|
486
583
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
487
584
|
|
488
585
|
new_options = opts.merge(
|
489
|
-
:operation => :"DefaultApi.
|
586
|
+
:operation => :"DefaultApi.create_user",
|
490
587
|
:header_params => header_params,
|
491
588
|
:query_params => query_params,
|
492
589
|
:form_params => form_params,
|
@@ -495,40 +592,54 @@ module OneSignal
|
|
495
592
|
:return_type => return_type
|
496
593
|
)
|
497
594
|
|
498
|
-
data, status_code, headers = @api_client.call_api(:
|
595
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
499
596
|
if @api_client.config.debugging
|
500
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
597
|
+
@api_client.config.logger.debug "API called: DefaultApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
501
598
|
end
|
502
599
|
return data, status_code, headers
|
503
600
|
end
|
504
601
|
|
505
|
-
#
|
506
|
-
#
|
507
|
-
# @param
|
602
|
+
# Deletes an alias by alias label
|
603
|
+
# @param app_id [String]
|
604
|
+
# @param alias_label [String]
|
605
|
+
# @param alias_id [String]
|
606
|
+
# @param alias_label_to_delete [String]
|
508
607
|
# @param [Hash] opts the optional parameters
|
509
|
-
# @
|
510
|
-
|
511
|
-
|
512
|
-
data, _status_code, _headers = export_players_with_http_info(app_id, opts)
|
608
|
+
# @return [InlineResponse200]
|
609
|
+
def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
|
610
|
+
data, _status_code, _headers = delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts)
|
513
611
|
data
|
514
612
|
end
|
515
613
|
|
516
|
-
#
|
517
|
-
#
|
518
|
-
# @param
|
614
|
+
# Deletes an alias by alias label
|
615
|
+
# @param app_id [String]
|
616
|
+
# @param alias_label [String]
|
617
|
+
# @param alias_id [String]
|
618
|
+
# @param alias_label_to_delete [String]
|
519
619
|
# @param [Hash] opts the optional parameters
|
520
|
-
# @
|
521
|
-
|
522
|
-
def export_players_with_http_info(app_id, opts = {})
|
620
|
+
# @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
|
621
|
+
def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
|
523
622
|
if @api_client.config.debugging
|
524
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
623
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...'
|
525
624
|
end
|
526
625
|
# verify the required parameter 'app_id' is set
|
527
626
|
if @api_client.config.client_side_validation && app_id.nil?
|
528
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
627
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_alias"
|
628
|
+
end
|
629
|
+
# verify the required parameter 'alias_label' is set
|
630
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
631
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_alias"
|
632
|
+
end
|
633
|
+
# verify the required parameter 'alias_id' is set
|
634
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
635
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_alias"
|
636
|
+
end
|
637
|
+
# verify the required parameter 'alias_label_to_delete' is set
|
638
|
+
if @api_client.config.client_side_validation && alias_label_to_delete.nil?
|
639
|
+
fail ArgumentError, "Missing the required parameter 'alias_label_to_delete' when calling DefaultApi.delete_alias"
|
529
640
|
end
|
530
641
|
# resource path
|
531
|
-
local_var_path = '/
|
642
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)).sub('{' + 'alias_label_to_delete' + '}', CGI.escape(alias_label_to_delete.to_s))
|
532
643
|
|
533
644
|
# query parameters
|
534
645
|
query_params = opts[:query_params] || {}
|
@@ -537,26 +648,21 @@ module OneSignal
|
|
537
648
|
header_params = opts[:header_params] || {}
|
538
649
|
# HTTP header 'Accept' (if needed)
|
539
650
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
540
|
-
# HTTP header 'Content-Type'
|
541
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
542
|
-
if !content_type.nil?
|
543
|
-
header_params['Content-Type'] = content_type
|
544
|
-
end
|
545
651
|
|
546
652
|
# form parameters
|
547
653
|
form_params = opts[:form_params] || {}
|
548
654
|
|
549
655
|
# http body (model)
|
550
|
-
post_body = opts[:debug_body]
|
656
|
+
post_body = opts[:debug_body]
|
551
657
|
|
552
658
|
# return_type
|
553
|
-
return_type = opts[:debug_return_type] || '
|
659
|
+
return_type = opts[:debug_return_type] || 'InlineResponse200'
|
554
660
|
|
555
661
|
# auth_names
|
556
662
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
557
663
|
|
558
664
|
new_options = opts.merge(
|
559
|
-
:operation => :"DefaultApi.
|
665
|
+
:operation => :"DefaultApi.delete_alias",
|
560
666
|
:header_params => header_params,
|
561
667
|
:query_params => query_params,
|
562
668
|
:form_params => form_params,
|
@@ -565,41 +671,48 @@ module OneSignal
|
|
565
671
|
:return_type => return_type
|
566
672
|
)
|
567
673
|
|
568
|
-
data, status_code, headers = @api_client.call_api(:
|
674
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
569
675
|
if @api_client.config.debugging
|
570
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
676
|
+
@api_client.config.logger.debug "API called: DefaultApi#delete_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
571
677
|
end
|
572
678
|
return data, status_code, headers
|
573
679
|
end
|
574
680
|
|
575
|
-
#
|
576
|
-
#
|
577
|
-
# @param app_id [String]
|
681
|
+
# Delete a user record
|
682
|
+
# Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
|
683
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
684
|
+
# @param player_id [String] The OneSignal player_id
|
578
685
|
# @param [Hash] opts the optional parameters
|
579
|
-
# @return [
|
580
|
-
def
|
581
|
-
data, _status_code, _headers =
|
686
|
+
# @return [DeletePlayerSuccessResponse]
|
687
|
+
def delete_player(app_id, player_id, opts = {})
|
688
|
+
data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts)
|
582
689
|
data
|
583
690
|
end
|
584
691
|
|
585
|
-
#
|
586
|
-
#
|
587
|
-
# @param app_id [String]
|
692
|
+
# Delete a user record
|
693
|
+
# Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
|
694
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
695
|
+
# @param player_id [String] The OneSignal player_id
|
588
696
|
# @param [Hash] opts the optional parameters
|
589
|
-
# @return [Array<(
|
590
|
-
def
|
697
|
+
# @return [Array<(DeletePlayerSuccessResponse, Integer, Hash)>] DeletePlayerSuccessResponse data, response status code and response headers
|
698
|
+
def delete_player_with_http_info(app_id, player_id, opts = {})
|
591
699
|
if @api_client.config.debugging
|
592
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
700
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...'
|
593
701
|
end
|
594
702
|
# verify the required parameter 'app_id' is set
|
595
703
|
if @api_client.config.client_side_validation && app_id.nil?
|
596
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
704
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player"
|
705
|
+
end
|
706
|
+
# verify the required parameter 'player_id' is set
|
707
|
+
if @api_client.config.client_side_validation && player_id.nil?
|
708
|
+
fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player"
|
597
709
|
end
|
598
710
|
# resource path
|
599
|
-
local_var_path = '/
|
711
|
+
local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
|
600
712
|
|
601
713
|
# query parameters
|
602
714
|
query_params = opts[:query_params] || {}
|
715
|
+
query_params[:'app_id'] = app_id
|
603
716
|
|
604
717
|
# header parameters
|
605
718
|
header_params = opts[:header_params] || {}
|
@@ -613,13 +726,13 @@ module OneSignal
|
|
613
726
|
post_body = opts[:debug_body]
|
614
727
|
|
615
728
|
# return_type
|
616
|
-
return_type = opts[:debug_return_type] || '
|
729
|
+
return_type = opts[:debug_return_type] || 'DeletePlayerSuccessResponse'
|
617
730
|
|
618
731
|
# auth_names
|
619
|
-
auth_names = opts[:debug_auth_names] || ['
|
732
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
620
733
|
|
621
734
|
new_options = opts.merge(
|
622
|
-
:operation => :"DefaultApi.
|
735
|
+
:operation => :"DefaultApi.delete_player",
|
623
736
|
:header_params => header_params,
|
624
737
|
:query_params => query_params,
|
625
738
|
:form_params => form_params,
|
@@ -628,32 +741,44 @@ module OneSignal
|
|
628
741
|
:return_type => return_type
|
629
742
|
)
|
630
743
|
|
631
|
-
data, status_code, headers = @api_client.call_api(:
|
744
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
632
745
|
if @api_client.config.debugging
|
633
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
746
|
+
@api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
634
747
|
end
|
635
748
|
return data, status_code, headers
|
636
749
|
end
|
637
750
|
|
638
|
-
#
|
639
|
-
#
|
751
|
+
# Delete Segments
|
752
|
+
# 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.
|
753
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
754
|
+
# @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
640
755
|
# @param [Hash] opts the optional parameters
|
641
|
-
# @return [
|
642
|
-
def
|
643
|
-
data, _status_code, _headers =
|
756
|
+
# @return [DeleteSegmentSuccessResponse]
|
757
|
+
def delete_segments(app_id, segment_id, opts = {})
|
758
|
+
data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts)
|
644
759
|
data
|
645
760
|
end
|
646
761
|
|
647
|
-
#
|
648
|
-
#
|
762
|
+
# Delete Segments
|
763
|
+
# 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.
|
764
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
765
|
+
# @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
649
766
|
# @param [Hash] opts the optional parameters
|
650
|
-
# @return [Array<(
|
651
|
-
def
|
767
|
+
# @return [Array<(DeleteSegmentSuccessResponse, Integer, Hash)>] DeleteSegmentSuccessResponse data, response status code and response headers
|
768
|
+
def delete_segments_with_http_info(app_id, segment_id, opts = {})
|
652
769
|
if @api_client.config.debugging
|
653
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
770
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...'
|
771
|
+
end
|
772
|
+
# verify the required parameter 'app_id' is set
|
773
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
774
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments"
|
775
|
+
end
|
776
|
+
# verify the required parameter 'segment_id' is set
|
777
|
+
if @api_client.config.client_side_validation && segment_id.nil?
|
778
|
+
fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments"
|
654
779
|
end
|
655
780
|
# resource path
|
656
|
-
local_var_path = '/apps'
|
781
|
+
local_var_path = '/apps/{app_id}/segments/{segment_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'segment_id' + '}', CGI.escape(segment_id.to_s))
|
657
782
|
|
658
783
|
# query parameters
|
659
784
|
query_params = opts[:query_params] || {}
|
@@ -670,13 +795,13 @@ module OneSignal
|
|
670
795
|
post_body = opts[:debug_body]
|
671
796
|
|
672
797
|
# return_type
|
673
|
-
return_type = opts[:debug_return_type] || '
|
798
|
+
return_type = opts[:debug_return_type] || 'DeleteSegmentSuccessResponse'
|
674
799
|
|
675
800
|
# auth_names
|
676
|
-
auth_names = opts[:debug_auth_names] || ['
|
801
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
677
802
|
|
678
803
|
new_options = opts.merge(
|
679
|
-
:operation => :"DefaultApi.
|
804
|
+
:operation => :"DefaultApi.delete_segments",
|
680
805
|
:header_params => header_params,
|
681
806
|
:query_params => query_params,
|
682
807
|
:form_params => form_params,
|
@@ -685,48 +810,803 @@ module OneSignal
|
|
685
810
|
:return_type => return_type
|
686
811
|
)
|
687
812
|
|
688
|
-
data, status_code, headers = @api_client.call_api(:
|
813
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
689
814
|
if @api_client.config.debugging
|
690
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
815
|
+
@api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
691
816
|
end
|
692
817
|
return data, status_code, headers
|
693
818
|
end
|
694
819
|
|
695
|
-
#
|
696
|
-
# View the details of a single notification and outcomes associated with it
|
820
|
+
# Deletes the Subscription.
|
697
821
|
# @param app_id [String]
|
698
|
-
# @param
|
822
|
+
# @param subscription_id [String]
|
699
823
|
# @param [Hash] opts the optional parameters
|
700
|
-
# @return [
|
701
|
-
def
|
702
|
-
|
703
|
-
|
824
|
+
# @return [nil]
|
825
|
+
def delete_subscription(app_id, subscription_id, opts = {})
|
826
|
+
delete_subscription_with_http_info(app_id, subscription_id, opts)
|
827
|
+
nil
|
704
828
|
end
|
705
829
|
|
706
|
-
#
|
707
|
-
# View the details of a single notification and outcomes associated with it
|
830
|
+
# Deletes the Subscription.
|
708
831
|
# @param app_id [String]
|
709
|
-
# @param
|
832
|
+
# @param subscription_id [String]
|
710
833
|
# @param [Hash] opts the optional parameters
|
711
|
-
# @return [Array<(
|
712
|
-
def
|
834
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
835
|
+
def delete_subscription_with_http_info(app_id, subscription_id, opts = {})
|
713
836
|
if @api_client.config.debugging
|
714
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
837
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.delete_subscription ...'
|
715
838
|
end
|
716
839
|
# verify the required parameter 'app_id' is set
|
717
840
|
if @api_client.config.client_side_validation && app_id.nil?
|
718
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
841
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_subscription"
|
719
842
|
end
|
720
|
-
# verify the required parameter '
|
721
|
-
if @api_client.config.client_side_validation &&
|
722
|
-
fail ArgumentError, "Missing the required parameter '
|
843
|
+
# verify the required parameter 'subscription_id' is set
|
844
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
845
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.delete_subscription"
|
723
846
|
end
|
724
847
|
# resource path
|
725
|
-
local_var_path = '/
|
848
|
+
local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
726
849
|
|
727
850
|
# query parameters
|
728
851
|
query_params = opts[:query_params] || {}
|
729
|
-
|
852
|
+
|
853
|
+
# header parameters
|
854
|
+
header_params = opts[:header_params] || {}
|
855
|
+
# HTTP header 'Accept' (if needed)
|
856
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
857
|
+
|
858
|
+
# form parameters
|
859
|
+
form_params = opts[:form_params] || {}
|
860
|
+
|
861
|
+
# http body (model)
|
862
|
+
post_body = opts[:debug_body]
|
863
|
+
|
864
|
+
# return_type
|
865
|
+
return_type = opts[:debug_return_type]
|
866
|
+
|
867
|
+
# auth_names
|
868
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
869
|
+
|
870
|
+
new_options = opts.merge(
|
871
|
+
:operation => :"DefaultApi.delete_subscription",
|
872
|
+
:header_params => header_params,
|
873
|
+
:query_params => query_params,
|
874
|
+
:form_params => form_params,
|
875
|
+
:body => post_body,
|
876
|
+
:auth_names => auth_names,
|
877
|
+
:return_type => return_type
|
878
|
+
)
|
879
|
+
|
880
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
881
|
+
if @api_client.config.debugging
|
882
|
+
@api_client.config.logger.debug "API called: DefaultApi#delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
883
|
+
end
|
884
|
+
return data, status_code, headers
|
885
|
+
end
|
886
|
+
|
887
|
+
# Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
|
888
|
+
# @param app_id [String]
|
889
|
+
# @param alias_label [String]
|
890
|
+
# @param alias_id [String]
|
891
|
+
# @param [Hash] opts the optional parameters
|
892
|
+
# @return [nil]
|
893
|
+
def delete_user(app_id, alias_label, alias_id, opts = {})
|
894
|
+
delete_user_with_http_info(app_id, alias_label, alias_id, opts)
|
895
|
+
nil
|
896
|
+
end
|
897
|
+
|
898
|
+
# Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
|
899
|
+
# @param app_id [String]
|
900
|
+
# @param alias_label [String]
|
901
|
+
# @param alias_id [String]
|
902
|
+
# @param [Hash] opts the optional parameters
|
903
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
904
|
+
def delete_user_with_http_info(app_id, alias_label, alias_id, opts = {})
|
905
|
+
if @api_client.config.debugging
|
906
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.delete_user ...'
|
907
|
+
end
|
908
|
+
# verify the required parameter 'app_id' is set
|
909
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
910
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_user"
|
911
|
+
end
|
912
|
+
# verify the required parameter 'alias_label' is set
|
913
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
914
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_user"
|
915
|
+
end
|
916
|
+
# verify the required parameter 'alias_id' is set
|
917
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
918
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_user"
|
919
|
+
end
|
920
|
+
# resource path
|
921
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))
|
922
|
+
|
923
|
+
# query parameters
|
924
|
+
query_params = opts[:query_params] || {}
|
925
|
+
|
926
|
+
# header parameters
|
927
|
+
header_params = opts[:header_params] || {}
|
928
|
+
# HTTP header 'Accept' (if needed)
|
929
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
930
|
+
|
931
|
+
# form parameters
|
932
|
+
form_params = opts[:form_params] || {}
|
933
|
+
|
934
|
+
# http body (model)
|
935
|
+
post_body = opts[:debug_body]
|
936
|
+
|
937
|
+
# return_type
|
938
|
+
return_type = opts[:debug_return_type]
|
939
|
+
|
940
|
+
# auth_names
|
941
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
942
|
+
|
943
|
+
new_options = opts.merge(
|
944
|
+
:operation => :"DefaultApi.delete_user",
|
945
|
+
:header_params => header_params,
|
946
|
+
:query_params => query_params,
|
947
|
+
:form_params => form_params,
|
948
|
+
:body => post_body,
|
949
|
+
:auth_names => auth_names,
|
950
|
+
:return_type => return_type
|
951
|
+
)
|
952
|
+
|
953
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
954
|
+
if @api_client.config.debugging
|
955
|
+
@api_client.config.logger.debug "API called: DefaultApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
956
|
+
end
|
957
|
+
return data, status_code, headers
|
958
|
+
end
|
959
|
+
|
960
|
+
# Stop Live Activity
|
961
|
+
# Stops a Live Activity
|
962
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
963
|
+
# @param activity_id [String] Live Activity record ID
|
964
|
+
# @param subscription_id [String] Subscription ID
|
965
|
+
# @param [Hash] opts the optional parameters
|
966
|
+
# @return [nil]
|
967
|
+
def end_live_activity(app_id, activity_id, subscription_id, opts = {})
|
968
|
+
end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts)
|
969
|
+
nil
|
970
|
+
end
|
971
|
+
|
972
|
+
# Stop Live Activity
|
973
|
+
# Stops a Live Activity
|
974
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
975
|
+
# @param activity_id [String] Live Activity record ID
|
976
|
+
# @param subscription_id [String] Subscription ID
|
977
|
+
# @param [Hash] opts the optional parameters
|
978
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
979
|
+
def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts = {})
|
980
|
+
if @api_client.config.debugging
|
981
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.end_live_activity ...'
|
982
|
+
end
|
983
|
+
# verify the required parameter 'app_id' is set
|
984
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
985
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.end_live_activity"
|
986
|
+
end
|
987
|
+
# verify the required parameter 'activity_id' is set
|
988
|
+
if @api_client.config.client_side_validation && activity_id.nil?
|
989
|
+
fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.end_live_activity"
|
990
|
+
end
|
991
|
+
# verify the required parameter 'subscription_id' is set
|
992
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
993
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.end_live_activity"
|
994
|
+
end
|
995
|
+
# resource path
|
996
|
+
local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
997
|
+
|
998
|
+
# query parameters
|
999
|
+
query_params = opts[:query_params] || {}
|
1000
|
+
|
1001
|
+
# header parameters
|
1002
|
+
header_params = opts[:header_params] || {}
|
1003
|
+
# HTTP header 'Accept' (if needed)
|
1004
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1005
|
+
|
1006
|
+
# form parameters
|
1007
|
+
form_params = opts[:form_params] || {}
|
1008
|
+
|
1009
|
+
# http body (model)
|
1010
|
+
post_body = opts[:debug_body]
|
1011
|
+
|
1012
|
+
# return_type
|
1013
|
+
return_type = opts[:debug_return_type]
|
1014
|
+
|
1015
|
+
# auth_names
|
1016
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1017
|
+
|
1018
|
+
new_options = opts.merge(
|
1019
|
+
:operation => :"DefaultApi.end_live_activity",
|
1020
|
+
:header_params => header_params,
|
1021
|
+
:query_params => query_params,
|
1022
|
+
:form_params => form_params,
|
1023
|
+
:body => post_body,
|
1024
|
+
:auth_names => auth_names,
|
1025
|
+
:return_type => return_type
|
1026
|
+
)
|
1027
|
+
|
1028
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
1029
|
+
if @api_client.config.debugging
|
1030
|
+
@api_client.config.logger.debug "API called: DefaultApi#end_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1031
|
+
end
|
1032
|
+
return data, status_code, headers
|
1033
|
+
end
|
1034
|
+
|
1035
|
+
# Export CSV of Events
|
1036
|
+
# 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.
|
1037
|
+
# @param notification_id [String] The ID of the notification to export events from.
|
1038
|
+
# @param app_id [String] The ID of the app that the notification belongs to.
|
1039
|
+
# @param [Hash] opts the optional parameters
|
1040
|
+
# @return [ExportEventsSuccessResponse]
|
1041
|
+
def export_events(notification_id, app_id, opts = {})
|
1042
|
+
data, _status_code, _headers = export_events_with_http_info(notification_id, app_id, opts)
|
1043
|
+
data
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
# Export CSV of Events
|
1047
|
+
# 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.
|
1048
|
+
# @param notification_id [String] The ID of the notification to export events from.
|
1049
|
+
# @param app_id [String] The ID of the app that the notification belongs to.
|
1050
|
+
# @param [Hash] opts the optional parameters
|
1051
|
+
# @return [Array<(ExportEventsSuccessResponse, Integer, Hash)>] ExportEventsSuccessResponse data, response status code and response headers
|
1052
|
+
def export_events_with_http_info(notification_id, app_id, opts = {})
|
1053
|
+
if @api_client.config.debugging
|
1054
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.export_events ...'
|
1055
|
+
end
|
1056
|
+
# verify the required parameter 'notification_id' is set
|
1057
|
+
if @api_client.config.client_side_validation && notification_id.nil?
|
1058
|
+
fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.export_events"
|
1059
|
+
end
|
1060
|
+
# verify the required parameter 'app_id' is set
|
1061
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1062
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_events"
|
1063
|
+
end
|
1064
|
+
# resource path
|
1065
|
+
local_var_path = '/notifications/{notification_id}/export_events?app_id={app_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
|
1066
|
+
|
1067
|
+
# query parameters
|
1068
|
+
query_params = opts[:query_params] || {}
|
1069
|
+
query_params[:'app_id'] = app_id
|
1070
|
+
|
1071
|
+
# header parameters
|
1072
|
+
header_params = opts[:header_params] || {}
|
1073
|
+
# HTTP header 'Accept' (if needed)
|
1074
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1075
|
+
|
1076
|
+
# form parameters
|
1077
|
+
form_params = opts[:form_params] || {}
|
1078
|
+
|
1079
|
+
# http body (model)
|
1080
|
+
post_body = opts[:debug_body]
|
1081
|
+
|
1082
|
+
# return_type
|
1083
|
+
return_type = opts[:debug_return_type] || 'ExportEventsSuccessResponse'
|
1084
|
+
|
1085
|
+
# auth_names
|
1086
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1087
|
+
|
1088
|
+
new_options = opts.merge(
|
1089
|
+
:operation => :"DefaultApi.export_events",
|
1090
|
+
:header_params => header_params,
|
1091
|
+
:query_params => query_params,
|
1092
|
+
:form_params => form_params,
|
1093
|
+
:body => post_body,
|
1094
|
+
:auth_names => auth_names,
|
1095
|
+
:return_type => return_type
|
1096
|
+
)
|
1097
|
+
|
1098
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
1099
|
+
if @api_client.config.debugging
|
1100
|
+
@api_client.config.logger.debug "API called: DefaultApi#export_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1101
|
+
end
|
1102
|
+
return data, status_code, headers
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
# Export CSV of Players
|
1106
|
+
# 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. |
|
1107
|
+
# @param app_id [String] The app ID that you want to export devices from
|
1108
|
+
# @param [Hash] opts the optional parameters
|
1109
|
+
# @option opts [ExportPlayersRequestBody] :export_players_request_body
|
1110
|
+
# @return [ExportPlayersSuccessResponse]
|
1111
|
+
def export_players(app_id, opts = {})
|
1112
|
+
data, _status_code, _headers = export_players_with_http_info(app_id, opts)
|
1113
|
+
data
|
1114
|
+
end
|
1115
|
+
|
1116
|
+
# Export CSV of Players
|
1117
|
+
# Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. |
|
1118
|
+
# @param app_id [String] The app ID that you want to export devices from
|
1119
|
+
# @param [Hash] opts the optional parameters
|
1120
|
+
# @option opts [ExportPlayersRequestBody] :export_players_request_body
|
1121
|
+
# @return [Array<(ExportPlayersSuccessResponse, Integer, Hash)>] ExportPlayersSuccessResponse data, response status code and response headers
|
1122
|
+
def export_players_with_http_info(app_id, opts = {})
|
1123
|
+
if @api_client.config.debugging
|
1124
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...'
|
1125
|
+
end
|
1126
|
+
# verify the required parameter 'app_id' is set
|
1127
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1128
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players"
|
1129
|
+
end
|
1130
|
+
# resource path
|
1131
|
+
local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
1132
|
+
|
1133
|
+
# query parameters
|
1134
|
+
query_params = opts[:query_params] || {}
|
1135
|
+
|
1136
|
+
# header parameters
|
1137
|
+
header_params = opts[:header_params] || {}
|
1138
|
+
# HTTP header 'Accept' (if needed)
|
1139
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1140
|
+
# HTTP header 'Content-Type'
|
1141
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1142
|
+
if !content_type.nil?
|
1143
|
+
header_params['Content-Type'] = content_type
|
1144
|
+
end
|
1145
|
+
|
1146
|
+
# form parameters
|
1147
|
+
form_params = opts[:form_params] || {}
|
1148
|
+
|
1149
|
+
# http body (model)
|
1150
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body'])
|
1151
|
+
|
1152
|
+
# return_type
|
1153
|
+
return_type = opts[:debug_return_type] || 'ExportPlayersSuccessResponse'
|
1154
|
+
|
1155
|
+
# auth_names
|
1156
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1157
|
+
|
1158
|
+
new_options = opts.merge(
|
1159
|
+
:operation => :"DefaultApi.export_players",
|
1160
|
+
:header_params => header_params,
|
1161
|
+
:query_params => query_params,
|
1162
|
+
:form_params => form_params,
|
1163
|
+
:body => post_body,
|
1164
|
+
:auth_names => auth_names,
|
1165
|
+
:return_type => return_type
|
1166
|
+
)
|
1167
|
+
|
1168
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
1169
|
+
if @api_client.config.debugging
|
1170
|
+
@api_client.config.logger.debug "API called: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1171
|
+
end
|
1172
|
+
return data, status_code, headers
|
1173
|
+
end
|
1174
|
+
|
1175
|
+
# Lists all Aliases for the User identified by :subscription_id.
|
1176
|
+
# @param app_id [String]
|
1177
|
+
# @param subscription_id [String]
|
1178
|
+
# @param [Hash] opts the optional parameters
|
1179
|
+
# @return [UserIdentityResponse]
|
1180
|
+
def fetch_aliases(app_id, subscription_id, opts = {})
|
1181
|
+
data, _status_code, _headers = fetch_aliases_with_http_info(app_id, subscription_id, opts)
|
1182
|
+
data
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
# Lists all Aliases for the User identified by :subscription_id.
|
1186
|
+
# @param app_id [String]
|
1187
|
+
# @param subscription_id [String]
|
1188
|
+
# @param [Hash] opts the optional parameters
|
1189
|
+
# @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
|
1190
|
+
def fetch_aliases_with_http_info(app_id, subscription_id, opts = {})
|
1191
|
+
if @api_client.config.debugging
|
1192
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.fetch_aliases ...'
|
1193
|
+
end
|
1194
|
+
# verify the required parameter 'app_id' is set
|
1195
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1196
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_aliases"
|
1197
|
+
end
|
1198
|
+
# verify the required parameter 'subscription_id' is set
|
1199
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
1200
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.fetch_aliases"
|
1201
|
+
end
|
1202
|
+
# resource path
|
1203
|
+
local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
1204
|
+
|
1205
|
+
# query parameters
|
1206
|
+
query_params = opts[:query_params] || {}
|
1207
|
+
|
1208
|
+
# header parameters
|
1209
|
+
header_params = opts[:header_params] || {}
|
1210
|
+
# HTTP header 'Accept' (if needed)
|
1211
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1212
|
+
|
1213
|
+
# form parameters
|
1214
|
+
form_params = opts[:form_params] || {}
|
1215
|
+
|
1216
|
+
# http body (model)
|
1217
|
+
post_body = opts[:debug_body]
|
1218
|
+
|
1219
|
+
# return_type
|
1220
|
+
return_type = opts[:debug_return_type] || 'UserIdentityResponse'
|
1221
|
+
|
1222
|
+
# auth_names
|
1223
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1224
|
+
|
1225
|
+
new_options = opts.merge(
|
1226
|
+
:operation => :"DefaultApi.fetch_aliases",
|
1227
|
+
:header_params => header_params,
|
1228
|
+
:query_params => query_params,
|
1229
|
+
:form_params => form_params,
|
1230
|
+
:body => post_body,
|
1231
|
+
:auth_names => auth_names,
|
1232
|
+
:return_type => return_type
|
1233
|
+
)
|
1234
|
+
|
1235
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1236
|
+
if @api_client.config.debugging
|
1237
|
+
@api_client.config.logger.debug "API called: DefaultApi#fetch_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1238
|
+
end
|
1239
|
+
return data, status_code, headers
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
# Returns the User’s properties, Aliases, and Subscriptions.
|
1243
|
+
# @param app_id [String]
|
1244
|
+
# @param alias_label [String]
|
1245
|
+
# @param alias_id [String]
|
1246
|
+
# @param [Hash] opts the optional parameters
|
1247
|
+
# @return [User]
|
1248
|
+
def fetch_user(app_id, alias_label, alias_id, opts = {})
|
1249
|
+
data, _status_code, _headers = fetch_user_with_http_info(app_id, alias_label, alias_id, opts)
|
1250
|
+
data
|
1251
|
+
end
|
1252
|
+
|
1253
|
+
# Returns the User’s properties, Aliases, and Subscriptions.
|
1254
|
+
# @param app_id [String]
|
1255
|
+
# @param alias_label [String]
|
1256
|
+
# @param alias_id [String]
|
1257
|
+
# @param [Hash] opts the optional parameters
|
1258
|
+
# @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
|
1259
|
+
def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {})
|
1260
|
+
if @api_client.config.debugging
|
1261
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user ...'
|
1262
|
+
end
|
1263
|
+
# verify the required parameter 'app_id' is set
|
1264
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1265
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user"
|
1266
|
+
end
|
1267
|
+
# verify the required parameter 'alias_label' is set
|
1268
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
1269
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user"
|
1270
|
+
end
|
1271
|
+
# verify the required parameter 'alias_id' is set
|
1272
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
1273
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user"
|
1274
|
+
end
|
1275
|
+
# resource path
|
1276
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))
|
1277
|
+
|
1278
|
+
# query parameters
|
1279
|
+
query_params = opts[:query_params] || {}
|
1280
|
+
|
1281
|
+
# header parameters
|
1282
|
+
header_params = opts[:header_params] || {}
|
1283
|
+
# HTTP header 'Accept' (if needed)
|
1284
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1285
|
+
|
1286
|
+
# form parameters
|
1287
|
+
form_params = opts[:form_params] || {}
|
1288
|
+
|
1289
|
+
# http body (model)
|
1290
|
+
post_body = opts[:debug_body]
|
1291
|
+
|
1292
|
+
# return_type
|
1293
|
+
return_type = opts[:debug_return_type] || 'User'
|
1294
|
+
|
1295
|
+
# auth_names
|
1296
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1297
|
+
|
1298
|
+
new_options = opts.merge(
|
1299
|
+
:operation => :"DefaultApi.fetch_user",
|
1300
|
+
:header_params => header_params,
|
1301
|
+
:query_params => query_params,
|
1302
|
+
:form_params => form_params,
|
1303
|
+
:body => post_body,
|
1304
|
+
:auth_names => auth_names,
|
1305
|
+
:return_type => return_type
|
1306
|
+
)
|
1307
|
+
|
1308
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1309
|
+
if @api_client.config.debugging
|
1310
|
+
@api_client.config.logger.debug "API called: DefaultApi#fetch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1311
|
+
end
|
1312
|
+
return data, status_code, headers
|
1313
|
+
end
|
1314
|
+
|
1315
|
+
# Lists all Aliases for the User identified by (:alias_label, :alias_id).
|
1316
|
+
# @param app_id [String]
|
1317
|
+
# @param alias_label [String]
|
1318
|
+
# @param alias_id [String]
|
1319
|
+
# @param [Hash] opts the optional parameters
|
1320
|
+
# @return [InlineResponse200]
|
1321
|
+
def fetch_user_identity(app_id, alias_label, alias_id, opts = {})
|
1322
|
+
data, _status_code, _headers = fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts)
|
1323
|
+
data
|
1324
|
+
end
|
1325
|
+
|
1326
|
+
# Lists all Aliases for the User identified by (:alias_label, :alias_id).
|
1327
|
+
# @param app_id [String]
|
1328
|
+
# @param alias_label [String]
|
1329
|
+
# @param alias_id [String]
|
1330
|
+
# @param [Hash] opts the optional parameters
|
1331
|
+
# @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
|
1332
|
+
def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {})
|
1333
|
+
if @api_client.config.debugging
|
1334
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user_identity ...'
|
1335
|
+
end
|
1336
|
+
# verify the required parameter 'app_id' is set
|
1337
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1338
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user_identity"
|
1339
|
+
end
|
1340
|
+
# verify the required parameter 'alias_label' is set
|
1341
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
1342
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user_identity"
|
1343
|
+
end
|
1344
|
+
# verify the required parameter 'alias_id' is set
|
1345
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
1346
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user_identity"
|
1347
|
+
end
|
1348
|
+
# resource path
|
1349
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))
|
1350
|
+
|
1351
|
+
# query parameters
|
1352
|
+
query_params = opts[:query_params] || {}
|
1353
|
+
|
1354
|
+
# header parameters
|
1355
|
+
header_params = opts[:header_params] || {}
|
1356
|
+
# HTTP header 'Accept' (if needed)
|
1357
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1358
|
+
|
1359
|
+
# form parameters
|
1360
|
+
form_params = opts[:form_params] || {}
|
1361
|
+
|
1362
|
+
# http body (model)
|
1363
|
+
post_body = opts[:debug_body]
|
1364
|
+
|
1365
|
+
# return_type
|
1366
|
+
return_type = opts[:debug_return_type] || 'InlineResponse200'
|
1367
|
+
|
1368
|
+
# auth_names
|
1369
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1370
|
+
|
1371
|
+
new_options = opts.merge(
|
1372
|
+
:operation => :"DefaultApi.fetch_user_identity",
|
1373
|
+
:header_params => header_params,
|
1374
|
+
:query_params => query_params,
|
1375
|
+
:form_params => form_params,
|
1376
|
+
:body => post_body,
|
1377
|
+
:auth_names => auth_names,
|
1378
|
+
:return_type => return_type
|
1379
|
+
)
|
1380
|
+
|
1381
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1382
|
+
if @api_client.config.debugging
|
1383
|
+
@api_client.config.logger.debug "API called: DefaultApi#fetch_user_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1384
|
+
end
|
1385
|
+
return data, status_code, headers
|
1386
|
+
end
|
1387
|
+
|
1388
|
+
# View an app
|
1389
|
+
# View the details of a single OneSignal app
|
1390
|
+
# @param app_id [String] An app id
|
1391
|
+
# @param [Hash] opts the optional parameters
|
1392
|
+
# @return [App]
|
1393
|
+
def get_app(app_id, opts = {})
|
1394
|
+
data, _status_code, _headers = get_app_with_http_info(app_id, opts)
|
1395
|
+
data
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
# View an app
|
1399
|
+
# View the details of a single OneSignal app
|
1400
|
+
# @param app_id [String] An app id
|
1401
|
+
# @param [Hash] opts the optional parameters
|
1402
|
+
# @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
|
1403
|
+
def get_app_with_http_info(app_id, opts = {})
|
1404
|
+
if @api_client.config.debugging
|
1405
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_app ...'
|
1406
|
+
end
|
1407
|
+
# verify the required parameter 'app_id' is set
|
1408
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1409
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app"
|
1410
|
+
end
|
1411
|
+
# resource path
|
1412
|
+
local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
1413
|
+
|
1414
|
+
# query parameters
|
1415
|
+
query_params = opts[:query_params] || {}
|
1416
|
+
|
1417
|
+
# header parameters
|
1418
|
+
header_params = opts[:header_params] || {}
|
1419
|
+
# HTTP header 'Accept' (if needed)
|
1420
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1421
|
+
|
1422
|
+
# form parameters
|
1423
|
+
form_params = opts[:form_params] || {}
|
1424
|
+
|
1425
|
+
# http body (model)
|
1426
|
+
post_body = opts[:debug_body]
|
1427
|
+
|
1428
|
+
# return_type
|
1429
|
+
return_type = opts[:debug_return_type] || 'App'
|
1430
|
+
|
1431
|
+
# auth_names
|
1432
|
+
auth_names = opts[:debug_auth_names] || ['user_key']
|
1433
|
+
|
1434
|
+
new_options = opts.merge(
|
1435
|
+
:operation => :"DefaultApi.get_app",
|
1436
|
+
:header_params => header_params,
|
1437
|
+
:query_params => query_params,
|
1438
|
+
:form_params => form_params,
|
1439
|
+
:body => post_body,
|
1440
|
+
:auth_names => auth_names,
|
1441
|
+
:return_type => return_type
|
1442
|
+
)
|
1443
|
+
|
1444
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1445
|
+
if @api_client.config.debugging
|
1446
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1447
|
+
end
|
1448
|
+
return data, status_code, headers
|
1449
|
+
end
|
1450
|
+
|
1451
|
+
# View apps
|
1452
|
+
# View the details of all of your current OneSignal apps
|
1453
|
+
# @param [Hash] opts the optional parameters
|
1454
|
+
# @return [Array<App>]
|
1455
|
+
def get_apps(opts = {})
|
1456
|
+
data, _status_code, _headers = get_apps_with_http_info(opts)
|
1457
|
+
data
|
1458
|
+
end
|
1459
|
+
|
1460
|
+
# View apps
|
1461
|
+
# View the details of all of your current OneSignal apps
|
1462
|
+
# @param [Hash] opts the optional parameters
|
1463
|
+
# @return [Array<(Array<App>, Integer, Hash)>] Array<App> data, response status code and response headers
|
1464
|
+
def get_apps_with_http_info(opts = {})
|
1465
|
+
if @api_client.config.debugging
|
1466
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...'
|
1467
|
+
end
|
1468
|
+
# resource path
|
1469
|
+
local_var_path = '/apps'
|
1470
|
+
|
1471
|
+
# query parameters
|
1472
|
+
query_params = opts[:query_params] || {}
|
1473
|
+
|
1474
|
+
# header parameters
|
1475
|
+
header_params = opts[:header_params] || {}
|
1476
|
+
# HTTP header 'Accept' (if needed)
|
1477
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1478
|
+
|
1479
|
+
# form parameters
|
1480
|
+
form_params = opts[:form_params] || {}
|
1481
|
+
|
1482
|
+
# http body (model)
|
1483
|
+
post_body = opts[:debug_body]
|
1484
|
+
|
1485
|
+
# return_type
|
1486
|
+
return_type = opts[:debug_return_type] || 'Array<App>'
|
1487
|
+
|
1488
|
+
# auth_names
|
1489
|
+
auth_names = opts[:debug_auth_names] || ['user_key']
|
1490
|
+
|
1491
|
+
new_options = opts.merge(
|
1492
|
+
:operation => :"DefaultApi.get_apps",
|
1493
|
+
:header_params => header_params,
|
1494
|
+
:query_params => query_params,
|
1495
|
+
:form_params => form_params,
|
1496
|
+
:body => post_body,
|
1497
|
+
:auth_names => auth_names,
|
1498
|
+
:return_type => return_type
|
1499
|
+
)
|
1500
|
+
|
1501
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1502
|
+
if @api_client.config.debugging
|
1503
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1504
|
+
end
|
1505
|
+
return data, status_code, headers
|
1506
|
+
end
|
1507
|
+
|
1508
|
+
# Manifest of In-App Messages the Subscription is eligible to display by the SDK.
|
1509
|
+
# @param app_id [String]
|
1510
|
+
# @param subscription_id [String]
|
1511
|
+
# @param [Hash] opts the optional parameters
|
1512
|
+
# @return [InlineResponse2003]
|
1513
|
+
def get_eligible_iams(app_id, subscription_id, opts = {})
|
1514
|
+
data, _status_code, _headers = get_eligible_iams_with_http_info(app_id, subscription_id, opts)
|
1515
|
+
data
|
1516
|
+
end
|
1517
|
+
|
1518
|
+
# Manifest of In-App Messages the Subscription is eligible to display by the SDK.
|
1519
|
+
# @param app_id [String]
|
1520
|
+
# @param subscription_id [String]
|
1521
|
+
# @param [Hash] opts the optional parameters
|
1522
|
+
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
|
1523
|
+
def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {})
|
1524
|
+
if @api_client.config.debugging
|
1525
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_eligible_iams ...'
|
1526
|
+
end
|
1527
|
+
# verify the required parameter 'app_id' is set
|
1528
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1529
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_eligible_iams"
|
1530
|
+
end
|
1531
|
+
# verify the required parameter 'subscription_id' is set
|
1532
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
1533
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_eligible_iams"
|
1534
|
+
end
|
1535
|
+
# resource path
|
1536
|
+
local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/iams'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
1537
|
+
|
1538
|
+
# query parameters
|
1539
|
+
query_params = opts[:query_params] || {}
|
1540
|
+
|
1541
|
+
# header parameters
|
1542
|
+
header_params = opts[:header_params] || {}
|
1543
|
+
# HTTP header 'Accept' (if needed)
|
1544
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1545
|
+
|
1546
|
+
# form parameters
|
1547
|
+
form_params = opts[:form_params] || {}
|
1548
|
+
|
1549
|
+
# http body (model)
|
1550
|
+
post_body = opts[:debug_body]
|
1551
|
+
|
1552
|
+
# return_type
|
1553
|
+
return_type = opts[:debug_return_type] || 'InlineResponse2003'
|
1554
|
+
|
1555
|
+
# auth_names
|
1556
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1557
|
+
|
1558
|
+
new_options = opts.merge(
|
1559
|
+
:operation => :"DefaultApi.get_eligible_iams",
|
1560
|
+
:header_params => header_params,
|
1561
|
+
:query_params => query_params,
|
1562
|
+
:form_params => form_params,
|
1563
|
+
:body => post_body,
|
1564
|
+
:auth_names => auth_names,
|
1565
|
+
:return_type => return_type
|
1566
|
+
)
|
1567
|
+
|
1568
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1569
|
+
if @api_client.config.debugging
|
1570
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_eligible_iams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1571
|
+
end
|
1572
|
+
return data, status_code, headers
|
1573
|
+
end
|
1574
|
+
|
1575
|
+
# View notification
|
1576
|
+
# View the details of a single notification and outcomes associated with it
|
1577
|
+
# @param app_id [String]
|
1578
|
+
# @param notification_id [String]
|
1579
|
+
# @param [Hash] opts the optional parameters
|
1580
|
+
# @return [NotificationWithMeta]
|
1581
|
+
def get_notification(app_id, notification_id, opts = {})
|
1582
|
+
data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts)
|
1583
|
+
data
|
1584
|
+
end
|
1585
|
+
|
1586
|
+
# View notification
|
1587
|
+
# View the details of a single notification and outcomes associated with it
|
1588
|
+
# @param app_id [String]
|
1589
|
+
# @param notification_id [String]
|
1590
|
+
# @param [Hash] opts the optional parameters
|
1591
|
+
# @return [Array<(NotificationWithMeta, Integer, Hash)>] NotificationWithMeta data, response status code and response headers
|
1592
|
+
def get_notification_with_http_info(app_id, notification_id, opts = {})
|
1593
|
+
if @api_client.config.debugging
|
1594
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...'
|
1595
|
+
end
|
1596
|
+
# verify the required parameter 'app_id' is set
|
1597
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1598
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notification"
|
1599
|
+
end
|
1600
|
+
# verify the required parameter 'notification_id' is set
|
1601
|
+
if @api_client.config.client_side_validation && notification_id.nil?
|
1602
|
+
fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification"
|
1603
|
+
end
|
1604
|
+
# resource path
|
1605
|
+
local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
|
1606
|
+
|
1607
|
+
# query parameters
|
1608
|
+
query_params = opts[:query_params] || {}
|
1609
|
+
query_params[:'app_id'] = app_id
|
730
1610
|
|
731
1611
|
# header parameters
|
732
1612
|
header_params = opts[:header_params] || {}
|
@@ -767,7 +1647,7 @@ module OneSignal
|
|
767
1647
|
# @param notification_id [String] The \"id\" of the message found in the Notification object
|
768
1648
|
# @param get_notification_request_body [GetNotificationRequestBody]
|
769
1649
|
# @param [Hash] opts the optional parameters
|
770
|
-
# @return [
|
1650
|
+
# @return [NotificationHistorySuccessResponse]
|
771
1651
|
def get_notification_history(notification_id, get_notification_request_body, opts = {})
|
772
1652
|
data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_request_body, opts)
|
773
1653
|
data
|
@@ -778,7 +1658,7 @@ module OneSignal
|
|
778
1658
|
# @param notification_id [String] The \"id\" of the message found in the Notification object
|
779
1659
|
# @param get_notification_request_body [GetNotificationRequestBody]
|
780
1660
|
# @param [Hash] opts the optional parameters
|
781
|
-
# @return [Array<(
|
1661
|
+
# @return [Array<(NotificationHistorySuccessResponse, Integer, Hash)>] NotificationHistorySuccessResponse data, response status code and response headers
|
782
1662
|
def get_notification_history_with_http_info(notification_id, get_notification_request_body, opts = {})
|
783
1663
|
if @api_client.config.debugging
|
784
1664
|
@api_client.config.logger.debug 'Calling API: DefaultApi.get_notification_history ...'
|
@@ -814,7 +1694,7 @@ module OneSignal
|
|
814
1694
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(get_notification_request_body)
|
815
1695
|
|
816
1696
|
# return_type
|
817
|
-
return_type = opts[:debug_return_type] || '
|
1697
|
+
return_type = opts[:debug_return_type] || 'NotificationHistorySuccessResponse'
|
818
1698
|
|
819
1699
|
# auth_names
|
820
1700
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -940,46 +1820,273 @@ module OneSignal
|
|
940
1820
|
# @return [Array<(OutcomesData, Integer, Hash)>] OutcomesData data, response status code and response headers
|
941
1821
|
def get_outcomes_with_http_info(app_id, outcome_names, opts = {})
|
942
1822
|
if @api_client.config.debugging
|
943
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...'
|
1823
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...'
|
1824
|
+
end
|
1825
|
+
# verify the required parameter 'app_id' is set
|
1826
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1827
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_outcomes"
|
1828
|
+
end
|
1829
|
+
# verify the required parameter 'outcome_names' is set
|
1830
|
+
if @api_client.config.client_side_validation && outcome_names.nil?
|
1831
|
+
fail ArgumentError, "Missing the required parameter 'outcome_names' when calling DefaultApi.get_outcomes"
|
1832
|
+
end
|
1833
|
+
# resource path
|
1834
|
+
local_var_path = '/apps/{app_id}/outcomes'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
1835
|
+
|
1836
|
+
# query parameters
|
1837
|
+
query_params = opts[:query_params] || {}
|
1838
|
+
query_params[:'outcome_names'] = outcome_names
|
1839
|
+
query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil?
|
1840
|
+
query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil?
|
1841
|
+
query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil?
|
1842
|
+
query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].nil?
|
1843
|
+
|
1844
|
+
# header parameters
|
1845
|
+
header_params = opts[:header_params] || {}
|
1846
|
+
# HTTP header 'Accept' (if needed)
|
1847
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1848
|
+
|
1849
|
+
# form parameters
|
1850
|
+
form_params = opts[:form_params] || {}
|
1851
|
+
|
1852
|
+
# http body (model)
|
1853
|
+
post_body = opts[:debug_body]
|
1854
|
+
|
1855
|
+
# return_type
|
1856
|
+
return_type = opts[:debug_return_type] || 'OutcomesData'
|
1857
|
+
|
1858
|
+
# auth_names
|
1859
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1860
|
+
|
1861
|
+
new_options = opts.merge(
|
1862
|
+
:operation => :"DefaultApi.get_outcomes",
|
1863
|
+
:header_params => header_params,
|
1864
|
+
:query_params => query_params,
|
1865
|
+
:form_params => form_params,
|
1866
|
+
:body => post_body,
|
1867
|
+
:auth_names => auth_names,
|
1868
|
+
:return_type => return_type
|
1869
|
+
)
|
1870
|
+
|
1871
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1872
|
+
if @api_client.config.debugging
|
1873
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1874
|
+
end
|
1875
|
+
return data, status_code, headers
|
1876
|
+
end
|
1877
|
+
|
1878
|
+
# View device
|
1879
|
+
# View the details of an existing device in one of your OneSignal apps
|
1880
|
+
# @param app_id [String] Your app_id for this device
|
1881
|
+
# @param player_id [String] Player's OneSignal ID
|
1882
|
+
# @param [Hash] opts the optional parameters
|
1883
|
+
# @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
|
1884
|
+
# @return [Player]
|
1885
|
+
def get_player(app_id, player_id, opts = {})
|
1886
|
+
data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts)
|
1887
|
+
data
|
1888
|
+
end
|
1889
|
+
|
1890
|
+
# View device
|
1891
|
+
# View the details of an existing device in one of your OneSignal apps
|
1892
|
+
# @param app_id [String] Your app_id for this device
|
1893
|
+
# @param player_id [String] Player's OneSignal ID
|
1894
|
+
# @param [Hash] opts the optional parameters
|
1895
|
+
# @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
|
1896
|
+
# @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers
|
1897
|
+
def get_player_with_http_info(app_id, player_id, opts = {})
|
1898
|
+
if @api_client.config.debugging
|
1899
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...'
|
1900
|
+
end
|
1901
|
+
# verify the required parameter 'app_id' is set
|
1902
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1903
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player"
|
1904
|
+
end
|
1905
|
+
# verify the required parameter 'player_id' is set
|
1906
|
+
if @api_client.config.client_side_validation && player_id.nil?
|
1907
|
+
fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player"
|
1908
|
+
end
|
1909
|
+
# resource path
|
1910
|
+
local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
|
1911
|
+
|
1912
|
+
# query parameters
|
1913
|
+
query_params = opts[:query_params] || {}
|
1914
|
+
query_params[:'app_id'] = app_id
|
1915
|
+
query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil?
|
1916
|
+
|
1917
|
+
# header parameters
|
1918
|
+
header_params = opts[:header_params] || {}
|
1919
|
+
# HTTP header 'Accept' (if needed)
|
1920
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1921
|
+
|
1922
|
+
# form parameters
|
1923
|
+
form_params = opts[:form_params] || {}
|
1924
|
+
|
1925
|
+
# http body (model)
|
1926
|
+
post_body = opts[:debug_body]
|
1927
|
+
|
1928
|
+
# return_type
|
1929
|
+
return_type = opts[:debug_return_type] || 'Player'
|
1930
|
+
|
1931
|
+
# auth_names
|
1932
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
1933
|
+
|
1934
|
+
new_options = opts.merge(
|
1935
|
+
:operation => :"DefaultApi.get_player",
|
1936
|
+
:header_params => header_params,
|
1937
|
+
:query_params => query_params,
|
1938
|
+
:form_params => form_params,
|
1939
|
+
:body => post_body,
|
1940
|
+
:auth_names => auth_names,
|
1941
|
+
:return_type => return_type
|
1942
|
+
)
|
1943
|
+
|
1944
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1945
|
+
if @api_client.config.debugging
|
1946
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1947
|
+
end
|
1948
|
+
return data, status_code, headers
|
1949
|
+
end
|
1950
|
+
|
1951
|
+
# View devices
|
1952
|
+
# 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.
|
1953
|
+
# @param app_id [String] The app ID that you want to view players from
|
1954
|
+
# @param [Hash] opts the optional parameters
|
1955
|
+
# @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300
|
1956
|
+
# @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
|
1957
|
+
# @return [PlayerSlice]
|
1958
|
+
def get_players(app_id, opts = {})
|
1959
|
+
data, _status_code, _headers = get_players_with_http_info(app_id, opts)
|
1960
|
+
data
|
1961
|
+
end
|
1962
|
+
|
1963
|
+
# View devices
|
1964
|
+
# 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.
|
1965
|
+
# @param app_id [String] The app ID that you want to view players from
|
1966
|
+
# @param [Hash] opts the optional parameters
|
1967
|
+
# @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300
|
1968
|
+
# @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
|
1969
|
+
# @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers
|
1970
|
+
def get_players_with_http_info(app_id, opts = {})
|
1971
|
+
if @api_client.config.debugging
|
1972
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...'
|
1973
|
+
end
|
1974
|
+
# verify the required parameter 'app_id' is set
|
1975
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
1976
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players"
|
1977
|
+
end
|
1978
|
+
# resource path
|
1979
|
+
local_var_path = '/players'
|
1980
|
+
|
1981
|
+
# query parameters
|
1982
|
+
query_params = opts[:query_params] || {}
|
1983
|
+
query_params[:'app_id'] = app_id
|
1984
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
1985
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
1986
|
+
|
1987
|
+
# header parameters
|
1988
|
+
header_params = opts[:header_params] || {}
|
1989
|
+
# HTTP header 'Accept' (if needed)
|
1990
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1991
|
+
|
1992
|
+
# form parameters
|
1993
|
+
form_params = opts[:form_params] || {}
|
1994
|
+
|
1995
|
+
# http body (model)
|
1996
|
+
post_body = opts[:debug_body]
|
1997
|
+
|
1998
|
+
# return_type
|
1999
|
+
return_type = opts[:debug_return_type] || 'PlayerSlice'
|
2000
|
+
|
2001
|
+
# auth_names
|
2002
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
2003
|
+
|
2004
|
+
new_options = opts.merge(
|
2005
|
+
:operation => :"DefaultApi.get_players",
|
2006
|
+
:header_params => header_params,
|
2007
|
+
:query_params => query_params,
|
2008
|
+
:form_params => form_params,
|
2009
|
+
:body => post_body,
|
2010
|
+
:auth_names => auth_names,
|
2011
|
+
:return_type => return_type
|
2012
|
+
)
|
2013
|
+
|
2014
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2015
|
+
if @api_client.config.debugging
|
2016
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2017
|
+
end
|
2018
|
+
return data, status_code, headers
|
2019
|
+
end
|
2020
|
+
|
2021
|
+
# Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
|
2022
|
+
# @param app_id [String]
|
2023
|
+
# @param alias_label [String]
|
2024
|
+
# @param alias_id [String]
|
2025
|
+
# @param user_identity_request_body [UserIdentityRequestBody]
|
2026
|
+
# @param [Hash] opts the optional parameters
|
2027
|
+
# @return [InlineResponse200]
|
2028
|
+
def identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
|
2029
|
+
data, _status_code, _headers = identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts)
|
2030
|
+
data
|
2031
|
+
end
|
2032
|
+
|
2033
|
+
# Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
|
2034
|
+
# @param app_id [String]
|
2035
|
+
# @param alias_label [String]
|
2036
|
+
# @param alias_id [String]
|
2037
|
+
# @param user_identity_request_body [UserIdentityRequestBody]
|
2038
|
+
# @param [Hash] opts the optional parameters
|
2039
|
+
# @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
|
2040
|
+
def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
|
2041
|
+
if @api_client.config.debugging
|
2042
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_alias ...'
|
944
2043
|
end
|
945
2044
|
# verify the required parameter 'app_id' is set
|
946
2045
|
if @api_client.config.client_side_validation && app_id.nil?
|
947
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
2046
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_alias"
|
948
2047
|
end
|
949
|
-
# verify the required parameter '
|
950
|
-
if @api_client.config.client_side_validation &&
|
951
|
-
fail ArgumentError, "Missing the required parameter '
|
2048
|
+
# verify the required parameter 'alias_label' is set
|
2049
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
2050
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.identify_user_by_alias"
|
2051
|
+
end
|
2052
|
+
# verify the required parameter 'alias_id' is set
|
2053
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
2054
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.identify_user_by_alias"
|
2055
|
+
end
|
2056
|
+
# verify the required parameter 'user_identity_request_body' is set
|
2057
|
+
if @api_client.config.client_side_validation && user_identity_request_body.nil?
|
2058
|
+
fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_alias"
|
952
2059
|
end
|
953
2060
|
# resource path
|
954
|
-
local_var_path = '/apps/{app_id}/
|
2061
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))
|
955
2062
|
|
956
2063
|
# query parameters
|
957
2064
|
query_params = opts[:query_params] || {}
|
958
|
-
query_params[:'outcome_names'] = outcome_names
|
959
|
-
query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil?
|
960
|
-
query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil?
|
961
|
-
query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil?
|
962
|
-
query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].nil?
|
963
2065
|
|
964
2066
|
# header parameters
|
965
2067
|
header_params = opts[:header_params] || {}
|
966
2068
|
# HTTP header 'Accept' (if needed)
|
967
2069
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2070
|
+
# HTTP header 'Content-Type'
|
2071
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
2072
|
+
if !content_type.nil?
|
2073
|
+
header_params['Content-Type'] = content_type
|
2074
|
+
end
|
968
2075
|
|
969
2076
|
# form parameters
|
970
2077
|
form_params = opts[:form_params] || {}
|
971
2078
|
|
972
2079
|
# http body (model)
|
973
|
-
post_body = opts[:debug_body]
|
2080
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body)
|
974
2081
|
|
975
2082
|
# return_type
|
976
|
-
return_type = opts[:debug_return_type] || '
|
2083
|
+
return_type = opts[:debug_return_type] || 'InlineResponse200'
|
977
2084
|
|
978
2085
|
# auth_names
|
979
2086
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
980
2087
|
|
981
2088
|
new_options = opts.merge(
|
982
|
-
:operation => :"DefaultApi.
|
2089
|
+
:operation => :"DefaultApi.identify_user_by_alias",
|
983
2090
|
:header_params => header_params,
|
984
2091
|
:query_params => query_params,
|
985
2092
|
:form_params => form_params,
|
@@ -988,71 +2095,76 @@ module OneSignal
|
|
988
2095
|
:return_type => return_type
|
989
2096
|
)
|
990
2097
|
|
991
|
-
data, status_code, headers = @api_client.call_api(:
|
2098
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
992
2099
|
if @api_client.config.debugging
|
993
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
2100
|
+
@api_client.config.logger.debug "API called: DefaultApi#identify_user_by_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
994
2101
|
end
|
995
2102
|
return data, status_code, headers
|
996
2103
|
end
|
997
2104
|
|
998
|
-
#
|
999
|
-
#
|
1000
|
-
# @param
|
1001
|
-
# @param
|
2105
|
+
# Upserts one or more Aliases for the User identified by :subscription_id.
|
2106
|
+
# @param app_id [String]
|
2107
|
+
# @param subscription_id [String]
|
2108
|
+
# @param user_identity_request_body [UserIdentityRequestBody]
|
1002
2109
|
# @param [Hash] opts the optional parameters
|
1003
|
-
# @
|
1004
|
-
|
1005
|
-
|
1006
|
-
data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts)
|
2110
|
+
# @return [UserIdentityResponse]
|
2111
|
+
def identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body, opts = {})
|
2112
|
+
data, _status_code, _headers = identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts)
|
1007
2113
|
data
|
1008
2114
|
end
|
1009
2115
|
|
1010
|
-
#
|
1011
|
-
#
|
1012
|
-
# @param
|
1013
|
-
# @param
|
2116
|
+
# Upserts one or more Aliases for the User identified by :subscription_id.
|
2117
|
+
# @param app_id [String]
|
2118
|
+
# @param subscription_id [String]
|
2119
|
+
# @param user_identity_request_body [UserIdentityRequestBody]
|
1014
2120
|
# @param [Hash] opts the optional parameters
|
1015
|
-
# @
|
1016
|
-
|
1017
|
-
def get_player_with_http_info(app_id, player_id, opts = {})
|
2121
|
+
# @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
|
2122
|
+
def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts = {})
|
1018
2123
|
if @api_client.config.debugging
|
1019
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
2124
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...'
|
1020
2125
|
end
|
1021
2126
|
# verify the required parameter 'app_id' is set
|
1022
2127
|
if @api_client.config.client_side_validation && app_id.nil?
|
1023
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
2128
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_subscription_id"
|
1024
2129
|
end
|
1025
|
-
# verify the required parameter '
|
1026
|
-
if @api_client.config.client_side_validation &&
|
1027
|
-
fail ArgumentError, "Missing the required parameter '
|
2130
|
+
# verify the required parameter 'subscription_id' is set
|
2131
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
2132
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.identify_user_by_subscription_id"
|
2133
|
+
end
|
2134
|
+
# verify the required parameter 'user_identity_request_body' is set
|
2135
|
+
if @api_client.config.client_side_validation && user_identity_request_body.nil?
|
2136
|
+
fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_subscription_id"
|
1028
2137
|
end
|
1029
2138
|
# resource path
|
1030
|
-
local_var_path = '/
|
2139
|
+
local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
1031
2140
|
|
1032
2141
|
# query parameters
|
1033
2142
|
query_params = opts[:query_params] || {}
|
1034
|
-
query_params[:'app_id'] = app_id
|
1035
|
-
query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil?
|
1036
2143
|
|
1037
2144
|
# header parameters
|
1038
2145
|
header_params = opts[:header_params] || {}
|
1039
2146
|
# HTTP header 'Accept' (if needed)
|
1040
2147
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2148
|
+
# HTTP header 'Content-Type'
|
2149
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
2150
|
+
if !content_type.nil?
|
2151
|
+
header_params['Content-Type'] = content_type
|
2152
|
+
end
|
1041
2153
|
|
1042
2154
|
# form parameters
|
1043
2155
|
form_params = opts[:form_params] || {}
|
1044
2156
|
|
1045
2157
|
# http body (model)
|
1046
|
-
post_body = opts[:debug_body]
|
2158
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body)
|
1047
2159
|
|
1048
2160
|
# return_type
|
1049
|
-
return_type = opts[:debug_return_type] || '
|
2161
|
+
return_type = opts[:debug_return_type] || 'UserIdentityResponse'
|
1050
2162
|
|
1051
2163
|
# auth_names
|
1052
2164
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
1053
2165
|
|
1054
2166
|
new_options = opts.merge(
|
1055
|
-
:operation => :"DefaultApi.
|
2167
|
+
:operation => :"DefaultApi.identify_user_by_subscription_id",
|
1056
2168
|
:header_params => header_params,
|
1057
2169
|
:query_params => query_params,
|
1058
2170
|
:form_params => form_params,
|
@@ -1061,68 +2173,76 @@ module OneSignal
|
|
1061
2173
|
:return_type => return_type
|
1062
2174
|
)
|
1063
2175
|
|
1064
|
-
data, status_code, headers = @api_client.call_api(:
|
2176
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1065
2177
|
if @api_client.config.debugging
|
1066
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
2178
|
+
@api_client.config.logger.debug "API called: DefaultApi#identify_user_by_subscription_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1067
2179
|
end
|
1068
2180
|
return data, status_code, headers
|
1069
2181
|
end
|
1070
2182
|
|
1071
|
-
#
|
1072
|
-
#
|
1073
|
-
# @param
|
2183
|
+
# Transfers this Subscription to the User identified by the identity in the payload.
|
2184
|
+
# @param app_id [String]
|
2185
|
+
# @param subscription_id [String]
|
2186
|
+
# @param transfer_subscription_request_body [TransferSubscriptionRequestBody]
|
1074
2187
|
# @param [Hash] opts the optional parameters
|
1075
|
-
# @
|
1076
|
-
|
1077
|
-
|
1078
|
-
def get_players(app_id, opts = {})
|
1079
|
-
data, _status_code, _headers = get_players_with_http_info(app_id, opts)
|
2188
|
+
# @return [UserIdentityResponse]
|
2189
|
+
def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {})
|
2190
|
+
data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts)
|
1080
2191
|
data
|
1081
2192
|
end
|
1082
2193
|
|
1083
|
-
#
|
1084
|
-
#
|
1085
|
-
# @param
|
2194
|
+
# Transfers this Subscription to the User identified by the identity in the payload.
|
2195
|
+
# @param app_id [String]
|
2196
|
+
# @param subscription_id [String]
|
2197
|
+
# @param transfer_subscription_request_body [TransferSubscriptionRequestBody]
|
1086
2198
|
# @param [Hash] opts the optional parameters
|
1087
|
-
# @
|
1088
|
-
|
1089
|
-
# @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers
|
1090
|
-
def get_players_with_http_info(app_id, opts = {})
|
2199
|
+
# @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
|
2200
|
+
def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {})
|
1091
2201
|
if @api_client.config.debugging
|
1092
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.
|
2202
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...'
|
1093
2203
|
end
|
1094
2204
|
# verify the required parameter 'app_id' is set
|
1095
2205
|
if @api_client.config.client_side_validation && app_id.nil?
|
1096
|
-
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.
|
2206
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription"
|
2207
|
+
end
|
2208
|
+
# verify the required parameter 'subscription_id' is set
|
2209
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
2210
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription"
|
2211
|
+
end
|
2212
|
+
# verify the required parameter 'transfer_subscription_request_body' is set
|
2213
|
+
if @api_client.config.client_side_validation && transfer_subscription_request_body.nil?
|
2214
|
+
fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription"
|
1097
2215
|
end
|
1098
2216
|
# resource path
|
1099
|
-
local_var_path = '/
|
2217
|
+
local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/owner'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
1100
2218
|
|
1101
2219
|
# query parameters
|
1102
2220
|
query_params = opts[:query_params] || {}
|
1103
|
-
query_params[:'app_id'] = app_id
|
1104
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
1105
|
-
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
1106
2221
|
|
1107
2222
|
# header parameters
|
1108
2223
|
header_params = opts[:header_params] || {}
|
1109
2224
|
# HTTP header 'Accept' (if needed)
|
1110
2225
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2226
|
+
# HTTP header 'Content-Type'
|
2227
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
2228
|
+
if !content_type.nil?
|
2229
|
+
header_params['Content-Type'] = content_type
|
2230
|
+
end
|
1111
2231
|
|
1112
2232
|
# form parameters
|
1113
2233
|
form_params = opts[:form_params] || {}
|
1114
2234
|
|
1115
2235
|
# http body (model)
|
1116
|
-
post_body = opts[:debug_body]
|
2236
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body)
|
1117
2237
|
|
1118
2238
|
# return_type
|
1119
|
-
return_type = opts[:debug_return_type] || '
|
2239
|
+
return_type = opts[:debug_return_type] || 'UserIdentityResponse'
|
1120
2240
|
|
1121
2241
|
# auth_names
|
1122
2242
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
1123
2243
|
|
1124
2244
|
new_options = opts.merge(
|
1125
|
-
:operation => :"DefaultApi.
|
2245
|
+
:operation => :"DefaultApi.transfer_subscription",
|
1126
2246
|
:header_params => header_params,
|
1127
2247
|
:query_params => query_params,
|
1128
2248
|
:form_params => form_params,
|
@@ -1131,9 +2251,9 @@ module OneSignal
|
|
1131
2251
|
:return_type => return_type
|
1132
2252
|
)
|
1133
2253
|
|
1134
|
-
data, status_code, headers = @api_client.call_api(:
|
2254
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1135
2255
|
if @api_client.config.debugging
|
1136
|
-
@api_client.config.logger.debug "API called: DefaultApi#
|
2256
|
+
@api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1137
2257
|
end
|
1138
2258
|
return data, status_code, headers
|
1139
2259
|
end
|
@@ -1212,12 +2332,92 @@ module OneSignal
|
|
1212
2332
|
return data, status_code, headers
|
1213
2333
|
end
|
1214
2334
|
|
2335
|
+
# Update a Live Activity via Push
|
2336
|
+
# Updates a specified live activity.
|
2337
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
2338
|
+
# @param activity_id [String] Live Activity record ID
|
2339
|
+
# @param update_live_activity_request [UpdateLiveActivityRequest]
|
2340
|
+
# @param [Hash] opts the optional parameters
|
2341
|
+
# @return [UpdateLiveActivitySuccessResponse]
|
2342
|
+
def update_live_activity(app_id, activity_id, update_live_activity_request, opts = {})
|
2343
|
+
data, _status_code, _headers = update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts)
|
2344
|
+
data
|
2345
|
+
end
|
2346
|
+
|
2347
|
+
# Update a Live Activity via Push
|
2348
|
+
# Updates a specified live activity.
|
2349
|
+
# @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
|
2350
|
+
# @param activity_id [String] Live Activity record ID
|
2351
|
+
# @param update_live_activity_request [UpdateLiveActivityRequest]
|
2352
|
+
# @param [Hash] opts the optional parameters
|
2353
|
+
# @return [Array<(UpdateLiveActivitySuccessResponse, Integer, Hash)>] UpdateLiveActivitySuccessResponse data, response status code and response headers
|
2354
|
+
def update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts = {})
|
2355
|
+
if @api_client.config.debugging
|
2356
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.update_live_activity ...'
|
2357
|
+
end
|
2358
|
+
# verify the required parameter 'app_id' is set
|
2359
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
2360
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_live_activity"
|
2361
|
+
end
|
2362
|
+
# verify the required parameter 'activity_id' is set
|
2363
|
+
if @api_client.config.client_side_validation && activity_id.nil?
|
2364
|
+
fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.update_live_activity"
|
2365
|
+
end
|
2366
|
+
# verify the required parameter 'update_live_activity_request' is set
|
2367
|
+
if @api_client.config.client_side_validation && update_live_activity_request.nil?
|
2368
|
+
fail ArgumentError, "Missing the required parameter 'update_live_activity_request' when calling DefaultApi.update_live_activity"
|
2369
|
+
end
|
2370
|
+
# resource path
|
2371
|
+
local_var_path = '/apps/{app_id}/live_activities/{activity_id}/notifications'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s))
|
2372
|
+
|
2373
|
+
# query parameters
|
2374
|
+
query_params = opts[:query_params] || {}
|
2375
|
+
|
2376
|
+
# header parameters
|
2377
|
+
header_params = opts[:header_params] || {}
|
2378
|
+
# HTTP header 'Accept' (if needed)
|
2379
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2380
|
+
# HTTP header 'Content-Type'
|
2381
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
2382
|
+
if !content_type.nil?
|
2383
|
+
header_params['Content-Type'] = content_type
|
2384
|
+
end
|
2385
|
+
|
2386
|
+
# form parameters
|
2387
|
+
form_params = opts[:form_params] || {}
|
2388
|
+
|
2389
|
+
# http body (model)
|
2390
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_live_activity_request)
|
2391
|
+
|
2392
|
+
# return_type
|
2393
|
+
return_type = opts[:debug_return_type] || 'UpdateLiveActivitySuccessResponse'
|
2394
|
+
|
2395
|
+
# auth_names
|
2396
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
2397
|
+
|
2398
|
+
new_options = opts.merge(
|
2399
|
+
:operation => :"DefaultApi.update_live_activity",
|
2400
|
+
:header_params => header_params,
|
2401
|
+
:query_params => query_params,
|
2402
|
+
:form_params => form_params,
|
2403
|
+
:body => post_body,
|
2404
|
+
:auth_names => auth_names,
|
2405
|
+
:return_type => return_type
|
2406
|
+
)
|
2407
|
+
|
2408
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
2409
|
+
if @api_client.config.debugging
|
2410
|
+
@api_client.config.logger.debug "API called: DefaultApi#update_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2411
|
+
end
|
2412
|
+
return data, status_code, headers
|
2413
|
+
end
|
2414
|
+
|
1215
2415
|
# Edit device
|
1216
2416
|
# Update an existing device in one of your OneSignal apps
|
1217
2417
|
# @param player_id [String] Player's OneSignal ID
|
1218
2418
|
# @param player [Player]
|
1219
2419
|
# @param [Hash] opts the optional parameters
|
1220
|
-
# @return [
|
2420
|
+
# @return [UpdatePlayerSuccessResponse]
|
1221
2421
|
def update_player(player_id, player, opts = {})
|
1222
2422
|
data, _status_code, _headers = update_player_with_http_info(player_id, player, opts)
|
1223
2423
|
data
|
@@ -1228,7 +2428,7 @@ module OneSignal
|
|
1228
2428
|
# @param player_id [String] Player's OneSignal ID
|
1229
2429
|
# @param player [Player]
|
1230
2430
|
# @param [Hash] opts the optional parameters
|
1231
|
-
# @return [Array<(
|
2431
|
+
# @return [Array<(UpdatePlayerSuccessResponse, Integer, Hash)>] UpdatePlayerSuccessResponse data, response status code and response headers
|
1232
2432
|
def update_player_with_http_info(player_id, player, opts = {})
|
1233
2433
|
if @api_client.config.debugging
|
1234
2434
|
@api_client.config.logger.debug 'Calling API: DefaultApi.update_player ...'
|
@@ -1264,7 +2464,7 @@ module OneSignal
|
|
1264
2464
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(player)
|
1265
2465
|
|
1266
2466
|
# return_type
|
1267
|
-
return_type = opts[:debug_return_type] || '
|
2467
|
+
return_type = opts[:debug_return_type] || 'UpdatePlayerSuccessResponse'
|
1268
2468
|
|
1269
2469
|
# auth_names
|
1270
2470
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -1292,7 +2492,7 @@ module OneSignal
|
|
1292
2492
|
# @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
|
1293
2493
|
# @param [Hash] opts the optional parameters
|
1294
2494
|
# @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body
|
1295
|
-
# @return [
|
2495
|
+
# @return [UpdatePlayerTagsSuccessResponse]
|
1296
2496
|
def update_player_tags(app_id, external_user_id, opts = {})
|
1297
2497
|
data, _status_code, _headers = update_player_tags_with_http_info(app_id, external_user_id, opts)
|
1298
2498
|
data
|
@@ -1304,7 +2504,7 @@ module OneSignal
|
|
1304
2504
|
# @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
|
1305
2505
|
# @param [Hash] opts the optional parameters
|
1306
2506
|
# @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body
|
1307
|
-
# @return [Array<(
|
2507
|
+
# @return [Array<(UpdatePlayerTagsSuccessResponse, Integer, Hash)>] UpdatePlayerTagsSuccessResponse data, response status code and response headers
|
1308
2508
|
def update_player_tags_with_http_info(app_id, external_user_id, opts = {})
|
1309
2509
|
if @api_client.config.debugging
|
1310
2510
|
@api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...'
|
@@ -1340,7 +2540,7 @@ module OneSignal
|
|
1340
2540
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_player_tags_request_body'])
|
1341
2541
|
|
1342
2542
|
# return_type
|
1343
|
-
return_type = opts[:debug_return_type] || '
|
2543
|
+
return_type = opts[:debug_return_type] || 'UpdatePlayerTagsSuccessResponse'
|
1344
2544
|
|
1345
2545
|
# auth_names
|
1346
2546
|
auth_names = opts[:debug_auth_names] || ['app_key']
|
@@ -1361,5 +2561,167 @@ module OneSignal
|
|
1361
2561
|
end
|
1362
2562
|
return data, status_code, headers
|
1363
2563
|
end
|
2564
|
+
|
2565
|
+
# Updates an existing Subscription’s properties.
|
2566
|
+
# @param app_id [String]
|
2567
|
+
# @param subscription_id [String]
|
2568
|
+
# @param update_subscription_request_body [UpdateSubscriptionRequestBody]
|
2569
|
+
# @param [Hash] opts the optional parameters
|
2570
|
+
# @return [nil]
|
2571
|
+
def update_subscription(app_id, subscription_id, update_subscription_request_body, opts = {})
|
2572
|
+
update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts)
|
2573
|
+
nil
|
2574
|
+
end
|
2575
|
+
|
2576
|
+
# Updates an existing Subscription’s properties.
|
2577
|
+
# @param app_id [String]
|
2578
|
+
# @param subscription_id [String]
|
2579
|
+
# @param update_subscription_request_body [UpdateSubscriptionRequestBody]
|
2580
|
+
# @param [Hash] opts the optional parameters
|
2581
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
2582
|
+
def update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts = {})
|
2583
|
+
if @api_client.config.debugging
|
2584
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...'
|
2585
|
+
end
|
2586
|
+
# verify the required parameter 'app_id' is set
|
2587
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
2588
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_subscription"
|
2589
|
+
end
|
2590
|
+
# verify the required parameter 'subscription_id' is set
|
2591
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
2592
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.update_subscription"
|
2593
|
+
end
|
2594
|
+
# verify the required parameter 'update_subscription_request_body' is set
|
2595
|
+
if @api_client.config.client_side_validation && update_subscription_request_body.nil?
|
2596
|
+
fail ArgumentError, "Missing the required parameter 'update_subscription_request_body' when calling DefaultApi.update_subscription"
|
2597
|
+
end
|
2598
|
+
# resource path
|
2599
|
+
local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s))
|
2600
|
+
|
2601
|
+
# query parameters
|
2602
|
+
query_params = opts[:query_params] || {}
|
2603
|
+
|
2604
|
+
# header parameters
|
2605
|
+
header_params = opts[:header_params] || {}
|
2606
|
+
# HTTP header 'Accept' (if needed)
|
2607
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2608
|
+
# HTTP header 'Content-Type'
|
2609
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
2610
|
+
if !content_type.nil?
|
2611
|
+
header_params['Content-Type'] = content_type
|
2612
|
+
end
|
2613
|
+
|
2614
|
+
# form parameters
|
2615
|
+
form_params = opts[:form_params] || {}
|
2616
|
+
|
2617
|
+
# http body (model)
|
2618
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_subscription_request_body)
|
2619
|
+
|
2620
|
+
# return_type
|
2621
|
+
return_type = opts[:debug_return_type]
|
2622
|
+
|
2623
|
+
# auth_names
|
2624
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
2625
|
+
|
2626
|
+
new_options = opts.merge(
|
2627
|
+
:operation => :"DefaultApi.update_subscription",
|
2628
|
+
:header_params => header_params,
|
2629
|
+
:query_params => query_params,
|
2630
|
+
:form_params => form_params,
|
2631
|
+
:body => post_body,
|
2632
|
+
:auth_names => auth_names,
|
2633
|
+
:return_type => return_type
|
2634
|
+
)
|
2635
|
+
|
2636
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
2637
|
+
if @api_client.config.debugging
|
2638
|
+
@api_client.config.logger.debug "API called: DefaultApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2639
|
+
end
|
2640
|
+
return data, status_code, headers
|
2641
|
+
end
|
2642
|
+
|
2643
|
+
# Updates an existing User’s properties.
|
2644
|
+
# @param app_id [String]
|
2645
|
+
# @param alias_label [String]
|
2646
|
+
# @param alias_id [String]
|
2647
|
+
# @param update_user_request [UpdateUserRequest]
|
2648
|
+
# @param [Hash] opts the optional parameters
|
2649
|
+
# @return [InlineResponse202]
|
2650
|
+
def update_user(app_id, alias_label, alias_id, update_user_request, opts = {})
|
2651
|
+
data, _status_code, _headers = update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts)
|
2652
|
+
data
|
2653
|
+
end
|
2654
|
+
|
2655
|
+
# Updates an existing User’s properties.
|
2656
|
+
# @param app_id [String]
|
2657
|
+
# @param alias_label [String]
|
2658
|
+
# @param alias_id [String]
|
2659
|
+
# @param update_user_request [UpdateUserRequest]
|
2660
|
+
# @param [Hash] opts the optional parameters
|
2661
|
+
# @return [Array<(InlineResponse202, Integer, Hash)>] InlineResponse202 data, response status code and response headers
|
2662
|
+
def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {})
|
2663
|
+
if @api_client.config.debugging
|
2664
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.update_user ...'
|
2665
|
+
end
|
2666
|
+
# verify the required parameter 'app_id' is set
|
2667
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
2668
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_user"
|
2669
|
+
end
|
2670
|
+
# verify the required parameter 'alias_label' is set
|
2671
|
+
if @api_client.config.client_side_validation && alias_label.nil?
|
2672
|
+
fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.update_user"
|
2673
|
+
end
|
2674
|
+
# verify the required parameter 'alias_id' is set
|
2675
|
+
if @api_client.config.client_side_validation && alias_id.nil?
|
2676
|
+
fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.update_user"
|
2677
|
+
end
|
2678
|
+
# verify the required parameter 'update_user_request' is set
|
2679
|
+
if @api_client.config.client_side_validation && update_user_request.nil?
|
2680
|
+
fail ArgumentError, "Missing the required parameter 'update_user_request' when calling DefaultApi.update_user"
|
2681
|
+
end
|
2682
|
+
# resource path
|
2683
|
+
local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s))
|
2684
|
+
|
2685
|
+
# query parameters
|
2686
|
+
query_params = opts[:query_params] || {}
|
2687
|
+
|
2688
|
+
# header parameters
|
2689
|
+
header_params = opts[:header_params] || {}
|
2690
|
+
# HTTP header 'Accept' (if needed)
|
2691
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2692
|
+
# HTTP header 'Content-Type'
|
2693
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
2694
|
+
if !content_type.nil?
|
2695
|
+
header_params['Content-Type'] = content_type
|
2696
|
+
end
|
2697
|
+
|
2698
|
+
# form parameters
|
2699
|
+
form_params = opts[:form_params] || {}
|
2700
|
+
|
2701
|
+
# http body (model)
|
2702
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request)
|
2703
|
+
|
2704
|
+
# return_type
|
2705
|
+
return_type = opts[:debug_return_type] || 'InlineResponse202'
|
2706
|
+
|
2707
|
+
# auth_names
|
2708
|
+
auth_names = opts[:debug_auth_names] || ['app_key']
|
2709
|
+
|
2710
|
+
new_options = opts.merge(
|
2711
|
+
:operation => :"DefaultApi.update_user",
|
2712
|
+
:header_params => header_params,
|
2713
|
+
:query_params => query_params,
|
2714
|
+
:form_params => form_params,
|
2715
|
+
:body => post_body,
|
2716
|
+
:auth_names => auth_names,
|
2717
|
+
:return_type => return_type
|
2718
|
+
)
|
2719
|
+
|
2720
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
2721
|
+
if @api_client.config.debugging
|
2722
|
+
@api_client.config.logger.debug "API called: DefaultApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2723
|
+
end
|
2724
|
+
return data, status_code, headers
|
2725
|
+
end
|
1364
2726
|
end
|
1365
2727
|
end
|