Skip to content

Commit 6a970c4

Browse files
authored
Merge pull request #29 from OneSignal/api
409 and 429 errors
2 parents e2cd095 + 3c04df4 commit 6a970c4

File tree

181 files changed

+681
-1891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+681
-1891
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ A powerful way to send personalized messages at scale and build effective custom
66

77
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
88

9-
- API version: 1.2.1
10-
- Package version: 2.0.0
9+
- API version: 1.2.2
10+
- Package version: 2.0.2
1111
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
1212
For more information, please visit [https://onesignal.com](https://onesignal.com)
1313

@@ -24,16 +24,16 @@ gem build onesignal.gemspec
2424
Then either install the gem locally:
2525

2626
```shell
27-
gem install ./onesignal-2.0.0.gem
27+
gem install ./onesignal-2.0.2.gem
2828
```
2929

30-
(for development, run `gem install --dev ./onesignal-2.0.0.gem` to install the development dependencies)
30+
(for development, run `gem install --dev ./onesignal-2.0.2.gem` to install the development dependencies)
3131

3232
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
3333

3434
Finally add this to the Gemfile:
3535

36-
gem 'onesignal', '~> 2.0.0'
36+
gem 'onesignal', '~> 2.0.2'
3737

3838
### Install from Git
3939

@@ -97,7 +97,8 @@ Class | Method | HTTP request | Description
9797
*OneSignal::DefaultApi* | [**delete_subscription**](docs/DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} |
9898
*OneSignal::DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
9999
*OneSignal::DefaultApi* | [**end_live_activity**](docs/DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity
100-
*OneSignal::DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export
100+
*OneSignal::DefaultApi* | [**export_events**](docs/DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events
101+
*OneSignal::DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players
101102
*OneSignal::DefaultApi* | [**fetch_aliases**](docs/DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
102103
*OneSignal::DefaultApi* | [**fetch_user**](docs/DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
103104
*OneSignal::DefaultApi* | [**fetch_user_identity**](docs/DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
@@ -124,7 +125,6 @@ Class | Method | HTTP request | Description
124125
## Documentation for Models
125126

126127
- [OneSignal::App](docs/App.md)
127-
- [OneSignal::BadRequestError](docs/BadRequestError.md)
128128
- [OneSignal::BasicNotification](docs/BasicNotification.md)
129129
- [OneSignal::BasicNotificationAllOf](docs/BasicNotificationAllOf.md)
130130
- [OneSignal::BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md)
@@ -144,13 +144,14 @@ Class | Method | HTTP request | Description
144144
- [OneSignal::DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md)
145145
- [OneSignal::DeleteSegmentSuccessResponse](docs/DeleteSegmentSuccessResponse.md)
146146
- [OneSignal::DeliveryData](docs/DeliveryData.md)
147+
- [OneSignal::ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md)
147148
- [OneSignal::ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md)
148149
- [OneSignal::ExportPlayersSuccessResponse](docs/ExportPlayersSuccessResponse.md)
149150
- [OneSignal::Filter](docs/Filter.md)
150151
- [OneSignal::FilterExpressions](docs/FilterExpressions.md)
152+
- [OneSignal::GenericError](docs/GenericError.md)
153+
- [OneSignal::GenericErrorErrorsInner](docs/GenericErrorErrorsInner.md)
151154
- [OneSignal::GetNotificationRequestBody](docs/GetNotificationRequestBody.md)
152-
- [OneSignal::IdentifyUserConflictResponse](docs/IdentifyUserConflictResponse.md)
153-
- [OneSignal::IdentifyUserConflictResponseErrorsInner](docs/IdentifyUserConflictResponseErrorsInner.md)
154155
- [OneSignal::InlineResponse200](docs/InlineResponse200.md)
155156
- [OneSignal::InlineResponse2003](docs/InlineResponse2003.md)
156157
- [OneSignal::InlineResponse201](docs/InlineResponse201.md)
@@ -177,6 +178,7 @@ Class | Method | HTTP request | Description
177178
- [OneSignal::PropertiesDeltas](docs/PropertiesDeltas.md)
178179
- [OneSignal::PropertiesObject](docs/PropertiesObject.md)
179180
- [OneSignal::Purchase](docs/Purchase.md)
181+
- [OneSignal::RateLimiterError](docs/RateLimiterError.md)
180182
- [OneSignal::Segment](docs/Segment.md)
181183
- [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md)
182184
- [OneSignal::StringMap](docs/StringMap.md)

docs/BadRequestError.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/BasicNotification.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,12 @@
104104
| **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] |
105105
| **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] |
106106
| **email_from_address** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] |
107+
| **email_preheader** | **String** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional] |
108+
| **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] |
107109
| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] |
108110
| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] |
109111
| **filters** | [**Array<Filter>**](Filter.md) | | [optional] |
112+
| **custom_data** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] |
110113

111114
## Example
112115

@@ -214,9 +217,12 @@ instance = OneSignal::BasicNotification.new(
214217
email_body: null,
215218
email_from_name: null,
216219
email_from_address: null,
220+
email_preheader: null,
221+
include_unsubscribed: null,
217222
sms_from: null,
218223
sms_media_urls: null,
219-
filters: null
224+
filters: null,
225+
custom_data: null
220226
)
221227
```
222228

docs/BasicNotificationAllOf.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@
9090
| **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] |
9191
| **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] |
9292
| **email_from_address** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] |
93+
| **email_preheader** | **String** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional] |
94+
| **include_unsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] |
9395
| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] |
9496
| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] |
9597
| **filters** | [**Array<Filter>**](Filter.md) | | [optional] |
98+
| **custom_data** | **Object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] |
9699

97100
## Example
98101

@@ -186,9 +189,12 @@ instance = OneSignal::BasicNotificationAllOf.new(
186189
email_body: null,
187190
email_from_name: null,
188191
email_from_address: null,
192+
email_preheader: null,
193+
include_unsubscribed: null,
189194
sms_from: null,
190195
sms_media_urls: null,
191-
filters: null
196+
filters: null,
197+
custom_data: null
192198
)
193199
```
194200

docs/CreateNotificationBadRequestResponse.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/CreateSegmentBadRequestResponse.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/DefaultApi.md

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ All URIs are relative to *https://onesignal.com/api/v1*
1818
| [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
1919
| [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
2020
| [**end_live_activity**](DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity |
21-
| [**export_players**](DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export |
21+
| [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
22+
| [**export_players**](DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players |
2223
| [**fetch_aliases**](DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
2324
| [**fetch_user**](DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
2425
| [**fetch_user_identity**](DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
@@ -895,7 +896,7 @@ nil (empty response body)
895896
### HTTP request headers
896897

897898
- **Content-Type**: Not defined
898-
- **Accept**: Not defined
899+
- **Accept**: application/json
899900

900901

901902
## delete_user
@@ -961,7 +962,7 @@ No authorization required
961962
### HTTP request headers
962963

963964
- **Content-Type**: Not defined
964-
- **Accept**: Not defined
965+
- **Accept**: application/json
965966

966967

967968
## end_live_activity
@@ -1036,11 +1037,82 @@ nil (empty response body)
10361037
- **Accept**: application/json
10371038

10381039

1040+
## export_events
1041+
1042+
> <ExportEventsSuccessResponse> export_events(notification_id, app_id)
1043+
1044+
Export CSV of Events
1045+
1046+
Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.
1047+
1048+
### Examples
1049+
1050+
```ruby
1051+
require 'onesignal'
1052+
# setup authorization
1053+
OneSignal.configure do |config|
1054+
# Configure Bearer authorization: app_key
1055+
config.app_key = 'YOUR_BEARER_TOKEN'
1056+
1057+
end
1058+
1059+
api_instance = OneSignal::DefaultApi.new
1060+
notification_id = 'notification_id_example' # String | The ID of the notification to export events from.
1061+
app_id = 'app_id_example' # String | The ID of the app that the notification belongs to.
1062+
1063+
begin
1064+
# Export CSV of Events
1065+
result = api_instance.export_events(notification_id, app_id)
1066+
p result
1067+
rescue OneSignal::ApiError => e
1068+
puts "Error when calling DefaultApi->export_events: #{e}"
1069+
end
1070+
```
1071+
1072+
#### Using the export_events_with_http_info variant
1073+
1074+
This returns an Array which contains the response data, status code and headers.
1075+
1076+
> <Array(<ExportEventsSuccessResponse>, Integer, Hash)> export_events_with_http_info(notification_id, app_id)
1077+
1078+
```ruby
1079+
begin
1080+
# Export CSV of Events
1081+
data, status_code, headers = api_instance.export_events_with_http_info(notification_id, app_id)
1082+
p status_code # => 2xx
1083+
p headers # => { ... }
1084+
p data # => <ExportEventsSuccessResponse>
1085+
rescue OneSignal::ApiError => e
1086+
puts "Error when calling DefaultApi->export_events_with_http_info: #{e}"
1087+
end
1088+
```
1089+
1090+
### Parameters
1091+
1092+
| Name | Type | Description | Notes |
1093+
| ---- | ---- | ----------- | ----- |
1094+
| **notification_id** | **String** | The ID of the notification to export events from. | |
1095+
| **app_id** | **String** | The ID of the app that the notification belongs to. | |
1096+
1097+
### Return type
1098+
1099+
[**ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md)
1100+
1101+
### Authorization
1102+
1103+
[app_key](../README.md#app_key)
1104+
1105+
### HTTP request headers
1106+
1107+
- **Content-Type**: Not defined
1108+
- **Accept**: application/json
1109+
1110+
10391111
## export_players
10401112

10411113
> <ExportPlayersSuccessResponse> export_players(app_id, opts)
10421114
1043-
CSV export
1115+
Export CSV of Players
10441116

10451117
Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. |
10461118

@@ -1062,7 +1134,7 @@ opts = {
10621134
}
10631135

10641136
begin
1065-
# CSV export
1137+
# Export CSV of Players
10661138
result = api_instance.export_players(app_id, opts)
10671139
p result
10681140
rescue OneSignal::ApiError => e
@@ -1078,7 +1150,7 @@ This returns an Array which contains the response data, status code and headers.
10781150
10791151
```ruby
10801152
begin
1081-
# CSV export
1153+
# Export CSV of Players
10821154
data, status_code, headers = api_instance.export_players_with_http_info(app_id, opts)
10831155
p status_code # => 2xx
10841156
p headers # => { ... }
@@ -2562,7 +2634,7 @@ nil (empty response body)
25622634
### HTTP request headers
25632635

25642636
- **Content-Type**: application/json
2565-
- **Accept**: Not defined
2637+
- **Accept**: application/json
25662638

25672639

25682640
## update_user

docs/DeletePlayerBadRequestResponse.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/DeleteSegmentBadRequestResponse.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/ExportEventsSuccessResponse.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# OneSignal::ExportEventsSuccessResponse
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **csv_file_url** | **String** | | [optional] |
8+
9+
## Example
10+
11+
```ruby
12+
require 'onesignal'
13+
14+
instance = OneSignal::ExportEventsSuccessResponse.new(
15+
csv_file_url: null
16+
)
17+
```
18+

0 commit comments

Comments
 (0)