onesignal 2.2.1 → 5.1.0.pre.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +42 -67
- data/docs/BasicNotification.md +18 -18
- data/docs/BasicNotificationAllOf.md +9 -7
- data/docs/CreateNotificationSuccessResponse.md +1 -3
- data/docs/DefaultApi.md +364 -948
- data/docs/{ExportPlayersRequestBody.md → ExportSubscriptionsRequestBody.md} +2 -2
- data/docs/{ExportPlayersSuccessResponse.md → ExportSubscriptionsSuccessResponse.md} +2 -2
- data/docs/Filter.md +10 -2
- data/docs/{Notification200Errors.md → FilterExpression.md} +9 -9
- data/docs/GenericError.md +6 -2
- data/docs/{DeletePlayerSuccessResponse.md → GenericSuccessBoolResponse.md} +2 -2
- data/docs/{GetNotificationRequestBody.md → GetNotificationHistoryRequestBody.md} +2 -2
- data/docs/GetSegmentsSuccessResponse.md +24 -0
- data/docs/{StringMap.md → LanguageStringMap.md} +2 -2
- data/docs/Notification.md +18 -18
- data/docs/NotificationTarget.md +9 -11
- data/docs/NotificationWithMeta.md +18 -18
- data/docs/{InlineResponse202.md → PropertiesBody.md} +2 -2
- data/docs/PropertiesDeltas.md +2 -2
- data/docs/PropertiesObject.md +2 -2
- data/docs/Purchase.md +1 -1
- data/docs/RateLimitError.md +20 -0
- data/docs/Segment.md +1 -1
- data/docs/SegmentData.md +30 -0
- data/docs/{SubscriptionObject.md → Subscription.md} +6 -6
- data/docs/SubscriptionBody.md +18 -0
- data/docs/SubscriptionNotificationTarget.md +38 -0
- data/docs/TransferSubscriptionRequestBody.md +1 -1
- data/docs/UpdateLiveActivityRequest.md +14 -4
- data/docs/UpdateLiveActivitySuccessResponse.md +2 -4
- data/docs/User.md +3 -5
- data/docs/{InlineResponse200.md → UserIdentityBody.md} +3 -3
- data/docs/WebButton.md +24 -0
- data/lib/onesignal/api/default_api.rb +382 -890
- data/lib/onesignal/api_client.rb +2 -2
- data/lib/onesignal/api_error.rb +1 -1
- data/lib/onesignal/configuration.rb +5 -5
- data/lib/onesignal/models/app.rb +1 -1
- data/lib/onesignal/models/basic_notification.rb +49 -47
- data/lib/onesignal/models/basic_notification_all_of.rb +29 -17
- data/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +1 -1
- data/lib/onesignal/models/button.rb +1 -1
- data/lib/onesignal/models/create_notification_success_response.rb +5 -13
- data/lib/onesignal/models/create_segment_conflict_response.rb +1 -1
- data/lib/onesignal/models/create_segment_success_response.rb +1 -1
- data/lib/onesignal/models/create_user_conflict_response.rb +1 -1
- data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +1 -1
- data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +1 -1
- data/lib/onesignal/models/delivery_data.rb +1 -1
- data/lib/onesignal/models/export_events_success_response.rb +1 -1
- data/lib/onesignal/models/{export_players_request_body.rb → export_subscriptions_request_body.rb} +4 -4
- data/lib/onesignal/models/{export_players_success_response.rb → export_subscriptions_success_response.rb} +4 -4
- data/lib/onesignal/models/filter.rb +44 -14
- data/lib/onesignal/models/{notification200_errors.rb → filter_expression.rb} +4 -4
- data/lib/onesignal/models/generic_error.rb +26 -8
- data/lib/onesignal/models/{update_player_success_response.rb → generic_success_bool_response.rb} +4 -4
- data/lib/onesignal/models/{get_notification_request_body.rb → get_notification_history_request_body.rb} +4 -4
- data/lib/onesignal/models/{player_slice.rb → get_segments_success_response.rb} +16 -12
- data/lib/onesignal/models/{string_map.rb → language_string_map.rb} +4 -4
- data/lib/onesignal/models/notification.rb +49 -47
- data/lib/onesignal/models/notification_all_of.rb +1 -1
- data/lib/onesignal/models/notification_history_success_response.rb +1 -1
- data/lib/onesignal/models/notification_slice.rb +1 -1
- data/lib/onesignal/models/notification_target.rb +24 -34
- data/lib/onesignal/models/notification_with_meta.rb +49 -47
- data/lib/onesignal/models/notification_with_meta_all_of.rb +1 -1
- data/lib/onesignal/models/operator.rb +1 -1
- data/lib/onesignal/models/outcome_data.rb +1 -1
- data/lib/onesignal/models/outcomes_data.rb +1 -1
- data/lib/onesignal/models/platform_delivery_data.rb +1 -1
- data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +1 -1
- data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +1 -1
- data/lib/onesignal/models/{inline_response202.rb → properties_body.rb} +4 -4
- data/lib/onesignal/models/properties_deltas.rb +3 -3
- data/lib/onesignal/models/properties_object.rb +3 -3
- data/lib/onesignal/models/purchase.rb +2 -2
- data/lib/onesignal/models/{rate_limiter_error.rb → rate_limit_error.rb} +17 -8
- data/lib/onesignal/models/segment.rb +2 -2
- data/lib/onesignal/models/{begin_live_activity_request.rb → segment_data.rb} +69 -27
- data/lib/onesignal/models/segment_notification_target.rb +1 -1
- data/lib/onesignal/models/{subscription_object.rb → subscription.rb} +8 -8
- data/lib/onesignal/models/{inline_response201.rb → subscription_body.rb} +5 -5
- data/lib/onesignal/models/{player_notification_target.rb → subscription_notification_target.rb} +25 -35
- data/lib/onesignal/models/transfer_subscription_request_body.rb +26 -2
- data/lib/onesignal/models/update_live_activity_request.rb +59 -22
- data/lib/onesignal/models/update_live_activity_success_response.rb +8 -17
- data/lib/onesignal/models/update_user_request.rb +1 -1
- data/lib/onesignal/models/user.rb +6 -15
- data/lib/onesignal/models/{inline_response200.rb → user_identity_body.rb} +5 -5
- data/lib/onesignal/models/{create_player_success_response.rb → web_button.rb} +40 -17
- data/lib/onesignal/version.rb +2 -2
- data/lib/onesignal.rb +16 -34
- data/onesignal.gemspec +1 -1
- data/spec/api/default_api_spec.rb +82 -174
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/app_spec.rb +1 -1
- data/spec/models/basic_notification_all_of_android_background_layout_spec.rb +1 -1
- data/spec/models/basic_notification_all_of_spec.rb +13 -7
- data/spec/models/basic_notification_spec.rb +14 -14
- data/spec/models/button_spec.rb +1 -1
- data/spec/models/create_notification_success_response_spec.rb +1 -7
- data/spec/models/create_segment_conflict_response_spec.rb +1 -1
- data/spec/models/create_segment_success_response_spec.rb +1 -1
- data/spec/models/create_user_conflict_response_errors_inner_spec.rb +1 -1
- data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +1 -1
- data/spec/models/create_user_conflict_response_spec.rb +1 -1
- data/spec/models/delivery_data_spec.rb +1 -1
- data/spec/models/export_events_success_response_spec.rb +1 -1
- data/spec/models/{export_players_request_body_spec.rb → export_subscriptions_request_body_spec.rb} +7 -7
- data/spec/models/{export_players_success_response_spec.rb → export_subscriptions_success_response_spec.rb} +7 -7
- data/spec/models/{notification200_errors_spec.rb → filter_expression_spec.rb} +3 -3
- data/spec/models/filter_spec.rb +25 -1
- data/spec/models/generic_error_spec.rb +13 -1
- data/spec/models/{delete_player_success_response_spec.rb → generic_success_bool_response_spec.rb} +7 -7
- data/spec/models/{get_notification_request_body_spec.rb → get_notification_history_request_body_spec.rb} +7 -7
- data/spec/models/{player_slice_spec.rb → get_segments_success_response_spec.rb} +8 -8
- data/spec/models/{string_map_spec.rb → language_string_map_spec.rb} +7 -7
- data/spec/models/notification_all_of_spec.rb +1 -1
- data/spec/models/notification_history_success_response_spec.rb +1 -1
- data/spec/models/notification_slice_spec.rb +1 -1
- data/spec/models/notification_spec.rb +14 -14
- data/spec/models/notification_target_spec.rb +2 -8
- data/spec/models/notification_with_meta_all_of_spec.rb +1 -1
- data/spec/models/notification_with_meta_spec.rb +14 -14
- data/spec/models/operator_spec.rb +1 -1
- data/spec/models/outcome_data_spec.rb +1 -1
- data/spec/models/outcomes_data_spec.rb +1 -1
- data/spec/models/platform_delivery_data_email_all_of_spec.rb +1 -1
- data/spec/models/platform_delivery_data_sms_all_of_spec.rb +1 -1
- data/spec/models/platform_delivery_data_spec.rb +1 -1
- data/spec/models/{inline_response202_spec.rb → properties_body_spec.rb} +7 -7
- data/spec/models/properties_deltas_spec.rb +1 -1
- data/spec/models/properties_object_spec.rb +1 -1
- data/spec/models/purchase_spec.rb +1 -1
- data/spec/models/{generic_error_errors_inner_spec.rb → rate_limit_error_spec.rb} +9 -9
- data/spec/models/{filter_expressions_spec.rb → segment_data_spec.rb} +24 -20
- data/spec/models/segment_notification_target_spec.rb +1 -1
- data/spec/models/segment_spec.rb +1 -1
- data/spec/models/{inline_response201_spec.rb → subscription_body_spec.rb} +7 -7
- data/spec/models/{player_notification_target_spec.rb → subscription_notification_target_spec.rb} +8 -14
- data/spec/models/{subscription_object_spec.rb → subscription_spec.rb} +7 -7
- data/spec/models/transfer_subscription_request_body_spec.rb +1 -1
- data/spec/models/update_live_activity_request_spec.rb +32 -6
- data/spec/models/update_live_activity_success_response_spec.rb +2 -8
- data/spec/models/update_user_request_spec.rb +1 -1
- data/spec/models/{user_identity_response_spec.rb → user_identity_body_spec.rb} +7 -7
- data/spec/models/user_spec.rb +1 -7
- data/spec/models/{create_player_success_response_spec.rb → web_button_spec.rb} +21 -9
- data/spec/spec_helper.rb +1 -1
- metadata +61 -131
- data/docs/BeginLiveActivityRequest.md +0 -20
- data/docs/CancelNotificationSuccessResponse.md +0 -18
- data/docs/CreatePlayerSuccessResponse.md +0 -20
- data/docs/CreateSubscriptionRequestBody.md +0 -20
- data/docs/DeletePlayerNotFoundResponse.md +0 -18
- data/docs/DeleteSegmentNotFoundResponse.md +0 -18
- data/docs/DeleteSegmentSuccessResponse.md +0 -18
- data/docs/FilterExpressions.md +0 -26
- data/docs/InlineResponse2003.md +0 -18
- data/docs/InlineResponse201.md +0 -18
- data/docs/InvalidIdentifierError.md +0 -20
- data/docs/Player.md +0 -70
- data/docs/PlayerNotificationTarget.md +0 -40
- data/docs/PlayerNotificationTargetIncludeAliases.md +0 -18
- data/docs/PlayerSlice.md +0 -24
- data/docs/UpdatePlayerSuccessResponse.md +0 -18
- data/docs/UpdatePlayerTagsRequestBody.md +0 -18
- data/docs/UpdatePlayerTagsSuccessResponse.md +0 -18
- data/docs/UpdateSubscriptionRequestBody.md +0 -18
- data/docs/UserIdentityRequestBody.md +0 -18
- data/docs/UserIdentityResponse.md +0 -18
- data/docs/UserSubscriptionOptions.md +0 -18
- data/lib/onesignal/models/cancel_notification_success_response.rb +0 -219
- data/lib/onesignal/models/create_subscription_request_body.rb +0 -228
- data/lib/onesignal/models/delete_player_not_found_response.rb +0 -219
- data/lib/onesignal/models/delete_player_success_response.rb +0 -219
- data/lib/onesignal/models/delete_segment_not_found_response.rb +0 -219
- data/lib/onesignal/models/delete_segment_success_response.rb +0 -219
- data/lib/onesignal/models/filter_expressions.rb +0 -336
- data/lib/onesignal/models/generic_error_errors_inner.rb +0 -228
- data/lib/onesignal/models/inline_response2003.rb +0 -221
- data/lib/onesignal/models/invalid_identifier_error.rb +0 -234
- data/lib/onesignal/models/player.rb +0 -494
- data/lib/onesignal/models/player_notification_target_include_aliases.rb +0 -221
- data/lib/onesignal/models/update_player_tags_request_body.rb +0 -220
- data/lib/onesignal/models/update_player_tags_success_response.rb +0 -219
- data/lib/onesignal/models/update_subscription_request_body.rb +0 -219
- data/lib/onesignal/models/user_identity_request_body.rb +0 -221
- data/lib/onesignal/models/user_identity_response.rb +0 -221
- data/lib/onesignal/models/user_subscription_options.rb +0 -219
- data/spec/models/begin_live_activity_request_spec.rb +0 -40
- data/spec/models/cancel_notification_success_response_spec.rb +0 -34
- data/spec/models/create_subscription_request_body_spec.rb +0 -40
- data/spec/models/delete_player_not_found_response_spec.rb +0 -34
- data/spec/models/delete_segment_not_found_response_spec.rb +0 -34
- data/spec/models/delete_segment_success_response_spec.rb +0 -34
- data/spec/models/inline_response2003_spec.rb +0 -34
- data/spec/models/inline_response200_spec.rb +0 -34
- data/spec/models/invalid_identifier_error_spec.rb +0 -40
- data/spec/models/player_notification_target_include_aliases_spec.rb +0 -34
- data/spec/models/player_spec.rb +0 -190
- data/spec/models/rate_limiter_error_spec.rb +0 -34
- data/spec/models/update_player_success_response_spec.rb +0 -34
- data/spec/models/update_player_tags_request_body_spec.rb +0 -34
- data/spec/models/update_player_tags_success_response_spec.rb +0 -34
- data/spec/models/update_subscription_request_body_spec.rb +0 -34
- data/spec/models/user_identity_request_body_spec.rb +0 -34
- data/spec/models/user_subscription_options_spec.rb +0 -34
data/docs/DefaultApi.md
CHANGED
@@ -4,52 +4,45 @@ All URIs are relative to *https://api.onesignal.com*
|
|
4
4
|
|
5
5
|
| Method | HTTP request | Description |
|
6
6
|
| ------ | ------------ | ----------- |
|
7
|
-
| [**begin_live_activity**](DefaultApi.md#begin_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity |
|
8
7
|
| [**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
|
8
|
+
| [**create_alias**](DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
|
9
|
+
| [**create_alias_by_subscription**](DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
|
9
10
|
| [**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app |
|
10
11
|
| [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification |
|
11
|
-
| [**
|
12
|
-
| [**create_segments**](DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments |
|
12
|
+
| [**create_segment**](DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment |
|
13
13
|
| [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | |
|
14
14
|
| [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | |
|
15
15
|
| [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | |
|
16
|
-
| [**
|
17
|
-
| [**delete_segments**](DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments |
|
16
|
+
| [**delete_segment**](DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment |
|
18
17
|
| [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
|
19
18
|
| [**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
19
|
| [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
|
22
|
-
| [**
|
23
|
-
| [**
|
24
|
-
| [**
|
25
|
-
| [**fetch_user_identity**](DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
|
20
|
+
| [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
|
21
|
+
| [**get_aliases**](DefaultApi.md#get_aliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
|
22
|
+
| [**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
|
26
23
|
| [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app |
|
27
24
|
| [**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
25
|
| [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification |
|
30
26
|
| [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History |
|
31
27
|
| [**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications |
|
32
28
|
| [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes |
|
33
|
-
| [**
|
34
|
-
| [**
|
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 | |
|
29
|
+
| [**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments |
|
30
|
+
| [**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
|
37
31
|
| [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | |
|
32
|
+
| [**unsubscribe_email_with_token**](DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token |
|
38
33
|
| [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app |
|
39
34
|
| [**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
35
|
| [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | |
|
43
36
|
| [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
|
44
37
|
|
45
38
|
|
46
|
-
##
|
39
|
+
## cancel_notification
|
47
40
|
|
48
|
-
>
|
41
|
+
> <GenericSuccessBoolResponse> cancel_notification(app_id, notification_id)
|
49
42
|
|
50
|
-
|
43
|
+
Stop a scheduled or currently outgoing notification
|
51
44
|
|
52
|
-
|
45
|
+
Used to stop a scheduled or currently outgoing notification
|
53
46
|
|
54
47
|
### Examples
|
55
48
|
|
@@ -57,41 +50,39 @@ Starts a Live Activity
|
|
57
50
|
require 'onesignal'
|
58
51
|
# setup authorization
|
59
52
|
OneSignal.configure do |config|
|
60
|
-
# Configure Bearer authorization:
|
61
|
-
config.
|
62
|
-
# Configure Bearer authorization: app_key
|
63
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
53
|
+
# Configure Bearer authorization: rest_api_key
|
54
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
64
55
|
|
65
56
|
end
|
66
57
|
|
67
58
|
api_instance = OneSignal::DefaultApi.new
|
68
|
-
app_id = 'app_id_example' # String |
|
69
|
-
|
70
|
-
begin_live_activity_request = OneSignal::BeginLiveActivityRequest.new({push_token: 'push_token_example', subscription_id: 'subscription_id_example'}) # BeginLiveActivityRequest |
|
59
|
+
app_id = 'app_id_example' # String |
|
60
|
+
notification_id = 'notification_id_example' # String |
|
71
61
|
|
72
62
|
begin
|
73
|
-
#
|
74
|
-
api_instance.
|
63
|
+
# Stop a scheduled or currently outgoing notification
|
64
|
+
result = api_instance.cancel_notification(app_id, notification_id)
|
65
|
+
p result
|
75
66
|
rescue OneSignal::ApiError => e
|
76
|
-
puts "Error when calling DefaultApi->
|
67
|
+
puts "Error when calling DefaultApi->cancel_notification: #{e}"
|
77
68
|
end
|
78
69
|
```
|
79
70
|
|
80
|
-
#### Using the
|
71
|
+
#### Using the cancel_notification_with_http_info variant
|
81
72
|
|
82
|
-
This returns an Array which contains the response data
|
73
|
+
This returns an Array which contains the response data, status code and headers.
|
83
74
|
|
84
|
-
> <Array(
|
75
|
+
> <Array(<GenericSuccessBoolResponse>, Integer, Hash)> cancel_notification_with_http_info(app_id, notification_id)
|
85
76
|
|
86
77
|
```ruby
|
87
78
|
begin
|
88
|
-
#
|
89
|
-
data, status_code, headers = api_instance.
|
79
|
+
# Stop a scheduled or currently outgoing notification
|
80
|
+
data, status_code, headers = api_instance.cancel_notification_with_http_info(app_id, notification_id)
|
90
81
|
p status_code # => 2xx
|
91
82
|
p headers # => { ... }
|
92
|
-
p data # =>
|
83
|
+
p data # => <GenericSuccessBoolResponse>
|
93
84
|
rescue OneSignal::ApiError => e
|
94
|
-
puts "Error when calling DefaultApi->
|
85
|
+
puts "Error when calling DefaultApi->cancel_notification_with_http_info: #{e}"
|
95
86
|
end
|
96
87
|
```
|
97
88
|
|
@@ -99,31 +90,30 @@ end
|
|
99
90
|
|
100
91
|
| Name | Type | Description | Notes |
|
101
92
|
| ---- | ---- | ----------- | ----- |
|
102
|
-
| **app_id** | **String** |
|
103
|
-
| **
|
104
|
-
| **begin_live_activity_request** | [**BeginLiveActivityRequest**](BeginLiveActivityRequest.md) | | |
|
93
|
+
| **app_id** | **String** | | |
|
94
|
+
| **notification_id** | **String** | | |
|
105
95
|
|
106
96
|
### Return type
|
107
97
|
|
108
|
-
|
98
|
+
[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
|
109
99
|
|
110
100
|
### Authorization
|
111
101
|
|
112
|
-
[
|
102
|
+
[rest_api_key](../README.md#rest_api_key)
|
113
103
|
|
114
104
|
### HTTP request headers
|
115
105
|
|
116
|
-
- **Content-Type**:
|
106
|
+
- **Content-Type**: Not defined
|
117
107
|
- **Accept**: application/json
|
118
108
|
|
119
109
|
|
120
|
-
##
|
110
|
+
## create_alias
|
121
111
|
|
122
|
-
> <
|
112
|
+
> <UserIdentityBody> create_alias(app_id, alias_label, alias_id, user_identity_body)
|
123
113
|
|
124
|
-
Stop a scheduled or currently outgoing notification
|
125
114
|
|
126
|
-
|
115
|
+
|
116
|
+
Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
|
127
117
|
|
128
118
|
### Examples
|
129
119
|
|
@@ -131,41 +121,41 @@ Used to stop a scheduled or currently outgoing notification
|
|
131
121
|
require 'onesignal'
|
132
122
|
# setup authorization
|
133
123
|
OneSignal.configure do |config|
|
134
|
-
# Configure Bearer authorization:
|
135
|
-
config.
|
136
|
-
# Configure Bearer authorization: app_key
|
137
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
124
|
+
# Configure Bearer authorization: rest_api_key
|
125
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
138
126
|
|
139
127
|
end
|
140
128
|
|
141
129
|
api_instance = OneSignal::DefaultApi.new
|
142
130
|
app_id = 'app_id_example' # String |
|
143
|
-
|
131
|
+
alias_label = 'alias_label_example' # String |
|
132
|
+
alias_id = 'alias_id_example' # String |
|
133
|
+
user_identity_body = OneSignal::UserIdentityBody.new # UserIdentityBody |
|
144
134
|
|
145
135
|
begin
|
146
|
-
|
147
|
-
result = api_instance.
|
136
|
+
|
137
|
+
result = api_instance.create_alias(app_id, alias_label, alias_id, user_identity_body)
|
148
138
|
p result
|
149
139
|
rescue OneSignal::ApiError => e
|
150
|
-
puts "Error when calling DefaultApi->
|
140
|
+
puts "Error when calling DefaultApi->create_alias: #{e}"
|
151
141
|
end
|
152
142
|
```
|
153
143
|
|
154
|
-
#### Using the
|
144
|
+
#### Using the create_alias_with_http_info variant
|
155
145
|
|
156
146
|
This returns an Array which contains the response data, status code and headers.
|
157
147
|
|
158
|
-
> <Array(<
|
148
|
+
> <Array(<UserIdentityBody>, Integer, Hash)> create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body)
|
159
149
|
|
160
150
|
```ruby
|
161
151
|
begin
|
162
|
-
|
163
|
-
data, status_code, headers = api_instance.
|
152
|
+
|
153
|
+
data, status_code, headers = api_instance.create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body)
|
164
154
|
p status_code # => 2xx
|
165
155
|
p headers # => { ... }
|
166
|
-
p data # => <
|
156
|
+
p data # => <UserIdentityBody>
|
167
157
|
rescue OneSignal::ApiError => e
|
168
|
-
puts "Error when calling DefaultApi->
|
158
|
+
puts "Error when calling DefaultApi->create_alias_with_http_info: #{e}"
|
169
159
|
end
|
170
160
|
```
|
171
161
|
|
@@ -174,29 +164,31 @@ end
|
|
174
164
|
| Name | Type | Description | Notes |
|
175
165
|
| ---- | ---- | ----------- | ----- |
|
176
166
|
| **app_id** | **String** | | |
|
177
|
-
| **
|
167
|
+
| **alias_label** | **String** | | |
|
168
|
+
| **alias_id** | **String** | | |
|
169
|
+
| **user_identity_body** | [**UserIdentityBody**](UserIdentityBody.md) | | |
|
178
170
|
|
179
171
|
### Return type
|
180
172
|
|
181
|
-
[**
|
173
|
+
[**UserIdentityBody**](UserIdentityBody.md)
|
182
174
|
|
183
175
|
### Authorization
|
184
176
|
|
185
|
-
[
|
177
|
+
[rest_api_key](../README.md#rest_api_key)
|
186
178
|
|
187
179
|
### HTTP request headers
|
188
180
|
|
189
|
-
- **Content-Type**:
|
181
|
+
- **Content-Type**: application/json
|
190
182
|
- **Accept**: application/json
|
191
183
|
|
192
184
|
|
193
|
-
##
|
185
|
+
## create_alias_by_subscription
|
194
186
|
|
195
|
-
> <
|
187
|
+
> <UserIdentityBody> create_alias_by_subscription(app_id, subscription_id, user_identity_body)
|
196
188
|
|
197
|
-
Create an app
|
198
189
|
|
199
|
-
|
190
|
+
|
191
|
+
Upserts one or more Aliases for the User identified by :subscription_id.
|
200
192
|
|
201
193
|
### Examples
|
202
194
|
|
@@ -204,40 +196,40 @@ Creates a new OneSignal app
|
|
204
196
|
require 'onesignal'
|
205
197
|
# setup authorization
|
206
198
|
OneSignal.configure do |config|
|
207
|
-
# Configure Bearer authorization:
|
208
|
-
config.
|
209
|
-
# Configure Bearer authorization: user_key
|
210
|
-
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
199
|
+
# Configure Bearer authorization: rest_api_key
|
200
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
211
201
|
|
212
202
|
end
|
213
203
|
|
214
204
|
api_instance = OneSignal::DefaultApi.new
|
215
|
-
|
205
|
+
app_id = 'app_id_example' # String |
|
206
|
+
subscription_id = 'subscription_id_example' # String |
|
207
|
+
user_identity_body = OneSignal::UserIdentityBody.new # UserIdentityBody |
|
216
208
|
|
217
209
|
begin
|
218
|
-
|
219
|
-
result = api_instance.
|
210
|
+
|
211
|
+
result = api_instance.create_alias_by_subscription(app_id, subscription_id, user_identity_body)
|
220
212
|
p result
|
221
213
|
rescue OneSignal::ApiError => e
|
222
|
-
puts "Error when calling DefaultApi->
|
214
|
+
puts "Error when calling DefaultApi->create_alias_by_subscription: #{e}"
|
223
215
|
end
|
224
216
|
```
|
225
217
|
|
226
|
-
#### Using the
|
218
|
+
#### Using the create_alias_by_subscription_with_http_info variant
|
227
219
|
|
228
220
|
This returns an Array which contains the response data, status code and headers.
|
229
221
|
|
230
|
-
> <Array(<
|
222
|
+
> <Array(<UserIdentityBody>, Integer, Hash)> create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body)
|
231
223
|
|
232
224
|
```ruby
|
233
225
|
begin
|
234
|
-
|
235
|
-
data, status_code, headers = api_instance.
|
226
|
+
|
227
|
+
data, status_code, headers = api_instance.create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body)
|
236
228
|
p status_code # => 2xx
|
237
229
|
p headers # => { ... }
|
238
|
-
p data # => <
|
230
|
+
p data # => <UserIdentityBody>
|
239
231
|
rescue OneSignal::ApiError => e
|
240
|
-
puts "Error when calling DefaultApi->
|
232
|
+
puts "Error when calling DefaultApi->create_alias_by_subscription_with_http_info: #{e}"
|
241
233
|
end
|
242
234
|
```
|
243
235
|
|
@@ -245,15 +237,17 @@ end
|
|
245
237
|
|
246
238
|
| Name | Type | Description | Notes |
|
247
239
|
| ---- | ---- | ----------- | ----- |
|
248
|
-
| **
|
240
|
+
| **app_id** | **String** | | |
|
241
|
+
| **subscription_id** | **String** | | |
|
242
|
+
| **user_identity_body** | [**UserIdentityBody**](UserIdentityBody.md) | | |
|
249
243
|
|
250
244
|
### Return type
|
251
245
|
|
252
|
-
[**
|
246
|
+
[**UserIdentityBody**](UserIdentityBody.md)
|
253
247
|
|
254
248
|
### Authorization
|
255
249
|
|
256
|
-
[
|
250
|
+
[rest_api_key](../README.md#rest_api_key)
|
257
251
|
|
258
252
|
### HTTP request headers
|
259
253
|
|
@@ -261,13 +255,13 @@ end
|
|
261
255
|
- **Accept**: application/json
|
262
256
|
|
263
257
|
|
264
|
-
##
|
258
|
+
## create_app
|
265
259
|
|
266
|
-
> <
|
260
|
+
> <App> create_app(app)
|
267
261
|
|
268
|
-
Create
|
262
|
+
Create an app
|
269
263
|
|
270
|
-
|
264
|
+
Creates a new OneSignal app
|
271
265
|
|
272
266
|
### Examples
|
273
267
|
|
@@ -275,40 +269,38 @@ Sends notifications to your users
|
|
275
269
|
require 'onesignal'
|
276
270
|
# setup authorization
|
277
271
|
OneSignal.configure do |config|
|
278
|
-
# Configure Bearer authorization:
|
279
|
-
config.
|
280
|
-
# Configure Bearer authorization: app_key
|
281
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
272
|
+
# Configure Bearer authorization: organization_api_key
|
273
|
+
config.organization_api_key = 'YOUR_BEARER_TOKEN'
|
282
274
|
|
283
275
|
end
|
284
276
|
|
285
277
|
api_instance = OneSignal::DefaultApi.new
|
286
|
-
|
278
|
+
app = OneSignal::App.new # App |
|
287
279
|
|
288
280
|
begin
|
289
|
-
# Create
|
290
|
-
result = api_instance.
|
281
|
+
# Create an app
|
282
|
+
result = api_instance.create_app(app)
|
291
283
|
p result
|
292
284
|
rescue OneSignal::ApiError => e
|
293
|
-
puts "Error when calling DefaultApi->
|
285
|
+
puts "Error when calling DefaultApi->create_app: #{e}"
|
294
286
|
end
|
295
287
|
```
|
296
288
|
|
297
|
-
#### Using the
|
289
|
+
#### Using the create_app_with_http_info variant
|
298
290
|
|
299
291
|
This returns an Array which contains the response data, status code and headers.
|
300
292
|
|
301
|
-
> <Array(<
|
293
|
+
> <Array(<App>, Integer, Hash)> create_app_with_http_info(app)
|
302
294
|
|
303
295
|
```ruby
|
304
296
|
begin
|
305
|
-
# Create
|
306
|
-
data, status_code, headers = api_instance.
|
297
|
+
# Create an app
|
298
|
+
data, status_code, headers = api_instance.create_app_with_http_info(app)
|
307
299
|
p status_code # => 2xx
|
308
300
|
p headers # => { ... }
|
309
|
-
p data # => <
|
301
|
+
p data # => <App>
|
310
302
|
rescue OneSignal::ApiError => e
|
311
|
-
puts "Error when calling DefaultApi->
|
303
|
+
puts "Error when calling DefaultApi->create_app_with_http_info: #{e}"
|
312
304
|
end
|
313
305
|
```
|
314
306
|
|
@@ -316,15 +308,15 @@ end
|
|
316
308
|
|
317
309
|
| Name | Type | Description | Notes |
|
318
310
|
| ---- | ---- | ----------- | ----- |
|
319
|
-
| **
|
311
|
+
| **app** | [**App**](App.md) | | |
|
320
312
|
|
321
313
|
### Return type
|
322
314
|
|
323
|
-
[**
|
315
|
+
[**App**](App.md)
|
324
316
|
|
325
317
|
### Authorization
|
326
318
|
|
327
|
-
[
|
319
|
+
[organization_api_key](../README.md#organization_api_key)
|
328
320
|
|
329
321
|
### HTTP request headers
|
330
322
|
|
@@ -332,13 +324,13 @@ end
|
|
332
324
|
- **Accept**: application/json
|
333
325
|
|
334
326
|
|
335
|
-
##
|
327
|
+
## create_notification
|
336
328
|
|
337
|
-
> <
|
329
|
+
> <CreateNotificationSuccessResponse> create_notification(notification)
|
338
330
|
|
339
|
-
|
331
|
+
Create notification
|
340
332
|
|
341
|
-
|
333
|
+
Sends notifications to your users
|
342
334
|
|
343
335
|
### Examples
|
344
336
|
|
@@ -346,40 +338,38 @@ Register a new device to one of your OneSignal apps 🚧 Don't use this Thi
|
|
346
338
|
require 'onesignal'
|
347
339
|
# setup authorization
|
348
340
|
OneSignal.configure do |config|
|
349
|
-
# Configure Bearer authorization:
|
350
|
-
config.
|
351
|
-
# Configure Bearer authorization: app_key
|
352
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
341
|
+
# Configure Bearer authorization: rest_api_key
|
342
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
353
343
|
|
354
344
|
end
|
355
345
|
|
356
346
|
api_instance = OneSignal::DefaultApi.new
|
357
|
-
|
347
|
+
notification = OneSignal::Notification.new({app_id: 'app_id_example'}) # Notification |
|
358
348
|
|
359
349
|
begin
|
360
|
-
#
|
361
|
-
result = api_instance.
|
350
|
+
# Create notification
|
351
|
+
result = api_instance.create_notification(notification)
|
362
352
|
p result
|
363
353
|
rescue OneSignal::ApiError => e
|
364
|
-
puts "Error when calling DefaultApi->
|
354
|
+
puts "Error when calling DefaultApi->create_notification: #{e}"
|
365
355
|
end
|
366
356
|
```
|
367
357
|
|
368
|
-
#### Using the
|
358
|
+
#### Using the create_notification_with_http_info variant
|
369
359
|
|
370
360
|
This returns an Array which contains the response data, status code and headers.
|
371
361
|
|
372
|
-
> <Array(<
|
362
|
+
> <Array(<CreateNotificationSuccessResponse>, Integer, Hash)> create_notification_with_http_info(notification)
|
373
363
|
|
374
364
|
```ruby
|
375
365
|
begin
|
376
|
-
#
|
377
|
-
data, status_code, headers = api_instance.
|
366
|
+
# Create notification
|
367
|
+
data, status_code, headers = api_instance.create_notification_with_http_info(notification)
|
378
368
|
p status_code # => 2xx
|
379
369
|
p headers # => { ... }
|
380
|
-
p data # => <
|
370
|
+
p data # => <CreateNotificationSuccessResponse>
|
381
371
|
rescue OneSignal::ApiError => e
|
382
|
-
puts "Error when calling DefaultApi->
|
372
|
+
puts "Error when calling DefaultApi->create_notification_with_http_info: #{e}"
|
383
373
|
end
|
384
374
|
```
|
385
375
|
|
@@ -387,15 +377,15 @@ end
|
|
387
377
|
|
388
378
|
| Name | Type | Description | Notes |
|
389
379
|
| ---- | ---- | ----------- | ----- |
|
390
|
-
| **
|
380
|
+
| **notification** | [**Notification**](Notification.md) | | |
|
391
381
|
|
392
382
|
### Return type
|
393
383
|
|
394
|
-
[**
|
384
|
+
[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md)
|
395
385
|
|
396
386
|
### Authorization
|
397
387
|
|
398
|
-
[
|
388
|
+
[rest_api_key](../README.md#rest_api_key)
|
399
389
|
|
400
390
|
### HTTP request headers
|
401
391
|
|
@@ -403,13 +393,13 @@ end
|
|
403
393
|
- **Accept**: application/json
|
404
394
|
|
405
395
|
|
406
|
-
##
|
396
|
+
## create_segment
|
407
397
|
|
408
|
-
> <CreateSegmentSuccessResponse>
|
398
|
+
> <CreateSegmentSuccessResponse> create_segment(app_id, opts)
|
409
399
|
|
410
|
-
Create
|
400
|
+
Create Segment
|
411
401
|
|
412
|
-
Create
|
402
|
+
Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit.
|
413
403
|
|
414
404
|
### Examples
|
415
405
|
|
@@ -417,43 +407,41 @@ Create segments visible and usable in the dashboard and API - Required: OneSigna
|
|
417
407
|
require 'onesignal'
|
418
408
|
# setup authorization
|
419
409
|
OneSignal.configure do |config|
|
420
|
-
# Configure Bearer authorization:
|
421
|
-
config.
|
422
|
-
# Configure Bearer authorization: app_key
|
423
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
410
|
+
# Configure Bearer authorization: rest_api_key
|
411
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
424
412
|
|
425
413
|
end
|
426
414
|
|
427
415
|
api_instance = OneSignal::DefaultApi.new
|
428
416
|
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
429
417
|
opts = {
|
430
|
-
segment: OneSignal::Segment.new({name: 'name_example', filters: [OneSignal::
|
418
|
+
segment: OneSignal::Segment.new({name: 'name_example', filters: [OneSignal::Filter.new]}) # Segment |
|
431
419
|
}
|
432
420
|
|
433
421
|
begin
|
434
|
-
# Create
|
435
|
-
result = api_instance.
|
422
|
+
# Create Segment
|
423
|
+
result = api_instance.create_segment(app_id, opts)
|
436
424
|
p result
|
437
425
|
rescue OneSignal::ApiError => e
|
438
|
-
puts "Error when calling DefaultApi->
|
426
|
+
puts "Error when calling DefaultApi->create_segment: #{e}"
|
439
427
|
end
|
440
428
|
```
|
441
429
|
|
442
|
-
#### Using the
|
430
|
+
#### Using the create_segment_with_http_info variant
|
443
431
|
|
444
432
|
This returns an Array which contains the response data, status code and headers.
|
445
433
|
|
446
|
-
> <Array(<CreateSegmentSuccessResponse>, Integer, Hash)>
|
434
|
+
> <Array(<CreateSegmentSuccessResponse>, Integer, Hash)> create_segment_with_http_info(app_id, opts)
|
447
435
|
|
448
436
|
```ruby
|
449
437
|
begin
|
450
|
-
# Create
|
451
|
-
data, status_code, headers = api_instance.
|
438
|
+
# Create Segment
|
439
|
+
data, status_code, headers = api_instance.create_segment_with_http_info(app_id, opts)
|
452
440
|
p status_code # => 2xx
|
453
441
|
p headers # => { ... }
|
454
442
|
p data # => <CreateSegmentSuccessResponse>
|
455
443
|
rescue OneSignal::ApiError => e
|
456
|
-
puts "Error when calling DefaultApi->
|
444
|
+
puts "Error when calling DefaultApi->create_segment_with_http_info: #{e}"
|
457
445
|
end
|
458
446
|
```
|
459
447
|
|
@@ -470,7 +458,7 @@ end
|
|
470
458
|
|
471
459
|
### Authorization
|
472
460
|
|
473
|
-
[
|
461
|
+
[rest_api_key](../README.md#rest_api_key)
|
474
462
|
|
475
463
|
### HTTP request headers
|
476
464
|
|
@@ -480,7 +468,7 @@ end
|
|
480
468
|
|
481
469
|
## create_subscription
|
482
470
|
|
483
|
-
> <
|
471
|
+
> <SubscriptionBody> create_subscription(app_id, alias_label, alias_id, subscription_body)
|
484
472
|
|
485
473
|
|
486
474
|
|
@@ -492,10 +480,8 @@ Creates a new Subscription under the User provided. Useful to add email addresse
|
|
492
480
|
require 'onesignal'
|
493
481
|
# setup authorization
|
494
482
|
OneSignal.configure do |config|
|
495
|
-
# Configure Bearer authorization:
|
496
|
-
config.
|
497
|
-
# Configure Bearer authorization: app_key
|
498
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
483
|
+
# Configure Bearer authorization: rest_api_key
|
484
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
499
485
|
|
500
486
|
end
|
501
487
|
|
@@ -503,11 +489,11 @@ api_instance = OneSignal::DefaultApi.new
|
|
503
489
|
app_id = 'app_id_example' # String |
|
504
490
|
alias_label = 'alias_label_example' # String |
|
505
491
|
alias_id = 'alias_id_example' # String |
|
506
|
-
|
492
|
+
subscription_body = OneSignal::SubscriptionBody.new # SubscriptionBody |
|
507
493
|
|
508
494
|
begin
|
509
495
|
|
510
|
-
result = api_instance.create_subscription(app_id, alias_label, alias_id,
|
496
|
+
result = api_instance.create_subscription(app_id, alias_label, alias_id, subscription_body)
|
511
497
|
p result
|
512
498
|
rescue OneSignal::ApiError => e
|
513
499
|
puts "Error when calling DefaultApi->create_subscription: #{e}"
|
@@ -518,15 +504,15 @@ end
|
|
518
504
|
|
519
505
|
This returns an Array which contains the response data, status code and headers.
|
520
506
|
|
521
|
-
> <Array(<
|
507
|
+
> <Array(<SubscriptionBody>, Integer, Hash)> create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body)
|
522
508
|
|
523
509
|
```ruby
|
524
510
|
begin
|
525
511
|
|
526
|
-
data, status_code, headers = api_instance.create_subscription_with_http_info(app_id, alias_label, alias_id,
|
512
|
+
data, status_code, headers = api_instance.create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body)
|
527
513
|
p status_code # => 2xx
|
528
514
|
p headers # => { ... }
|
529
|
-
p data # => <
|
515
|
+
p data # => <SubscriptionBody>
|
530
516
|
rescue OneSignal::ApiError => e
|
531
517
|
puts "Error when calling DefaultApi->create_subscription_with_http_info: #{e}"
|
532
518
|
end
|
@@ -539,15 +525,15 @@ end
|
|
539
525
|
| **app_id** | **String** | | |
|
540
526
|
| **alias_label** | **String** | | |
|
541
527
|
| **alias_id** | **String** | | |
|
542
|
-
| **
|
528
|
+
| **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) | | |
|
543
529
|
|
544
530
|
### Return type
|
545
531
|
|
546
|
-
[**
|
532
|
+
[**SubscriptionBody**](SubscriptionBody.md)
|
547
533
|
|
548
534
|
### Authorization
|
549
535
|
|
550
|
-
[
|
536
|
+
[rest_api_key](../README.md#rest_api_key)
|
551
537
|
|
552
538
|
### HTTP request headers
|
553
539
|
|
@@ -569,10 +555,8 @@ Creates a User, optionally Subscriptions owned by the User as well as Aliases. A
|
|
569
555
|
require 'onesignal'
|
570
556
|
# setup authorization
|
571
557
|
OneSignal.configure do |config|
|
572
|
-
# Configure Bearer authorization:
|
573
|
-
config.
|
574
|
-
# Configure Bearer authorization: app_key
|
575
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
558
|
+
# Configure Bearer authorization: rest_api_key
|
559
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
576
560
|
|
577
561
|
end
|
578
562
|
|
@@ -620,7 +604,7 @@ end
|
|
620
604
|
|
621
605
|
### Authorization
|
622
606
|
|
623
|
-
[
|
607
|
+
[rest_api_key](../README.md#rest_api_key)
|
624
608
|
|
625
609
|
### HTTP request headers
|
626
610
|
|
@@ -630,7 +614,7 @@ end
|
|
630
614
|
|
631
615
|
## delete_alias
|
632
616
|
|
633
|
-
> <
|
617
|
+
> <UserIdentityBody> delete_alias(app_id, alias_label, alias_id, alias_label_to_delete)
|
634
618
|
|
635
619
|
|
636
620
|
|
@@ -642,10 +626,8 @@ Deletes an alias by alias label
|
|
642
626
|
require 'onesignal'
|
643
627
|
# setup authorization
|
644
628
|
OneSignal.configure do |config|
|
645
|
-
# Configure Bearer authorization:
|
646
|
-
config.
|
647
|
-
# Configure Bearer authorization: app_key
|
648
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
629
|
+
# Configure Bearer authorization: rest_api_key
|
630
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
649
631
|
|
650
632
|
end
|
651
633
|
|
@@ -668,7 +650,7 @@ end
|
|
668
650
|
|
669
651
|
This returns an Array which contains the response data, status code and headers.
|
670
652
|
|
671
|
-
> <Array(<
|
653
|
+
> <Array(<UserIdentityBody>, Integer, Hash)> delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete)
|
672
654
|
|
673
655
|
```ruby
|
674
656
|
begin
|
@@ -676,7 +658,7 @@ begin
|
|
676
658
|
data, status_code, headers = api_instance.delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete)
|
677
659
|
p status_code # => 2xx
|
678
660
|
p headers # => { ... }
|
679
|
-
p data # => <
|
661
|
+
p data # => <UserIdentityBody>
|
680
662
|
rescue OneSignal::ApiError => e
|
681
663
|
puts "Error when calling DefaultApi->delete_alias_with_http_info: #{e}"
|
682
664
|
end
|
@@ -693,84 +675,11 @@ end
|
|
693
675
|
|
694
676
|
### Return type
|
695
677
|
|
696
|
-
[**
|
697
|
-
|
698
|
-
### Authorization
|
699
|
-
|
700
|
-
[app_key](../README.md#app_key)
|
701
|
-
|
702
|
-
### HTTP request headers
|
703
|
-
|
704
|
-
- **Content-Type**: Not defined
|
705
|
-
- **Accept**: application/json
|
706
|
-
|
707
|
-
|
708
|
-
## delete_player
|
709
|
-
|
710
|
-
> <DeletePlayerSuccessResponse> delete_player(app_id, player_id)
|
711
|
-
|
712
|
-
Delete a user record
|
713
|
-
|
714
|
-
Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
|
715
|
-
|
716
|
-
### Examples
|
717
|
-
|
718
|
-
```ruby
|
719
|
-
require 'onesignal'
|
720
|
-
# setup authorization
|
721
|
-
OneSignal.configure do |config|
|
722
|
-
# Configure Bearer authorization: user_key
|
723
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
724
|
-
# Configure Bearer authorization: app_key
|
725
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
726
|
-
|
727
|
-
end
|
728
|
-
|
729
|
-
api_instance = OneSignal::DefaultApi.new
|
730
|
-
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
731
|
-
player_id = 'player_id_example' # String | The OneSignal player_id
|
732
|
-
|
733
|
-
begin
|
734
|
-
# Delete a user record
|
735
|
-
result = api_instance.delete_player(app_id, player_id)
|
736
|
-
p result
|
737
|
-
rescue OneSignal::ApiError => e
|
738
|
-
puts "Error when calling DefaultApi->delete_player: #{e}"
|
739
|
-
end
|
740
|
-
```
|
741
|
-
|
742
|
-
#### Using the delete_player_with_http_info variant
|
743
|
-
|
744
|
-
This returns an Array which contains the response data, status code and headers.
|
745
|
-
|
746
|
-
> <Array(<DeletePlayerSuccessResponse>, Integer, Hash)> delete_player_with_http_info(app_id, player_id)
|
747
|
-
|
748
|
-
```ruby
|
749
|
-
begin
|
750
|
-
# Delete a user record
|
751
|
-
data, status_code, headers = api_instance.delete_player_with_http_info(app_id, player_id)
|
752
|
-
p status_code # => 2xx
|
753
|
-
p headers # => { ... }
|
754
|
-
p data # => <DeletePlayerSuccessResponse>
|
755
|
-
rescue OneSignal::ApiError => e
|
756
|
-
puts "Error when calling DefaultApi->delete_player_with_http_info: #{e}"
|
757
|
-
end
|
758
|
-
```
|
759
|
-
|
760
|
-
### Parameters
|
761
|
-
|
762
|
-
| Name | Type | Description | Notes |
|
763
|
-
| ---- | ---- | ----------- | ----- |
|
764
|
-
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
765
|
-
| **player_id** | **String** | The OneSignal player_id | |
|
766
|
-
|
767
|
-
### Return type
|
768
|
-
|
769
|
-
[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md)
|
678
|
+
[**UserIdentityBody**](UserIdentityBody.md)
|
770
679
|
|
771
680
|
### Authorization
|
772
681
|
|
773
|
-
[
|
682
|
+
[rest_api_key](../README.md#rest_api_key)
|
774
683
|
|
775
684
|
### HTTP request headers
|
776
685
|
|
@@ -778,13 +687,13 @@ end
|
|
778
687
|
- **Accept**: application/json
|
779
688
|
|
780
689
|
|
781
|
-
##
|
690
|
+
## delete_segment
|
782
691
|
|
783
|
-
> <
|
692
|
+
> <GenericSuccessBoolResponse> delete_segment(app_id, segment_id)
|
784
693
|
|
785
|
-
Delete
|
694
|
+
Delete Segment
|
786
695
|
|
787
|
-
Delete
|
696
|
+
Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
788
697
|
|
789
698
|
### Examples
|
790
699
|
|
@@ -792,10 +701,8 @@ Delete segments (not user devices) - Required: OneSignal Paid Plan You can delet
|
|
792
701
|
require 'onesignal'
|
793
702
|
# setup authorization
|
794
703
|
OneSignal.configure do |config|
|
795
|
-
# Configure Bearer authorization:
|
796
|
-
config.
|
797
|
-
# Configure Bearer authorization: app_key
|
798
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
704
|
+
# Configure Bearer authorization: rest_api_key
|
705
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
799
706
|
|
800
707
|
end
|
801
708
|
|
@@ -804,29 +711,29 @@ app_id = 'app_id_example' # String | The OneSignal App ID for your app. Availab
|
|
804
711
|
segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
805
712
|
|
806
713
|
begin
|
807
|
-
# Delete
|
808
|
-
result = api_instance.
|
714
|
+
# Delete Segment
|
715
|
+
result = api_instance.delete_segment(app_id, segment_id)
|
809
716
|
p result
|
810
717
|
rescue OneSignal::ApiError => e
|
811
|
-
puts "Error when calling DefaultApi->
|
718
|
+
puts "Error when calling DefaultApi->delete_segment: #{e}"
|
812
719
|
end
|
813
720
|
```
|
814
721
|
|
815
|
-
#### Using the
|
722
|
+
#### Using the delete_segment_with_http_info variant
|
816
723
|
|
817
724
|
This returns an Array which contains the response data, status code and headers.
|
818
725
|
|
819
|
-
> <Array(<
|
726
|
+
> <Array(<GenericSuccessBoolResponse>, Integer, Hash)> delete_segment_with_http_info(app_id, segment_id)
|
820
727
|
|
821
728
|
```ruby
|
822
729
|
begin
|
823
|
-
# Delete
|
824
|
-
data, status_code, headers = api_instance.
|
730
|
+
# Delete Segment
|
731
|
+
data, status_code, headers = api_instance.delete_segment_with_http_info(app_id, segment_id)
|
825
732
|
p status_code # => 2xx
|
826
733
|
p headers # => { ... }
|
827
|
-
p data # => <
|
734
|
+
p data # => <GenericSuccessBoolResponse>
|
828
735
|
rescue OneSignal::ApiError => e
|
829
|
-
puts "Error when calling DefaultApi->
|
736
|
+
puts "Error when calling DefaultApi->delete_segment_with_http_info: #{e}"
|
830
737
|
end
|
831
738
|
```
|
832
739
|
|
@@ -839,11 +746,11 @@ end
|
|
839
746
|
|
840
747
|
### Return type
|
841
748
|
|
842
|
-
[**
|
749
|
+
[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
|
843
750
|
|
844
751
|
### Authorization
|
845
752
|
|
846
|
-
[
|
753
|
+
[rest_api_key](../README.md#rest_api_key)
|
847
754
|
|
848
755
|
### HTTP request headers
|
849
756
|
|
@@ -865,10 +772,8 @@ Deletes the Subscription.
|
|
865
772
|
require 'onesignal'
|
866
773
|
# setup authorization
|
867
774
|
OneSignal.configure do |config|
|
868
|
-
# Configure Bearer authorization:
|
869
|
-
config.
|
870
|
-
# Configure Bearer authorization: app_key
|
871
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
775
|
+
# Configure Bearer authorization: rest_api_key
|
776
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
872
777
|
|
873
778
|
end
|
874
779
|
|
@@ -915,7 +820,7 @@ nil (empty response body)
|
|
915
820
|
|
916
821
|
### Authorization
|
917
822
|
|
918
|
-
[
|
823
|
+
[rest_api_key](../README.md#rest_api_key)
|
919
824
|
|
920
825
|
### HTTP request headers
|
921
826
|
|
@@ -937,10 +842,8 @@ Removes the User identified by (:alias_label, :alias_id), and all Subscriptions
|
|
937
842
|
require 'onesignal'
|
938
843
|
# setup authorization
|
939
844
|
OneSignal.configure do |config|
|
940
|
-
# Configure Bearer authorization:
|
941
|
-
config.
|
942
|
-
# Configure Bearer authorization: app_key
|
943
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
845
|
+
# Configure Bearer authorization: rest_api_key
|
846
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
944
847
|
|
945
848
|
end
|
946
849
|
|
@@ -989,81 +892,7 @@ nil (empty response body)
|
|
989
892
|
|
990
893
|
### Authorization
|
991
894
|
|
992
|
-
[
|
993
|
-
|
994
|
-
### HTTP request headers
|
995
|
-
|
996
|
-
- **Content-Type**: Not defined
|
997
|
-
- **Accept**: application/json
|
998
|
-
|
999
|
-
|
1000
|
-
## end_live_activity
|
1001
|
-
|
1002
|
-
> end_live_activity(app_id, activity_id, subscription_id)
|
1003
|
-
|
1004
|
-
Stop Live Activity
|
1005
|
-
|
1006
|
-
Stops a Live Activity
|
1007
|
-
|
1008
|
-
### Examples
|
1009
|
-
|
1010
|
-
```ruby
|
1011
|
-
require 'onesignal'
|
1012
|
-
# setup authorization
|
1013
|
-
OneSignal.configure do |config|
|
1014
|
-
# Configure Bearer authorization: user_key
|
1015
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1016
|
-
# Configure Bearer authorization: app_key
|
1017
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1018
|
-
|
1019
|
-
end
|
1020
|
-
|
1021
|
-
api_instance = OneSignal::DefaultApi.new
|
1022
|
-
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
1023
|
-
activity_id = 'activity_id_example' # String | Live Activity record ID
|
1024
|
-
subscription_id = 'subscription_id_example' # String | Subscription ID
|
1025
|
-
|
1026
|
-
begin
|
1027
|
-
# Stop Live Activity
|
1028
|
-
api_instance.end_live_activity(app_id, activity_id, subscription_id)
|
1029
|
-
rescue OneSignal::ApiError => e
|
1030
|
-
puts "Error when calling DefaultApi->end_live_activity: #{e}"
|
1031
|
-
end
|
1032
|
-
```
|
1033
|
-
|
1034
|
-
#### Using the end_live_activity_with_http_info variant
|
1035
|
-
|
1036
|
-
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
1037
|
-
|
1038
|
-
> <Array(nil, Integer, Hash)> end_live_activity_with_http_info(app_id, activity_id, subscription_id)
|
1039
|
-
|
1040
|
-
```ruby
|
1041
|
-
begin
|
1042
|
-
# Stop Live Activity
|
1043
|
-
data, status_code, headers = api_instance.end_live_activity_with_http_info(app_id, activity_id, subscription_id)
|
1044
|
-
p status_code # => 2xx
|
1045
|
-
p headers # => { ... }
|
1046
|
-
p data # => nil
|
1047
|
-
rescue OneSignal::ApiError => e
|
1048
|
-
puts "Error when calling DefaultApi->end_live_activity_with_http_info: #{e}"
|
1049
|
-
end
|
1050
|
-
```
|
1051
|
-
|
1052
|
-
### Parameters
|
1053
|
-
|
1054
|
-
| Name | Type | Description | Notes |
|
1055
|
-
| ---- | ---- | ----------- | ----- |
|
1056
|
-
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
1057
|
-
| **activity_id** | **String** | Live Activity record ID | |
|
1058
|
-
| **subscription_id** | **String** | Subscription ID | |
|
1059
|
-
|
1060
|
-
### Return type
|
1061
|
-
|
1062
|
-
nil (empty response body)
|
1063
|
-
|
1064
|
-
### Authorization
|
1065
|
-
|
1066
|
-
[app_key](../README.md#app_key)
|
895
|
+
[rest_api_key](../README.md#rest_api_key)
|
1067
896
|
|
1068
897
|
### HTTP request headers
|
1069
898
|
|
@@ -1085,10 +914,8 @@ Generate a compressed CSV report of all of the events data for a notification. T
|
|
1085
914
|
require 'onesignal'
|
1086
915
|
# setup authorization
|
1087
916
|
OneSignal.configure do |config|
|
1088
|
-
# Configure Bearer authorization:
|
1089
|
-
config.
|
1090
|
-
# Configure Bearer authorization: app_key
|
1091
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
917
|
+
# Configure Bearer authorization: rest_api_key
|
918
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1092
919
|
|
1093
920
|
end
|
1094
921
|
|
@@ -1136,7 +963,7 @@ end
|
|
1136
963
|
|
1137
964
|
### Authorization
|
1138
965
|
|
1139
|
-
[
|
966
|
+
[rest_api_key](../README.md#rest_api_key)
|
1140
967
|
|
1141
968
|
### HTTP request headers
|
1142
969
|
|
@@ -1144,11 +971,11 @@ end
|
|
1144
971
|
- **Accept**: application/json
|
1145
972
|
|
1146
973
|
|
1147
|
-
##
|
974
|
+
## export_subscriptions
|
1148
975
|
|
1149
|
-
> <
|
976
|
+
> <ExportSubscriptionsSuccessResponse> export_subscriptions(app_id, opts)
|
1150
977
|
|
1151
|
-
Export CSV of
|
978
|
+
Export CSV of Subscriptions
|
1152
979
|
|
1153
980
|
Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. |
|
1154
981
|
|
@@ -1158,43 +985,41 @@ Generate a compressed CSV export of all of your current user data This method ca
|
|
1158
985
|
require 'onesignal'
|
1159
986
|
# setup authorization
|
1160
987
|
OneSignal.configure do |config|
|
1161
|
-
# Configure Bearer authorization:
|
1162
|
-
config.
|
1163
|
-
# Configure Bearer authorization: app_key
|
1164
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
988
|
+
# Configure Bearer authorization: rest_api_key
|
989
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1165
990
|
|
1166
991
|
end
|
1167
992
|
|
1168
993
|
api_instance = OneSignal::DefaultApi.new
|
1169
994
|
app_id = 'app_id_example' # String | The app ID that you want to export devices from
|
1170
995
|
opts = {
|
1171
|
-
|
996
|
+
export_subscriptions_request_body: OneSignal::ExportSubscriptionsRequestBody.new # ExportSubscriptionsRequestBody |
|
1172
997
|
}
|
1173
998
|
|
1174
999
|
begin
|
1175
|
-
# Export CSV of
|
1176
|
-
result = api_instance.
|
1000
|
+
# Export CSV of Subscriptions
|
1001
|
+
result = api_instance.export_subscriptions(app_id, opts)
|
1177
1002
|
p result
|
1178
1003
|
rescue OneSignal::ApiError => e
|
1179
|
-
puts "Error when calling DefaultApi->
|
1004
|
+
puts "Error when calling DefaultApi->export_subscriptions: #{e}"
|
1180
1005
|
end
|
1181
1006
|
```
|
1182
1007
|
|
1183
|
-
#### Using the
|
1008
|
+
#### Using the export_subscriptions_with_http_info variant
|
1184
1009
|
|
1185
1010
|
This returns an Array which contains the response data, status code and headers.
|
1186
1011
|
|
1187
|
-
> <Array(<
|
1012
|
+
> <Array(<ExportSubscriptionsSuccessResponse>, Integer, Hash)> export_subscriptions_with_http_info(app_id, opts)
|
1188
1013
|
|
1189
1014
|
```ruby
|
1190
1015
|
begin
|
1191
|
-
# Export CSV of
|
1192
|
-
data, status_code, headers = api_instance.
|
1016
|
+
# Export CSV of Subscriptions
|
1017
|
+
data, status_code, headers = api_instance.export_subscriptions_with_http_info(app_id, opts)
|
1193
1018
|
p status_code # => 2xx
|
1194
1019
|
p headers # => { ... }
|
1195
|
-
p data # => <
|
1020
|
+
p data # => <ExportSubscriptionsSuccessResponse>
|
1196
1021
|
rescue OneSignal::ApiError => e
|
1197
|
-
puts "Error when calling DefaultApi->
|
1022
|
+
puts "Error when calling DefaultApi->export_subscriptions_with_http_info: #{e}"
|
1198
1023
|
end
|
1199
1024
|
```
|
1200
1025
|
|
@@ -1203,15 +1028,15 @@ end
|
|
1203
1028
|
| Name | Type | Description | Notes |
|
1204
1029
|
| ---- | ---- | ----------- | ----- |
|
1205
1030
|
| **app_id** | **String** | The app ID that you want to export devices from | |
|
1206
|
-
| **
|
1031
|
+
| **export_subscriptions_request_body** | [**ExportSubscriptionsRequestBody**](ExportSubscriptionsRequestBody.md) | | [optional] |
|
1207
1032
|
|
1208
1033
|
### Return type
|
1209
1034
|
|
1210
|
-
[**
|
1035
|
+
[**ExportSubscriptionsSuccessResponse**](ExportSubscriptionsSuccessResponse.md)
|
1211
1036
|
|
1212
1037
|
### Authorization
|
1213
1038
|
|
1214
|
-
[
|
1039
|
+
[rest_api_key](../README.md#rest_api_key)
|
1215
1040
|
|
1216
1041
|
### HTTP request headers
|
1217
1042
|
|
@@ -1219,13 +1044,13 @@ end
|
|
1219
1044
|
- **Accept**: application/json
|
1220
1045
|
|
1221
1046
|
|
1222
|
-
##
|
1047
|
+
## get_aliases
|
1223
1048
|
|
1224
|
-
> <
|
1049
|
+
> <UserIdentityBody> get_aliases(app_id, alias_label, alias_id)
|
1225
1050
|
|
1226
1051
|
|
1227
1052
|
|
1228
|
-
Lists all Aliases for the User identified by :
|
1053
|
+
Lists all Aliases for the User identified by (:alias_label, :alias_id).
|
1229
1054
|
|
1230
1055
|
### Examples
|
1231
1056
|
|
@@ -1233,41 +1058,40 @@ Lists all Aliases for the User identified by :subscription_id.
|
|
1233
1058
|
require 'onesignal'
|
1234
1059
|
# setup authorization
|
1235
1060
|
OneSignal.configure do |config|
|
1236
|
-
# Configure Bearer authorization:
|
1237
|
-
config.
|
1238
|
-
# Configure Bearer authorization: app_key
|
1239
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1061
|
+
# Configure Bearer authorization: rest_api_key
|
1062
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1240
1063
|
|
1241
1064
|
end
|
1242
1065
|
|
1243
1066
|
api_instance = OneSignal::DefaultApi.new
|
1244
1067
|
app_id = 'app_id_example' # String |
|
1245
|
-
|
1068
|
+
alias_label = 'alias_label_example' # String |
|
1069
|
+
alias_id = 'alias_id_example' # String |
|
1246
1070
|
|
1247
1071
|
begin
|
1248
1072
|
|
1249
|
-
result = api_instance.
|
1073
|
+
result = api_instance.get_aliases(app_id, alias_label, alias_id)
|
1250
1074
|
p result
|
1251
1075
|
rescue OneSignal::ApiError => e
|
1252
|
-
puts "Error when calling DefaultApi->
|
1076
|
+
puts "Error when calling DefaultApi->get_aliases: #{e}"
|
1253
1077
|
end
|
1254
1078
|
```
|
1255
1079
|
|
1256
|
-
#### Using the
|
1080
|
+
#### Using the get_aliases_with_http_info variant
|
1257
1081
|
|
1258
1082
|
This returns an Array which contains the response data, status code and headers.
|
1259
1083
|
|
1260
|
-
> <Array(<
|
1084
|
+
> <Array(<UserIdentityBody>, Integer, Hash)> get_aliases_with_http_info(app_id, alias_label, alias_id)
|
1261
1085
|
|
1262
1086
|
```ruby
|
1263
1087
|
begin
|
1264
1088
|
|
1265
|
-
data, status_code, headers = api_instance.
|
1089
|
+
data, status_code, headers = api_instance.get_aliases_with_http_info(app_id, alias_label, alias_id)
|
1266
1090
|
p status_code # => 2xx
|
1267
1091
|
p headers # => { ... }
|
1268
|
-
p data # => <
|
1092
|
+
p data # => <UserIdentityBody>
|
1269
1093
|
rescue OneSignal::ApiError => e
|
1270
|
-
puts "Error when calling DefaultApi->
|
1094
|
+
puts "Error when calling DefaultApi->get_aliases_with_http_info: #{e}"
|
1271
1095
|
end
|
1272
1096
|
```
|
1273
1097
|
|
@@ -1276,15 +1100,16 @@ end
|
|
1276
1100
|
| Name | Type | Description | Notes |
|
1277
1101
|
| ---- | ---- | ----------- | ----- |
|
1278
1102
|
| **app_id** | **String** | | |
|
1279
|
-
| **
|
1103
|
+
| **alias_label** | **String** | | |
|
1104
|
+
| **alias_id** | **String** | | |
|
1280
1105
|
|
1281
1106
|
### Return type
|
1282
1107
|
|
1283
|
-
[**
|
1108
|
+
[**UserIdentityBody**](UserIdentityBody.md)
|
1284
1109
|
|
1285
1110
|
### Authorization
|
1286
1111
|
|
1287
|
-
[
|
1112
|
+
[rest_api_key](../README.md#rest_api_key)
|
1288
1113
|
|
1289
1114
|
### HTTP request headers
|
1290
1115
|
|
@@ -1292,13 +1117,13 @@ end
|
|
1292
1117
|
- **Accept**: application/json
|
1293
1118
|
|
1294
1119
|
|
1295
|
-
##
|
1120
|
+
## get_aliases_by_subscription
|
1296
1121
|
|
1297
|
-
> <
|
1122
|
+
> <UserIdentityBody> get_aliases_by_subscription(app_id, subscription_id)
|
1298
1123
|
|
1299
1124
|
|
1300
1125
|
|
1301
|
-
|
1126
|
+
Lists all Aliases for the User identified by :subscription_id.
|
1302
1127
|
|
1303
1128
|
### Examples
|
1304
1129
|
|
@@ -1306,42 +1131,39 @@ Returns the User’s properties, Aliases, and Subscriptions.
|
|
1306
1131
|
require 'onesignal'
|
1307
1132
|
# setup authorization
|
1308
1133
|
OneSignal.configure do |config|
|
1309
|
-
# Configure Bearer authorization:
|
1310
|
-
config.
|
1311
|
-
# Configure Bearer authorization: app_key
|
1312
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1134
|
+
# Configure Bearer authorization: rest_api_key
|
1135
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1313
1136
|
|
1314
1137
|
end
|
1315
1138
|
|
1316
1139
|
api_instance = OneSignal::DefaultApi.new
|
1317
1140
|
app_id = 'app_id_example' # String |
|
1318
|
-
|
1319
|
-
alias_id = 'alias_id_example' # String |
|
1141
|
+
subscription_id = 'subscription_id_example' # String |
|
1320
1142
|
|
1321
1143
|
begin
|
1322
1144
|
|
1323
|
-
result = api_instance.
|
1145
|
+
result = api_instance.get_aliases_by_subscription(app_id, subscription_id)
|
1324
1146
|
p result
|
1325
1147
|
rescue OneSignal::ApiError => e
|
1326
|
-
puts "Error when calling DefaultApi->
|
1148
|
+
puts "Error when calling DefaultApi->get_aliases_by_subscription: #{e}"
|
1327
1149
|
end
|
1328
1150
|
```
|
1329
1151
|
|
1330
|
-
#### Using the
|
1152
|
+
#### Using the get_aliases_by_subscription_with_http_info variant
|
1331
1153
|
|
1332
1154
|
This returns an Array which contains the response data, status code and headers.
|
1333
1155
|
|
1334
|
-
> <Array(<
|
1156
|
+
> <Array(<UserIdentityBody>, Integer, Hash)> get_aliases_by_subscription_with_http_info(app_id, subscription_id)
|
1335
1157
|
|
1336
1158
|
```ruby
|
1337
1159
|
begin
|
1338
1160
|
|
1339
|
-
data, status_code, headers = api_instance.
|
1161
|
+
data, status_code, headers = api_instance.get_aliases_by_subscription_with_http_info(app_id, subscription_id)
|
1340
1162
|
p status_code # => 2xx
|
1341
1163
|
p headers # => { ... }
|
1342
|
-
p data # => <
|
1164
|
+
p data # => <UserIdentityBody>
|
1343
1165
|
rescue OneSignal::ApiError => e
|
1344
|
-
puts "Error when calling DefaultApi->
|
1166
|
+
puts "Error when calling DefaultApi->get_aliases_by_subscription_with_http_info: #{e}"
|
1345
1167
|
end
|
1346
1168
|
```
|
1347
1169
|
|
@@ -1350,16 +1172,15 @@ end
|
|
1350
1172
|
| Name | Type | Description | Notes |
|
1351
1173
|
| ---- | ---- | ----------- | ----- |
|
1352
1174
|
| **app_id** | **String** | | |
|
1353
|
-
| **
|
1354
|
-
| **alias_id** | **String** | | |
|
1175
|
+
| **subscription_id** | **String** | | |
|
1355
1176
|
|
1356
1177
|
### Return type
|
1357
1178
|
|
1358
|
-
[**
|
1179
|
+
[**UserIdentityBody**](UserIdentityBody.md)
|
1359
1180
|
|
1360
1181
|
### Authorization
|
1361
1182
|
|
1362
|
-
[
|
1183
|
+
[rest_api_key](../README.md#rest_api_key)
|
1363
1184
|
|
1364
1185
|
### HTTP request headers
|
1365
1186
|
|
@@ -1367,13 +1188,13 @@ end
|
|
1367
1188
|
- **Accept**: application/json
|
1368
1189
|
|
1369
1190
|
|
1370
|
-
##
|
1371
|
-
|
1372
|
-
> <InlineResponse200> fetch_user_identity(app_id, alias_label, alias_id)
|
1191
|
+
## get_app
|
1373
1192
|
|
1193
|
+
> <App> get_app(app_id)
|
1374
1194
|
|
1195
|
+
View an app
|
1375
1196
|
|
1376
|
-
|
1197
|
+
View the details of a single OneSignal app
|
1377
1198
|
|
1378
1199
|
### Examples
|
1379
1200
|
|
@@ -1381,90 +1202,13 @@ Lists all Aliases for the User identified by (:alias_label, :alias_id).
|
|
1381
1202
|
require 'onesignal'
|
1382
1203
|
# setup authorization
|
1383
1204
|
OneSignal.configure do |config|
|
1384
|
-
# Configure Bearer authorization:
|
1385
|
-
config.
|
1386
|
-
# Configure Bearer authorization: app_key
|
1387
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1205
|
+
# Configure Bearer authorization: organization_api_key
|
1206
|
+
config.organization_api_key = 'YOUR_BEARER_TOKEN'
|
1388
1207
|
|
1389
1208
|
end
|
1390
1209
|
|
1391
1210
|
api_instance = OneSignal::DefaultApi.new
|
1392
|
-
app_id = 'app_id_example' # String |
|
1393
|
-
alias_label = 'alias_label_example' # String |
|
1394
|
-
alias_id = 'alias_id_example' # String |
|
1395
|
-
|
1396
|
-
begin
|
1397
|
-
|
1398
|
-
result = api_instance.fetch_user_identity(app_id, alias_label, alias_id)
|
1399
|
-
p result
|
1400
|
-
rescue OneSignal::ApiError => e
|
1401
|
-
puts "Error when calling DefaultApi->fetch_user_identity: #{e}"
|
1402
|
-
end
|
1403
|
-
```
|
1404
|
-
|
1405
|
-
#### Using the fetch_user_identity_with_http_info variant
|
1406
|
-
|
1407
|
-
This returns an Array which contains the response data, status code and headers.
|
1408
|
-
|
1409
|
-
> <Array(<InlineResponse200>, Integer, Hash)> fetch_user_identity_with_http_info(app_id, alias_label, alias_id)
|
1410
|
-
|
1411
|
-
```ruby
|
1412
|
-
begin
|
1413
|
-
|
1414
|
-
data, status_code, headers = api_instance.fetch_user_identity_with_http_info(app_id, alias_label, alias_id)
|
1415
|
-
p status_code # => 2xx
|
1416
|
-
p headers # => { ... }
|
1417
|
-
p data # => <InlineResponse200>
|
1418
|
-
rescue OneSignal::ApiError => e
|
1419
|
-
puts "Error when calling DefaultApi->fetch_user_identity_with_http_info: #{e}"
|
1420
|
-
end
|
1421
|
-
```
|
1422
|
-
|
1423
|
-
### Parameters
|
1424
|
-
|
1425
|
-
| Name | Type | Description | Notes |
|
1426
|
-
| ---- | ---- | ----------- | ----- |
|
1427
|
-
| **app_id** | **String** | | |
|
1428
|
-
| **alias_label** | **String** | | |
|
1429
|
-
| **alias_id** | **String** | | |
|
1430
|
-
|
1431
|
-
### Return type
|
1432
|
-
|
1433
|
-
[**InlineResponse200**](InlineResponse200.md)
|
1434
|
-
|
1435
|
-
### Authorization
|
1436
|
-
|
1437
|
-
[app_key](../README.md#app_key)
|
1438
|
-
|
1439
|
-
### HTTP request headers
|
1440
|
-
|
1441
|
-
- **Content-Type**: Not defined
|
1442
|
-
- **Accept**: application/json
|
1443
|
-
|
1444
|
-
|
1445
|
-
## get_app
|
1446
|
-
|
1447
|
-
> <App> get_app(app_id)
|
1448
|
-
|
1449
|
-
View an app
|
1450
|
-
|
1451
|
-
View the details of a single OneSignal app
|
1452
|
-
|
1453
|
-
### Examples
|
1454
|
-
|
1455
|
-
```ruby
|
1456
|
-
require 'onesignal'
|
1457
|
-
# setup authorization
|
1458
|
-
OneSignal.configure do |config|
|
1459
|
-
# Configure Bearer authorization: user_key
|
1460
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1461
|
-
# Configure Bearer authorization: user_key
|
1462
|
-
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1463
|
-
|
1464
|
-
end
|
1465
|
-
|
1466
|
-
api_instance = OneSignal::DefaultApi.new
|
1467
|
-
app_id = 'app_id_example' # String | An app id
|
1211
|
+
app_id = 'app_id_example' # String | An app id
|
1468
1212
|
|
1469
1213
|
begin
|
1470
1214
|
# View an app
|
@@ -1505,7 +1249,7 @@ end
|
|
1505
1249
|
|
1506
1250
|
### Authorization
|
1507
1251
|
|
1508
|
-
[
|
1252
|
+
[organization_api_key](../README.md#organization_api_key)
|
1509
1253
|
|
1510
1254
|
### HTTP request headers
|
1511
1255
|
|
@@ -1527,10 +1271,8 @@ View the details of all of your current OneSignal apps
|
|
1527
1271
|
require 'onesignal'
|
1528
1272
|
# setup authorization
|
1529
1273
|
OneSignal.configure do |config|
|
1530
|
-
# Configure Bearer authorization:
|
1531
|
-
config.
|
1532
|
-
# Configure Bearer authorization: user_key
|
1533
|
-
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1274
|
+
# Configure Bearer authorization: organization_api_key
|
1275
|
+
config.organization_api_key = 'YOUR_BEARER_TOKEN'
|
1534
1276
|
|
1535
1277
|
end
|
1536
1278
|
|
@@ -1573,80 +1315,7 @@ This endpoint does not need any parameter.
|
|
1573
1315
|
|
1574
1316
|
### Authorization
|
1575
1317
|
|
1576
|
-
[
|
1577
|
-
|
1578
|
-
### HTTP request headers
|
1579
|
-
|
1580
|
-
- **Content-Type**: Not defined
|
1581
|
-
- **Accept**: application/json
|
1582
|
-
|
1583
|
-
|
1584
|
-
## get_eligible_iams
|
1585
|
-
|
1586
|
-
> <InlineResponse2003> get_eligible_iams(app_id, subscription_id)
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
Manifest of In-App Messages the Subscription is eligible to display by the SDK.
|
1591
|
-
|
1592
|
-
### Examples
|
1593
|
-
|
1594
|
-
```ruby
|
1595
|
-
require 'onesignal'
|
1596
|
-
# setup authorization
|
1597
|
-
OneSignal.configure do |config|
|
1598
|
-
# Configure Bearer authorization: user_key
|
1599
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
1600
|
-
# Configure Bearer authorization: app_key
|
1601
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1602
|
-
|
1603
|
-
end
|
1604
|
-
|
1605
|
-
api_instance = OneSignal::DefaultApi.new
|
1606
|
-
app_id = 'app_id_example' # String |
|
1607
|
-
subscription_id = 'subscription_id_example' # String |
|
1608
|
-
|
1609
|
-
begin
|
1610
|
-
|
1611
|
-
result = api_instance.get_eligible_iams(app_id, subscription_id)
|
1612
|
-
p result
|
1613
|
-
rescue OneSignal::ApiError => e
|
1614
|
-
puts "Error when calling DefaultApi->get_eligible_iams: #{e}"
|
1615
|
-
end
|
1616
|
-
```
|
1617
|
-
|
1618
|
-
#### Using the get_eligible_iams_with_http_info variant
|
1619
|
-
|
1620
|
-
This returns an Array which contains the response data, status code and headers.
|
1621
|
-
|
1622
|
-
> <Array(<InlineResponse2003>, Integer, Hash)> get_eligible_iams_with_http_info(app_id, subscription_id)
|
1623
|
-
|
1624
|
-
```ruby
|
1625
|
-
begin
|
1626
|
-
|
1627
|
-
data, status_code, headers = api_instance.get_eligible_iams_with_http_info(app_id, subscription_id)
|
1628
|
-
p status_code # => 2xx
|
1629
|
-
p headers # => { ... }
|
1630
|
-
p data # => <InlineResponse2003>
|
1631
|
-
rescue OneSignal::ApiError => e
|
1632
|
-
puts "Error when calling DefaultApi->get_eligible_iams_with_http_info: #{e}"
|
1633
|
-
end
|
1634
|
-
```
|
1635
|
-
|
1636
|
-
### Parameters
|
1637
|
-
|
1638
|
-
| Name | Type | Description | Notes |
|
1639
|
-
| ---- | ---- | ----------- | ----- |
|
1640
|
-
| **app_id** | **String** | | |
|
1641
|
-
| **subscription_id** | **String** | | |
|
1642
|
-
|
1643
|
-
### Return type
|
1644
|
-
|
1645
|
-
[**InlineResponse2003**](InlineResponse2003.md)
|
1646
|
-
|
1647
|
-
### Authorization
|
1648
|
-
|
1649
|
-
[app_key](../README.md#app_key)
|
1318
|
+
[organization_api_key](../README.md#organization_api_key)
|
1650
1319
|
|
1651
1320
|
### HTTP request headers
|
1652
1321
|
|
@@ -1668,10 +1337,8 @@ View the details of a single notification and outcomes associated with it
|
|
1668
1337
|
require 'onesignal'
|
1669
1338
|
# setup authorization
|
1670
1339
|
OneSignal.configure do |config|
|
1671
|
-
# Configure Bearer authorization:
|
1672
|
-
config.
|
1673
|
-
# Configure Bearer authorization: app_key
|
1674
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1340
|
+
# Configure Bearer authorization: rest_api_key
|
1341
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1675
1342
|
|
1676
1343
|
end
|
1677
1344
|
|
@@ -1719,7 +1386,7 @@ end
|
|
1719
1386
|
|
1720
1387
|
### Authorization
|
1721
1388
|
|
1722
|
-
[
|
1389
|
+
[rest_api_key](../README.md#rest_api_key)
|
1723
1390
|
|
1724
1391
|
### HTTP request headers
|
1725
1392
|
|
@@ -1729,7 +1396,7 @@ end
|
|
1729
1396
|
|
1730
1397
|
## get_notification_history
|
1731
1398
|
|
1732
|
-
> <NotificationHistorySuccessResponse> get_notification_history(notification_id,
|
1399
|
+
> <NotificationHistorySuccessResponse> get_notification_history(notification_id, get_notification_history_request_body)
|
1733
1400
|
|
1734
1401
|
Notification History
|
1735
1402
|
|
@@ -1741,20 +1408,18 @@ Notification History
|
|
1741
1408
|
require 'onesignal'
|
1742
1409
|
# setup authorization
|
1743
1410
|
OneSignal.configure do |config|
|
1744
|
-
# Configure Bearer authorization:
|
1745
|
-
config.
|
1746
|
-
# Configure Bearer authorization: app_key
|
1747
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1411
|
+
# Configure Bearer authorization: rest_api_key
|
1412
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1748
1413
|
|
1749
1414
|
end
|
1750
1415
|
|
1751
1416
|
api_instance = OneSignal::DefaultApi.new
|
1752
1417
|
notification_id = 'notification_id_example' # String | The \"id\" of the message found in the Notification object
|
1753
|
-
|
1418
|
+
get_notification_history_request_body = OneSignal::GetNotificationHistoryRequestBody.new # GetNotificationHistoryRequestBody |
|
1754
1419
|
|
1755
1420
|
begin
|
1756
1421
|
# Notification History
|
1757
|
-
result = api_instance.get_notification_history(notification_id,
|
1422
|
+
result = api_instance.get_notification_history(notification_id, get_notification_history_request_body)
|
1758
1423
|
p result
|
1759
1424
|
rescue OneSignal::ApiError => e
|
1760
1425
|
puts "Error when calling DefaultApi->get_notification_history: #{e}"
|
@@ -1765,12 +1430,12 @@ end
|
|
1765
1430
|
|
1766
1431
|
This returns an Array which contains the response data, status code and headers.
|
1767
1432
|
|
1768
|
-
> <Array(<NotificationHistorySuccessResponse>, Integer, Hash)> get_notification_history_with_http_info(notification_id,
|
1433
|
+
> <Array(<NotificationHistorySuccessResponse>, Integer, Hash)> get_notification_history_with_http_info(notification_id, get_notification_history_request_body)
|
1769
1434
|
|
1770
1435
|
```ruby
|
1771
1436
|
begin
|
1772
1437
|
# Notification History
|
1773
|
-
data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id,
|
1438
|
+
data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id, get_notification_history_request_body)
|
1774
1439
|
p status_code # => 2xx
|
1775
1440
|
p headers # => { ... }
|
1776
1441
|
p data # => <NotificationHistorySuccessResponse>
|
@@ -1784,7 +1449,7 @@ end
|
|
1784
1449
|
| Name | Type | Description | Notes |
|
1785
1450
|
| ---- | ---- | ----------- | ----- |
|
1786
1451
|
| **notification_id** | **String** | The \"id\" of the message found in the Notification object | |
|
1787
|
-
| **
|
1452
|
+
| **get_notification_history_request_body** | [**GetNotificationHistoryRequestBody**](GetNotificationHistoryRequestBody.md) | | |
|
1788
1453
|
|
1789
1454
|
### Return type
|
1790
1455
|
|
@@ -1792,7 +1457,7 @@ end
|
|
1792
1457
|
|
1793
1458
|
### Authorization
|
1794
1459
|
|
1795
|
-
[
|
1460
|
+
[rest_api_key](../README.md#rest_api_key)
|
1796
1461
|
|
1797
1462
|
### HTTP request headers
|
1798
1463
|
|
@@ -1814,10 +1479,8 @@ View the details of multiple notifications
|
|
1814
1479
|
require 'onesignal'
|
1815
1480
|
# setup authorization
|
1816
1481
|
OneSignal.configure do |config|
|
1817
|
-
# Configure Bearer authorization:
|
1818
|
-
config.
|
1819
|
-
# Configure Bearer authorization: app_key
|
1820
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1482
|
+
# Configure Bearer authorization: rest_api_key
|
1483
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1821
1484
|
|
1822
1485
|
end
|
1823
1486
|
|
@@ -1871,7 +1534,7 @@ end
|
|
1871
1534
|
|
1872
1535
|
### Authorization
|
1873
1536
|
|
1874
|
-
[
|
1537
|
+
[rest_api_key](../README.md#rest_api_key)
|
1875
1538
|
|
1876
1539
|
### HTTP request headers
|
1877
1540
|
|
@@ -1893,10 +1556,8 @@ View the details of all the outcomes associated with your app 🚧 Require
|
|
1893
1556
|
require 'onesignal'
|
1894
1557
|
# setup authorization
|
1895
1558
|
OneSignal.configure do |config|
|
1896
|
-
# Configure Bearer authorization:
|
1897
|
-
config.
|
1898
|
-
# Configure Bearer authorization: app_key
|
1899
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1559
|
+
# Configure Bearer authorization: rest_api_key
|
1560
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1900
1561
|
|
1901
1562
|
end
|
1902
1563
|
|
@@ -1954,7 +1615,7 @@ end
|
|
1954
1615
|
|
1955
1616
|
### Authorization
|
1956
1617
|
|
1957
|
-
[
|
1618
|
+
[rest_api_key](../README.md#rest_api_key)
|
1958
1619
|
|
1959
1620
|
### HTTP request headers
|
1960
1621
|
|
@@ -1962,13 +1623,13 @@ end
|
|
1962
1623
|
- **Accept**: application/json
|
1963
1624
|
|
1964
1625
|
|
1965
|
-
##
|
1626
|
+
## get_segments
|
1966
1627
|
|
1967
|
-
> <
|
1628
|
+
> <GetSegmentsSuccessResponse> get_segments(app_id, opts)
|
1968
1629
|
|
1969
|
-
|
1630
|
+
Get Segments
|
1970
1631
|
|
1971
|
-
|
1632
|
+
Returns an array of segments from an app.
|
1972
1633
|
|
1973
1634
|
### Examples
|
1974
1635
|
|
@@ -1976,121 +1637,42 @@ View the details of an existing device in one of your OneSignal apps
|
|
1976
1637
|
require 'onesignal'
|
1977
1638
|
# setup authorization
|
1978
1639
|
OneSignal.configure do |config|
|
1979
|
-
# Configure Bearer authorization:
|
1980
|
-
config.
|
1981
|
-
# Configure Bearer authorization: app_key
|
1982
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1640
|
+
# Configure Bearer authorization: rest_api_key
|
1641
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
1983
1642
|
|
1984
1643
|
end
|
1985
1644
|
|
1986
1645
|
api_instance = OneSignal::DefaultApi.new
|
1987
|
-
app_id = 'app_id_example' # String |
|
1988
|
-
player_id = 'player_id_example' # String | Player's OneSignal ID
|
1989
|
-
opts = {
|
1990
|
-
email_auth_hash: 'email_auth_hash_example' # String | Email - Only required if you have enabled Identity Verification and device_type is email (11).
|
1991
|
-
}
|
1992
|
-
|
1993
|
-
begin
|
1994
|
-
# View device
|
1995
|
-
result = api_instance.get_player(app_id, player_id, opts)
|
1996
|
-
p result
|
1997
|
-
rescue OneSignal::ApiError => e
|
1998
|
-
puts "Error when calling DefaultApi->get_player: #{e}"
|
1999
|
-
end
|
2000
|
-
```
|
2001
|
-
|
2002
|
-
#### Using the get_player_with_http_info variant
|
2003
|
-
|
2004
|
-
This returns an Array which contains the response data, status code and headers.
|
2005
|
-
|
2006
|
-
> <Array(<Player>, Integer, Hash)> get_player_with_http_info(app_id, player_id, opts)
|
2007
|
-
|
2008
|
-
```ruby
|
2009
|
-
begin
|
2010
|
-
# View device
|
2011
|
-
data, status_code, headers = api_instance.get_player_with_http_info(app_id, player_id, opts)
|
2012
|
-
p status_code # => 2xx
|
2013
|
-
p headers # => { ... }
|
2014
|
-
p data # => <Player>
|
2015
|
-
rescue OneSignal::ApiError => e
|
2016
|
-
puts "Error when calling DefaultApi->get_player_with_http_info: #{e}"
|
2017
|
-
end
|
2018
|
-
```
|
2019
|
-
|
2020
|
-
### Parameters
|
2021
|
-
|
2022
|
-
| Name | Type | Description | Notes |
|
2023
|
-
| ---- | ---- | ----------- | ----- |
|
2024
|
-
| **app_id** | **String** | Your app_id for this device | |
|
2025
|
-
| **player_id** | **String** | Player's OneSignal ID | |
|
2026
|
-
| **email_auth_hash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] |
|
2027
|
-
|
2028
|
-
### Return type
|
2029
|
-
|
2030
|
-
[**Player**](Player.md)
|
2031
|
-
|
2032
|
-
### Authorization
|
2033
|
-
|
2034
|
-
[app_key](../README.md#app_key)
|
2035
|
-
|
2036
|
-
### HTTP request headers
|
2037
|
-
|
2038
|
-
- **Content-Type**: Not defined
|
2039
|
-
- **Accept**: application/json
|
2040
|
-
|
2041
|
-
|
2042
|
-
## get_players
|
2043
|
-
|
2044
|
-
> <PlayerSlice> get_players(app_id, opts)
|
2045
|
-
|
2046
|
-
View devices
|
2047
|
-
|
2048
|
-
View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant.
|
2049
|
-
|
2050
|
-
### Examples
|
2051
|
-
|
2052
|
-
```ruby
|
2053
|
-
require 'onesignal'
|
2054
|
-
# setup authorization
|
2055
|
-
OneSignal.configure do |config|
|
2056
|
-
# Configure Bearer authorization: user_key
|
2057
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2058
|
-
# Configure Bearer authorization: app_key
|
2059
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2060
|
-
|
2061
|
-
end
|
2062
|
-
|
2063
|
-
api_instance = OneSignal::DefaultApi.new
|
2064
|
-
app_id = 'app_id_example' # String | The app ID that you want to view players from
|
1646
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
2065
1647
|
opts = {
|
2066
|
-
|
2067
|
-
|
1648
|
+
offset: 56, # Integer | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments.
|
1649
|
+
limit: 56 # Integer | The amount of Segments in the response. Maximum 300.
|
2068
1650
|
}
|
2069
1651
|
|
2070
1652
|
begin
|
2071
|
-
#
|
2072
|
-
result = api_instance.
|
1653
|
+
# Get Segments
|
1654
|
+
result = api_instance.get_segments(app_id, opts)
|
2073
1655
|
p result
|
2074
1656
|
rescue OneSignal::ApiError => e
|
2075
|
-
puts "Error when calling DefaultApi->
|
1657
|
+
puts "Error when calling DefaultApi->get_segments: #{e}"
|
2076
1658
|
end
|
2077
1659
|
```
|
2078
1660
|
|
2079
|
-
#### Using the
|
1661
|
+
#### Using the get_segments_with_http_info variant
|
2080
1662
|
|
2081
1663
|
This returns an Array which contains the response data, status code and headers.
|
2082
1664
|
|
2083
|
-
> <Array(<
|
1665
|
+
> <Array(<GetSegmentsSuccessResponse>, Integer, Hash)> get_segments_with_http_info(app_id, opts)
|
2084
1666
|
|
2085
1667
|
```ruby
|
2086
1668
|
begin
|
2087
|
-
#
|
2088
|
-
data, status_code, headers = api_instance.
|
1669
|
+
# Get Segments
|
1670
|
+
data, status_code, headers = api_instance.get_segments_with_http_info(app_id, opts)
|
2089
1671
|
p status_code # => 2xx
|
2090
1672
|
p headers # => { ... }
|
2091
|
-
p data # => <
|
1673
|
+
p data # => <GetSegmentsSuccessResponse>
|
2092
1674
|
rescue OneSignal::ApiError => e
|
2093
|
-
puts "Error when calling DefaultApi->
|
1675
|
+
puts "Error when calling DefaultApi->get_segments_with_http_info: #{e}"
|
2094
1676
|
end
|
2095
1677
|
```
|
2096
1678
|
|
@@ -2098,17 +1680,17 @@ end
|
|
2098
1680
|
|
2099
1681
|
| Name | Type | Description | Notes |
|
2100
1682
|
| ---- | ---- | ----------- | ----- |
|
2101
|
-
| **app_id** | **String** | The
|
2102
|
-
| **
|
2103
|
-
| **
|
1683
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
1684
|
+
| **offset** | **Integer** | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. | [optional] |
|
1685
|
+
| **limit** | **Integer** | The amount of Segments in the response. Maximum 300. | [optional] |
|
2104
1686
|
|
2105
1687
|
### Return type
|
2106
1688
|
|
2107
|
-
[**
|
1689
|
+
[**GetSegmentsSuccessResponse**](GetSegmentsSuccessResponse.md)
|
2108
1690
|
|
2109
1691
|
### Authorization
|
2110
1692
|
|
2111
|
-
[
|
1693
|
+
[rest_api_key](../README.md#rest_api_key)
|
2112
1694
|
|
2113
1695
|
### HTTP request headers
|
2114
1696
|
|
@@ -2116,13 +1698,13 @@ end
|
|
2116
1698
|
- **Accept**: application/json
|
2117
1699
|
|
2118
1700
|
|
2119
|
-
##
|
1701
|
+
## get_user
|
2120
1702
|
|
2121
|
-
> <
|
1703
|
+
> <User> get_user(app_id, alias_label, alias_id)
|
2122
1704
|
|
2123
1705
|
|
2124
1706
|
|
2125
|
-
|
1707
|
+
Returns the User’s properties, Aliases, and Subscriptions.
|
2126
1708
|
|
2127
1709
|
### Examples
|
2128
1710
|
|
@@ -2130,10 +1712,8 @@ Upserts one or more Aliases to an existing User identified by (:alias_label, :al
|
|
2130
1712
|
require 'onesignal'
|
2131
1713
|
# setup authorization
|
2132
1714
|
OneSignal.configure do |config|
|
2133
|
-
# Configure Bearer authorization:
|
2134
|
-
config.
|
2135
|
-
# Configure Bearer authorization: app_key
|
2136
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1715
|
+
# Configure Bearer authorization: rest_api_key
|
1716
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
2137
1717
|
|
2138
1718
|
end
|
2139
1719
|
|
@@ -2141,32 +1721,31 @@ api_instance = OneSignal::DefaultApi.new
|
|
2141
1721
|
app_id = 'app_id_example' # String |
|
2142
1722
|
alias_label = 'alias_label_example' # String |
|
2143
1723
|
alias_id = 'alias_id_example' # String |
|
2144
|
-
user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody |
|
2145
1724
|
|
2146
1725
|
begin
|
2147
1726
|
|
2148
|
-
result = api_instance.
|
1727
|
+
result = api_instance.get_user(app_id, alias_label, alias_id)
|
2149
1728
|
p result
|
2150
1729
|
rescue OneSignal::ApiError => e
|
2151
|
-
puts "Error when calling DefaultApi->
|
1730
|
+
puts "Error when calling DefaultApi->get_user: #{e}"
|
2152
1731
|
end
|
2153
1732
|
```
|
2154
1733
|
|
2155
|
-
#### Using the
|
1734
|
+
#### Using the get_user_with_http_info variant
|
2156
1735
|
|
2157
1736
|
This returns an Array which contains the response data, status code and headers.
|
2158
1737
|
|
2159
|
-
> <Array(<
|
1738
|
+
> <Array(<User>, Integer, Hash)> get_user_with_http_info(app_id, alias_label, alias_id)
|
2160
1739
|
|
2161
1740
|
```ruby
|
2162
1741
|
begin
|
2163
1742
|
|
2164
|
-
data, status_code, headers = api_instance.
|
1743
|
+
data, status_code, headers = api_instance.get_user_with_http_info(app_id, alias_label, alias_id)
|
2165
1744
|
p status_code # => 2xx
|
2166
1745
|
p headers # => { ... }
|
2167
|
-
p data # => <
|
1746
|
+
p data # => <User>
|
2168
1747
|
rescue OneSignal::ApiError => e
|
2169
|
-
puts "Error when calling DefaultApi->
|
1748
|
+
puts "Error when calling DefaultApi->get_user_with_http_info: #{e}"
|
2170
1749
|
end
|
2171
1750
|
```
|
2172
1751
|
|
@@ -2177,29 +1756,28 @@ end
|
|
2177
1756
|
| **app_id** | **String** | | |
|
2178
1757
|
| **alias_label** | **String** | | |
|
2179
1758
|
| **alias_id** | **String** | | |
|
2180
|
-
| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | |
|
2181
1759
|
|
2182
1760
|
### Return type
|
2183
1761
|
|
2184
|
-
[**
|
1762
|
+
[**User**](User.md)
|
2185
1763
|
|
2186
1764
|
### Authorization
|
2187
1765
|
|
2188
|
-
[
|
1766
|
+
[rest_api_key](../README.md#rest_api_key)
|
2189
1767
|
|
2190
1768
|
### HTTP request headers
|
2191
1769
|
|
2192
|
-
- **Content-Type**:
|
1770
|
+
- **Content-Type**: Not defined
|
2193
1771
|
- **Accept**: application/json
|
2194
1772
|
|
2195
1773
|
|
2196
|
-
##
|
1774
|
+
## transfer_subscription
|
2197
1775
|
|
2198
|
-
> <
|
1776
|
+
> <UserIdentityBody> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
|
2199
1777
|
|
2200
1778
|
|
2201
1779
|
|
2202
|
-
|
1780
|
+
Transfers this Subscription to the User identified by the identity in the payload.
|
2203
1781
|
|
2204
1782
|
### Examples
|
2205
1783
|
|
@@ -2207,42 +1785,40 @@ Upserts one or more Aliases for the User identified by :subscription_id.
|
|
2207
1785
|
require 'onesignal'
|
2208
1786
|
# setup authorization
|
2209
1787
|
OneSignal.configure do |config|
|
2210
|
-
# Configure Bearer authorization:
|
2211
|
-
config.
|
2212
|
-
# Configure Bearer authorization: app_key
|
2213
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1788
|
+
# Configure Bearer authorization: rest_api_key
|
1789
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
2214
1790
|
|
2215
1791
|
end
|
2216
1792
|
|
2217
1793
|
api_instance = OneSignal::DefaultApi.new
|
2218
1794
|
app_id = 'app_id_example' # String |
|
2219
1795
|
subscription_id = 'subscription_id_example' # String |
|
2220
|
-
|
1796
|
+
transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody |
|
2221
1797
|
|
2222
1798
|
begin
|
2223
1799
|
|
2224
|
-
result = api_instance.
|
1800
|
+
result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
|
2225
1801
|
p result
|
2226
1802
|
rescue OneSignal::ApiError => e
|
2227
|
-
puts "Error when calling DefaultApi->
|
1803
|
+
puts "Error when calling DefaultApi->transfer_subscription: #{e}"
|
2228
1804
|
end
|
2229
1805
|
```
|
2230
1806
|
|
2231
|
-
#### Using the
|
1807
|
+
#### Using the transfer_subscription_with_http_info variant
|
2232
1808
|
|
2233
1809
|
This returns an Array which contains the response data, status code and headers.
|
2234
1810
|
|
2235
|
-
> <Array(<
|
1811
|
+
> <Array(<UserIdentityBody>, Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
|
2236
1812
|
|
2237
1813
|
```ruby
|
2238
1814
|
begin
|
2239
1815
|
|
2240
|
-
data, status_code, headers = api_instance.
|
1816
|
+
data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
|
2241
1817
|
p status_code # => 2xx
|
2242
1818
|
p headers # => { ... }
|
2243
|
-
p data # => <
|
1819
|
+
p data # => <UserIdentityBody>
|
2244
1820
|
rescue OneSignal::ApiError => e
|
2245
|
-
puts "Error when calling DefaultApi->
|
1821
|
+
puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}"
|
2246
1822
|
end
|
2247
1823
|
```
|
2248
1824
|
|
@@ -2252,15 +1828,15 @@ end
|
|
2252
1828
|
| ---- | ---- | ----------- | ----- |
|
2253
1829
|
| **app_id** | **String** | | |
|
2254
1830
|
| **subscription_id** | **String** | | |
|
2255
|
-
| **
|
1831
|
+
| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | |
|
2256
1832
|
|
2257
1833
|
### Return type
|
2258
1834
|
|
2259
|
-
[**
|
1835
|
+
[**UserIdentityBody**](UserIdentityBody.md)
|
2260
1836
|
|
2261
1837
|
### Authorization
|
2262
1838
|
|
2263
|
-
[
|
1839
|
+
[rest_api_key](../README.md#rest_api_key)
|
2264
1840
|
|
2265
1841
|
### HTTP request headers
|
2266
1842
|
|
@@ -2268,13 +1844,13 @@ end
|
|
2268
1844
|
- **Accept**: application/json
|
2269
1845
|
|
2270
1846
|
|
2271
|
-
##
|
1847
|
+
## unsubscribe_email_with_token
|
2272
1848
|
|
2273
|
-
> <
|
1849
|
+
> <GenericSuccessBoolResponse> unsubscribe_email_with_token(app_id, notification_id, token)
|
2274
1850
|
|
1851
|
+
Unsubscribe with token
|
2275
1852
|
|
2276
|
-
|
2277
|
-
Transfers this Subscription to the User identified by the identity in the payload.
|
1853
|
+
Unsubscribe an email with a token when using your own custom email unsubscribe landing page
|
2278
1854
|
|
2279
1855
|
### Examples
|
2280
1856
|
|
@@ -2282,42 +1858,40 @@ Transfers this Subscription to the User identified by the identity in the payloa
|
|
2282
1858
|
require 'onesignal'
|
2283
1859
|
# setup authorization
|
2284
1860
|
OneSignal.configure do |config|
|
2285
|
-
# Configure Bearer authorization:
|
2286
|
-
config.
|
2287
|
-
# Configure Bearer authorization: app_key
|
2288
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1861
|
+
# Configure Bearer authorization: rest_api_key
|
1862
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
2289
1863
|
|
2290
1864
|
end
|
2291
1865
|
|
2292
1866
|
api_instance = OneSignal::DefaultApi.new
|
2293
|
-
app_id = 'app_id_example' # String |
|
2294
|
-
|
2295
|
-
|
1867
|
+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
1868
|
+
notification_id = 'notification_id_example' # String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
|
1869
|
+
token = 'token_example' # String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
|
2296
1870
|
|
2297
1871
|
begin
|
2298
|
-
|
2299
|
-
result = api_instance.
|
1872
|
+
# Unsubscribe with token
|
1873
|
+
result = api_instance.unsubscribe_email_with_token(app_id, notification_id, token)
|
2300
1874
|
p result
|
2301
1875
|
rescue OneSignal::ApiError => e
|
2302
|
-
puts "Error when calling DefaultApi->
|
1876
|
+
puts "Error when calling DefaultApi->unsubscribe_email_with_token: #{e}"
|
2303
1877
|
end
|
2304
1878
|
```
|
2305
1879
|
|
2306
|
-
#### Using the
|
1880
|
+
#### Using the unsubscribe_email_with_token_with_http_info variant
|
2307
1881
|
|
2308
1882
|
This returns an Array which contains the response data, status code and headers.
|
2309
1883
|
|
2310
|
-
> <Array(<
|
1884
|
+
> <Array(<GenericSuccessBoolResponse>, Integer, Hash)> unsubscribe_email_with_token_with_http_info(app_id, notification_id, token)
|
2311
1885
|
|
2312
1886
|
```ruby
|
2313
1887
|
begin
|
2314
|
-
|
2315
|
-
data, status_code, headers = api_instance.
|
1888
|
+
# Unsubscribe with token
|
1889
|
+
data, status_code, headers = api_instance.unsubscribe_email_with_token_with_http_info(app_id, notification_id, token)
|
2316
1890
|
p status_code # => 2xx
|
2317
1891
|
p headers # => { ... }
|
2318
|
-
p data # => <
|
1892
|
+
p data # => <GenericSuccessBoolResponse>
|
2319
1893
|
rescue OneSignal::ApiError => e
|
2320
|
-
puts "Error when calling DefaultApi->
|
1894
|
+
puts "Error when calling DefaultApi->unsubscribe_email_with_token_with_http_info: #{e}"
|
2321
1895
|
end
|
2322
1896
|
```
|
2323
1897
|
|
@@ -2325,21 +1899,21 @@ end
|
|
2325
1899
|
|
2326
1900
|
| Name | Type | Description | Notes |
|
2327
1901
|
| ---- | ---- | ----------- | ----- |
|
2328
|
-
| **app_id** | **String** | | |
|
2329
|
-
| **
|
2330
|
-
| **
|
1902
|
+
| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | |
|
1903
|
+
| **notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | |
|
1904
|
+
| **token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | |
|
2331
1905
|
|
2332
1906
|
### Return type
|
2333
1907
|
|
2334
|
-
[**
|
1908
|
+
[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
|
2335
1909
|
|
2336
1910
|
### Authorization
|
2337
1911
|
|
2338
|
-
[
|
1912
|
+
[rest_api_key](../README.md#rest_api_key)
|
2339
1913
|
|
2340
1914
|
### HTTP request headers
|
2341
1915
|
|
2342
|
-
- **Content-Type**:
|
1916
|
+
- **Content-Type**: Not defined
|
2343
1917
|
- **Accept**: application/json
|
2344
1918
|
|
2345
1919
|
|
@@ -2357,10 +1931,8 @@ Updates the name or configuration settings of an existing OneSignal app
|
|
2357
1931
|
require 'onesignal'
|
2358
1932
|
# setup authorization
|
2359
1933
|
OneSignal.configure do |config|
|
2360
|
-
# Configure Bearer authorization:
|
2361
|
-
config.
|
2362
|
-
# Configure Bearer authorization: user_key
|
2363
|
-
config.user_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
1934
|
+
# Configure Bearer authorization: organization_api_key
|
1935
|
+
config.organization_api_key = 'YOUR_BEARER_TOKEN'
|
2364
1936
|
|
2365
1937
|
end
|
2366
1938
|
|
@@ -2408,7 +1980,7 @@ end
|
|
2408
1980
|
|
2409
1981
|
### Authorization
|
2410
1982
|
|
2411
|
-
[
|
1983
|
+
[organization_api_key](../README.md#organization_api_key)
|
2412
1984
|
|
2413
1985
|
### HTTP request headers
|
2414
1986
|
|
@@ -2430,17 +2002,15 @@ Updates a specified live activity.
|
|
2430
2002
|
require 'onesignal'
|
2431
2003
|
# setup authorization
|
2432
2004
|
OneSignal.configure do |config|
|
2433
|
-
# Configure Bearer authorization:
|
2434
|
-
config.
|
2435
|
-
# Configure Bearer authorization: app_key
|
2436
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2005
|
+
# Configure Bearer authorization: rest_api_key
|
2006
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
2437
2007
|
|
2438
2008
|
end
|
2439
2009
|
|
2440
2010
|
api_instance = OneSignal::DefaultApi.new
|
2441
2011
|
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
|
2442
2012
|
activity_id = 'activity_id_example' # String | Live Activity record ID
|
2443
|
-
update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: '
|
2013
|
+
update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'name_example', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest |
|
2444
2014
|
|
2445
2015
|
begin
|
2446
2016
|
# Update a Live Activity via Push
|
@@ -2483,157 +2053,7 @@ end
|
|
2483
2053
|
|
2484
2054
|
### Authorization
|
2485
2055
|
|
2486
|
-
[
|
2487
|
-
|
2488
|
-
### HTTP request headers
|
2489
|
-
|
2490
|
-
- **Content-Type**: application/json
|
2491
|
-
- **Accept**: application/json
|
2492
|
-
|
2493
|
-
|
2494
|
-
## update_player
|
2495
|
-
|
2496
|
-
> <UpdatePlayerSuccessResponse> update_player(player_id, player)
|
2497
|
-
|
2498
|
-
Edit device
|
2499
|
-
|
2500
|
-
Update an existing device in one of your OneSignal apps
|
2501
|
-
|
2502
|
-
### Examples
|
2503
|
-
|
2504
|
-
```ruby
|
2505
|
-
require 'onesignal'
|
2506
|
-
# setup authorization
|
2507
|
-
OneSignal.configure do |config|
|
2508
|
-
# Configure Bearer authorization: user_key
|
2509
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2510
|
-
# Configure Bearer authorization: app_key
|
2511
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2512
|
-
|
2513
|
-
end
|
2514
|
-
|
2515
|
-
api_instance = OneSignal::DefaultApi.new
|
2516
|
-
player_id = 'player_id_example' # String | Player's OneSignal ID
|
2517
|
-
player = OneSignal::Player.new({device_type: 37}) # Player |
|
2518
|
-
|
2519
|
-
begin
|
2520
|
-
# Edit device
|
2521
|
-
result = api_instance.update_player(player_id, player)
|
2522
|
-
p result
|
2523
|
-
rescue OneSignal::ApiError => e
|
2524
|
-
puts "Error when calling DefaultApi->update_player: #{e}"
|
2525
|
-
end
|
2526
|
-
```
|
2527
|
-
|
2528
|
-
#### Using the update_player_with_http_info variant
|
2529
|
-
|
2530
|
-
This returns an Array which contains the response data, status code and headers.
|
2531
|
-
|
2532
|
-
> <Array(<UpdatePlayerSuccessResponse>, Integer, Hash)> update_player_with_http_info(player_id, player)
|
2533
|
-
|
2534
|
-
```ruby
|
2535
|
-
begin
|
2536
|
-
# Edit device
|
2537
|
-
data, status_code, headers = api_instance.update_player_with_http_info(player_id, player)
|
2538
|
-
p status_code # => 2xx
|
2539
|
-
p headers # => { ... }
|
2540
|
-
p data # => <UpdatePlayerSuccessResponse>
|
2541
|
-
rescue OneSignal::ApiError => e
|
2542
|
-
puts "Error when calling DefaultApi->update_player_with_http_info: #{e}"
|
2543
|
-
end
|
2544
|
-
```
|
2545
|
-
|
2546
|
-
### Parameters
|
2547
|
-
|
2548
|
-
| Name | Type | Description | Notes |
|
2549
|
-
| ---- | ---- | ----------- | ----- |
|
2550
|
-
| **player_id** | **String** | Player's OneSignal ID | |
|
2551
|
-
| **player** | [**Player**](Player.md) | | |
|
2552
|
-
|
2553
|
-
### Return type
|
2554
|
-
|
2555
|
-
[**UpdatePlayerSuccessResponse**](UpdatePlayerSuccessResponse.md)
|
2556
|
-
|
2557
|
-
### Authorization
|
2558
|
-
|
2559
|
-
[app_key](../README.md#app_key)
|
2560
|
-
|
2561
|
-
### HTTP request headers
|
2562
|
-
|
2563
|
-
- **Content-Type**: application/json
|
2564
|
-
- **Accept**: application/json
|
2565
|
-
|
2566
|
-
|
2567
|
-
## update_player_tags
|
2568
|
-
|
2569
|
-
> <UpdatePlayerTagsSuccessResponse> update_player_tags(app_id, external_user_id, opts)
|
2570
|
-
|
2571
|
-
Edit tags with external user id
|
2572
|
-
|
2573
|
-
Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" }
|
2574
|
-
|
2575
|
-
### Examples
|
2576
|
-
|
2577
|
-
```ruby
|
2578
|
-
require 'onesignal'
|
2579
|
-
# setup authorization
|
2580
|
-
OneSignal.configure do |config|
|
2581
|
-
# Configure Bearer authorization: user_key
|
2582
|
-
config.user_key = 'ORGANIZATION_API_KEY' # Organization key is only required for creating new apps and other top-level endpoints
|
2583
|
-
# Configure Bearer authorization: app_key
|
2584
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2585
|
-
|
2586
|
-
end
|
2587
|
-
|
2588
|
-
api_instance = OneSignal::DefaultApi.new
|
2589
|
-
app_id = 'app_id_example' # String | The OneSignal App ID the user record is found under.
|
2590
|
-
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.
|
2591
|
-
opts = {
|
2592
|
-
update_player_tags_request_body: OneSignal::UpdatePlayerTagsRequestBody.new # UpdatePlayerTagsRequestBody |
|
2593
|
-
}
|
2594
|
-
|
2595
|
-
begin
|
2596
|
-
# Edit tags with external user id
|
2597
|
-
result = api_instance.update_player_tags(app_id, external_user_id, opts)
|
2598
|
-
p result
|
2599
|
-
rescue OneSignal::ApiError => e
|
2600
|
-
puts "Error when calling DefaultApi->update_player_tags: #{e}"
|
2601
|
-
end
|
2602
|
-
```
|
2603
|
-
|
2604
|
-
#### Using the update_player_tags_with_http_info variant
|
2605
|
-
|
2606
|
-
This returns an Array which contains the response data, status code and headers.
|
2607
|
-
|
2608
|
-
> <Array(<UpdatePlayerTagsSuccessResponse>, Integer, Hash)> update_player_tags_with_http_info(app_id, external_user_id, opts)
|
2609
|
-
|
2610
|
-
```ruby
|
2611
|
-
begin
|
2612
|
-
# Edit tags with external user id
|
2613
|
-
data, status_code, headers = api_instance.update_player_tags_with_http_info(app_id, external_user_id, opts)
|
2614
|
-
p status_code # => 2xx
|
2615
|
-
p headers # => { ... }
|
2616
|
-
p data # => <UpdatePlayerTagsSuccessResponse>
|
2617
|
-
rescue OneSignal::ApiError => e
|
2618
|
-
puts "Error when calling DefaultApi->update_player_tags_with_http_info: #{e}"
|
2619
|
-
end
|
2620
|
-
```
|
2621
|
-
|
2622
|
-
### Parameters
|
2623
|
-
|
2624
|
-
| Name | Type | Description | Notes |
|
2625
|
-
| ---- | ---- | ----------- | ----- |
|
2626
|
-
| **app_id** | **String** | The OneSignal App ID the user record is found under. | |
|
2627
|
-
| **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. | |
|
2628
|
-
| **update_player_tags_request_body** | [**UpdatePlayerTagsRequestBody**](UpdatePlayerTagsRequestBody.md) | | [optional] |
|
2629
|
-
|
2630
|
-
### Return type
|
2631
|
-
|
2632
|
-
[**UpdatePlayerTagsSuccessResponse**](UpdatePlayerTagsSuccessResponse.md)
|
2633
|
-
|
2634
|
-
### Authorization
|
2635
|
-
|
2636
|
-
[app_key](../README.md#app_key)
|
2056
|
+
[rest_api_key](../README.md#rest_api_key)
|
2637
2057
|
|
2638
2058
|
### HTTP request headers
|
2639
2059
|
|
@@ -2643,7 +2063,7 @@ end
|
|
2643
2063
|
|
2644
2064
|
## update_subscription
|
2645
2065
|
|
2646
|
-
> update_subscription(app_id, subscription_id,
|
2066
|
+
> update_subscription(app_id, subscription_id, subscription_body)
|
2647
2067
|
|
2648
2068
|
|
2649
2069
|
|
@@ -2655,21 +2075,19 @@ Updates an existing Subscription’s properties.
|
|
2655
2075
|
require 'onesignal'
|
2656
2076
|
# setup authorization
|
2657
2077
|
OneSignal.configure do |config|
|
2658
|
-
# Configure Bearer authorization:
|
2659
|
-
config.
|
2660
|
-
# Configure Bearer authorization: app_key
|
2661
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2078
|
+
# Configure Bearer authorization: rest_api_key
|
2079
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
2662
2080
|
|
2663
2081
|
end
|
2664
2082
|
|
2665
2083
|
api_instance = OneSignal::DefaultApi.new
|
2666
2084
|
app_id = 'app_id_example' # String |
|
2667
2085
|
subscription_id = 'subscription_id_example' # String |
|
2668
|
-
|
2086
|
+
subscription_body = OneSignal::SubscriptionBody.new # SubscriptionBody |
|
2669
2087
|
|
2670
2088
|
begin
|
2671
2089
|
|
2672
|
-
api_instance.update_subscription(app_id, subscription_id,
|
2090
|
+
api_instance.update_subscription(app_id, subscription_id, subscription_body)
|
2673
2091
|
rescue OneSignal::ApiError => e
|
2674
2092
|
puts "Error when calling DefaultApi->update_subscription: #{e}"
|
2675
2093
|
end
|
@@ -2679,12 +2097,12 @@ end
|
|
2679
2097
|
|
2680
2098
|
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
2681
2099
|
|
2682
|
-
> <Array(nil, Integer, Hash)> update_subscription_with_http_info(app_id, subscription_id,
|
2100
|
+
> <Array(nil, Integer, Hash)> update_subscription_with_http_info(app_id, subscription_id, subscription_body)
|
2683
2101
|
|
2684
2102
|
```ruby
|
2685
2103
|
begin
|
2686
2104
|
|
2687
|
-
data, status_code, headers = api_instance.update_subscription_with_http_info(app_id, subscription_id,
|
2105
|
+
data, status_code, headers = api_instance.update_subscription_with_http_info(app_id, subscription_id, subscription_body)
|
2688
2106
|
p status_code # => 2xx
|
2689
2107
|
p headers # => { ... }
|
2690
2108
|
p data # => nil
|
@@ -2699,7 +2117,7 @@ end
|
|
2699
2117
|
| ---- | ---- | ----------- | ----- |
|
2700
2118
|
| **app_id** | **String** | | |
|
2701
2119
|
| **subscription_id** | **String** | | |
|
2702
|
-
| **
|
2120
|
+
| **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) | | |
|
2703
2121
|
|
2704
2122
|
### Return type
|
2705
2123
|
|
@@ -2707,7 +2125,7 @@ nil (empty response body)
|
|
2707
2125
|
|
2708
2126
|
### Authorization
|
2709
2127
|
|
2710
|
-
[
|
2128
|
+
[rest_api_key](../README.md#rest_api_key)
|
2711
2129
|
|
2712
2130
|
### HTTP request headers
|
2713
2131
|
|
@@ -2717,7 +2135,7 @@ nil (empty response body)
|
|
2717
2135
|
|
2718
2136
|
## update_user
|
2719
2137
|
|
2720
|
-
> <
|
2138
|
+
> <PropertiesBody> update_user(app_id, alias_label, alias_id, update_user_request)
|
2721
2139
|
|
2722
2140
|
|
2723
2141
|
|
@@ -2729,10 +2147,8 @@ Updates an existing User’s properties.
|
|
2729
2147
|
require 'onesignal'
|
2730
2148
|
# setup authorization
|
2731
2149
|
OneSignal.configure do |config|
|
2732
|
-
# Configure Bearer authorization:
|
2733
|
-
config.
|
2734
|
-
# Configure Bearer authorization: app_key
|
2735
|
-
config.app_key = 'REST_API_KEY' # App REST API key required for most endpoints
|
2150
|
+
# Configure Bearer authorization: rest_api_key
|
2151
|
+
config.rest_api_key = 'YOUR_BEARER_TOKEN'
|
2736
2152
|
|
2737
2153
|
end
|
2738
2154
|
|
@@ -2755,7 +2171,7 @@ end
|
|
2755
2171
|
|
2756
2172
|
This returns an Array which contains the response data, status code and headers.
|
2757
2173
|
|
2758
|
-
> <Array(<
|
2174
|
+
> <Array(<PropertiesBody>, Integer, Hash)> update_user_with_http_info(app_id, alias_label, alias_id, update_user_request)
|
2759
2175
|
|
2760
2176
|
```ruby
|
2761
2177
|
begin
|
@@ -2763,7 +2179,7 @@ begin
|
|
2763
2179
|
data, status_code, headers = api_instance.update_user_with_http_info(app_id, alias_label, alias_id, update_user_request)
|
2764
2180
|
p status_code # => 2xx
|
2765
2181
|
p headers # => { ... }
|
2766
|
-
p data # => <
|
2182
|
+
p data # => <PropertiesBody>
|
2767
2183
|
rescue OneSignal::ApiError => e
|
2768
2184
|
puts "Error when calling DefaultApi->update_user_with_http_info: #{e}"
|
2769
2185
|
end
|
@@ -2780,11 +2196,11 @@ end
|
|
2780
2196
|
|
2781
2197
|
### Return type
|
2782
2198
|
|
2783
|
-
[**
|
2199
|
+
[**PropertiesBody**](PropertiesBody.md)
|
2784
2200
|
|
2785
2201
|
### Authorization
|
2786
2202
|
|
2787
|
-
[
|
2203
|
+
[rest_api_key](../README.md#rest_api_key)
|
2788
2204
|
|
2789
2205
|
### HTTP request headers
|
2790
2206
|
|