onesignal_sdk 2.0.2

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