@onesignal/node-onesignal 5.2.1-beta1 → 5.3.1-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.
Files changed (198) hide show
  1. package/dist/apis/DefaultApi.d.ts +40 -0
  2. package/dist/apis/DefaultApi.js +1363 -100
  3. package/dist/models/ApiKeyToken.d.ts +23 -0
  4. package/dist/models/ApiKeyToken.js +52 -0
  5. package/dist/models/ApiKeyTokensListResponse.d.ts +18 -0
  6. package/dist/models/ApiKeyTokensListResponse.js +22 -0
  7. package/dist/models/CopyTemplateRequest.d.ts +17 -0
  8. package/dist/models/CopyTemplateRequest.js +22 -0
  9. package/dist/models/CreateApiKeyRequest.d.ts +20 -0
  10. package/dist/models/CreateApiKeyRequest.js +34 -0
  11. package/dist/models/CreateApiKeyResponse.d.ts +18 -0
  12. package/dist/models/CreateApiKeyResponse.js +28 -0
  13. package/dist/models/CreateTemplateRequest.d.ts +25 -0
  14. package/dist/models/CreateTemplateRequest.js +64 -0
  15. package/dist/models/CustomEvent.d.ts +23 -0
  16. package/dist/models/CustomEvent.js +46 -0
  17. package/dist/models/CustomEventsRequest.d.ts +18 -0
  18. package/dist/models/CustomEventsRequest.js +22 -0
  19. package/dist/models/NotificationWithMeta.d.ts +1 -0
  20. package/dist/models/NotificationWithMeta.js +6 -0
  21. package/dist/models/NotificationWithMetaAllOf.d.ts +1 -0
  22. package/dist/models/NotificationWithMetaAllOf.js +6 -0
  23. package/dist/models/ObjectSerializer.d.ts +14 -0
  24. package/dist/models/ObjectSerializer.js +47 -0
  25. package/dist/models/StartLiveActivityRequest.d.ts +37 -0
  26. package/dist/models/StartLiveActivityRequest.js +112 -0
  27. package/dist/models/StartLiveActivitySuccessResponse.d.ts +17 -0
  28. package/dist/models/StartLiveActivitySuccessResponse.js +22 -0
  29. package/dist/models/TemplateResource.d.ts +25 -0
  30. package/dist/models/TemplateResource.js +52 -0
  31. package/dist/models/TemplatesListResponse.d.ts +18 -0
  32. package/dist/models/TemplatesListResponse.js +22 -0
  33. package/dist/models/UpdateApiKeyRequest.d.ts +20 -0
  34. package/dist/models/UpdateApiKeyRequest.js +34 -0
  35. package/dist/models/UpdateTemplateRequest.d.ts +24 -0
  36. package/dist/models/UpdateTemplateRequest.js +58 -0
  37. package/dist/models/all.d.ts +14 -0
  38. package/dist/models/all.js +14 -0
  39. package/dist/types/ObjectParamAPI.d.ts +88 -0
  40. package/dist/types/ObjectParamAPI.js +42 -0
  41. package/dist/types/ObservableAPI.d.ts +26 -0
  42. package/dist/types/ObservableAPI.js +422 -86
  43. package/dist/types/PromiseAPI.d.ts +26 -0
  44. package/dist/types/PromiseAPI.js +56 -0
  45. package/package.json +9 -3
  46. package/.github/ISSUE_TEMPLATE/ask-question.yml +0 -25
  47. package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -51
  48. package/.github/ISSUE_TEMPLATE/general-feedback.yml +0 -25
  49. package/.github/pull_request_template.md +0 -44
  50. package/.github/workflows/asana-add-comment.yml +0 -47
  51. package/.github/workflows/asana-create-task.yml +0 -119
  52. package/.github/workflows/asana-update-issue.yml +0 -172
  53. package/.github/workflows/npm_deploy.yml +0 -22
  54. package/.github/workflows/project.yml +0 -17
  55. package/CHANGELOG.md +0 -48
  56. package/DefaultApi.md +0 -2177
  57. package/RELEASE_INSTRUCTIONS.md +0 -2
  58. package/apis/DefaultApi.ts +0 -3270
  59. package/apis/baseapi.ts +0 -37
  60. package/apis/exception.ts +0 -15
  61. package/auth/auth.ts +0 -110
  62. package/configuration.ts +0 -85
  63. package/dist/apis/DefaultApi.js.map +0 -1
  64. package/dist/apis/baseapi.js.map +0 -1
  65. package/dist/apis/exception.js.map +0 -1
  66. package/dist/auth/auth.js.map +0 -1
  67. package/dist/configuration.js.map +0 -1
  68. package/dist/http/http.js.map +0 -1
  69. package/dist/http/isomorphic-fetch.js.map +0 -1
  70. package/dist/index.js.map +0 -1
  71. package/dist/middleware.js.map +0 -1
  72. package/dist/models/App.js.map +0 -1
  73. package/dist/models/BasicNotification.js.map +0 -1
  74. package/dist/models/BasicNotificationAllOf.js.map +0 -1
  75. package/dist/models/BasicNotificationAllOfAndroidBackgroundLayout.js.map +0 -1
  76. package/dist/models/Button.js.map +0 -1
  77. package/dist/models/CreateNotificationSuccessResponse.js.map +0 -1
  78. package/dist/models/CreateSegmentConflictResponse.js.map +0 -1
  79. package/dist/models/CreateSegmentSuccessResponse.js.map +0 -1
  80. package/dist/models/CreateUserConflictResponse.js.map +0 -1
  81. package/dist/models/CreateUserConflictResponseErrorsInner.js.map +0 -1
  82. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js.map +0 -1
  83. package/dist/models/DeliveryData.js.map +0 -1
  84. package/dist/models/ExportEventsSuccessResponse.js.map +0 -1
  85. package/dist/models/ExportSubscriptionsRequestBody.js.map +0 -1
  86. package/dist/models/ExportSubscriptionsSuccessResponse.js.map +0 -1
  87. package/dist/models/Filter.js.map +0 -1
  88. package/dist/models/FilterExpression.js.map +0 -1
  89. package/dist/models/GenericError.js.map +0 -1
  90. package/dist/models/GenericSuccessBoolResponse.js.map +0 -1
  91. package/dist/models/GetNotificationHistoryRequestBody.js.map +0 -1
  92. package/dist/models/GetSegmentsSuccessResponse.js.map +0 -1
  93. package/dist/models/LanguageStringMap.js.map +0 -1
  94. package/dist/models/Notification.js.map +0 -1
  95. package/dist/models/NotificationAllOf.js.map +0 -1
  96. package/dist/models/NotificationHistorySuccessResponse.js.map +0 -1
  97. package/dist/models/NotificationSlice.js.map +0 -1
  98. package/dist/models/NotificationTarget.js.map +0 -1
  99. package/dist/models/NotificationWithMeta.js.map +0 -1
  100. package/dist/models/NotificationWithMetaAllOf.js.map +0 -1
  101. package/dist/models/ObjectSerializer.js.map +0 -1
  102. package/dist/models/Operator.js.map +0 -1
  103. package/dist/models/OutcomeData.js.map +0 -1
  104. package/dist/models/OutcomesData.js.map +0 -1
  105. package/dist/models/PlatformDeliveryData.js.map +0 -1
  106. package/dist/models/PlatformDeliveryDataEmailAllOf.js.map +0 -1
  107. package/dist/models/PlatformDeliveryDataSmsAllOf.js.map +0 -1
  108. package/dist/models/PropertiesBody.js.map +0 -1
  109. package/dist/models/PropertiesDeltas.js.map +0 -1
  110. package/dist/models/PropertiesObject.js.map +0 -1
  111. package/dist/models/Purchase.js.map +0 -1
  112. package/dist/models/RateLimitError.js.map +0 -1
  113. package/dist/models/Segment.js.map +0 -1
  114. package/dist/models/SegmentData.js.map +0 -1
  115. package/dist/models/SegmentNotificationTarget.js.map +0 -1
  116. package/dist/models/Subscription.js.map +0 -1
  117. package/dist/models/SubscriptionBody.js.map +0 -1
  118. package/dist/models/SubscriptionNotificationTarget.js.map +0 -1
  119. package/dist/models/TransferSubscriptionRequestBody.js.map +0 -1
  120. package/dist/models/UpdateLiveActivityRequest.js.map +0 -1
  121. package/dist/models/UpdateLiveActivitySuccessResponse.js.map +0 -1
  122. package/dist/models/UpdateUserRequest.js.map +0 -1
  123. package/dist/models/User.js.map +0 -1
  124. package/dist/models/UserIdentityBody.js.map +0 -1
  125. package/dist/models/WebButton.js.map +0 -1
  126. package/dist/models/all.js.map +0 -1
  127. package/dist/rxjsStub.js.map +0 -1
  128. package/dist/servers.js.map +0 -1
  129. package/dist/types/ObjectParamAPI.js.map +0 -1
  130. package/dist/types/ObservableAPI.js.map +0 -1
  131. package/dist/types/PromiseAPI.js.map +0 -1
  132. package/dist/util.js.map +0 -1
  133. package/http/http.ts +0 -205
  134. package/http/isomorphic-fetch.ts +0 -30
  135. package/index.ts +0 -12
  136. package/middleware.ts +0 -66
  137. package/models/App.ts +0 -328
  138. package/models/BasicNotification.ts +0 -1088
  139. package/models/BasicNotificationAllOf.ts +0 -958
  140. package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +0 -57
  141. package/models/Button.ts +0 -45
  142. package/models/CreateNotificationSuccessResponse.ts +0 -48
  143. package/models/CreateSegmentConflictResponse.ts +0 -38
  144. package/models/CreateSegmentSuccessResponse.ts +0 -41
  145. package/models/CreateUserConflictResponse.ts +0 -32
  146. package/models/CreateUserConflictResponseErrorsInner.ts +0 -46
  147. package/models/CreateUserConflictResponseErrorsItemsMeta.ts +0 -31
  148. package/models/DeliveryData.ts +0 -74
  149. package/models/ExportEventsSuccessResponse.ts +0 -31
  150. package/models/ExportSubscriptionsRequestBody.ts +0 -54
  151. package/models/ExportSubscriptionsSuccessResponse.ts +0 -31
  152. package/models/Filter.ts +0 -107
  153. package/models/FilterExpression.ts +0 -120
  154. package/models/GenericError.ts +0 -45
  155. package/models/GenericSuccessBoolResponse.ts +0 -31
  156. package/models/GetNotificationHistoryRequestBody.ts +0 -54
  157. package/models/GetSegmentsSuccessResponse.ts +0 -65
  158. package/models/LanguageStringMap.ts +0 -454
  159. package/models/Notification.ts +0 -1098
  160. package/models/NotificationAllOf.ts +0 -34
  161. package/models/NotificationHistorySuccessResponse.ts +0 -38
  162. package/models/NotificationSlice.ts +0 -53
  163. package/models/NotificationTarget.ts +0 -156
  164. package/models/NotificationWithMeta.ts +0 -1196
  165. package/models/NotificationWithMetaAllOf.ts +0 -132
  166. package/models/ObjectSerializer.ts +0 -395
  167. package/models/Operator.ts +0 -37
  168. package/models/OutcomeData.ts +0 -48
  169. package/models/OutcomesData.ts +0 -32
  170. package/models/PlatformDeliveryData.ts +0 -86
  171. package/models/PlatformDeliveryDataEmailAllOf.ts +0 -94
  172. package/models/PlatformDeliveryDataSmsAllOf.ts +0 -54
  173. package/models/PropertiesBody.ts +0 -32
  174. package/models/PropertiesDeltas.ts +0 -46
  175. package/models/PropertiesObject.ts +0 -102
  176. package/models/Purchase.ts +0 -61
  177. package/models/RateLimitError.ts +0 -38
  178. package/models/Segment.ts +0 -55
  179. package/models/SegmentData.ts +0 -94
  180. package/models/SegmentNotificationTarget.ts +0 -44
  181. package/models/Subscription.ts +0 -146
  182. package/models/SubscriptionBody.ts +0 -32
  183. package/models/SubscriptionNotificationTarget.ts +0 -134
  184. package/models/TransferSubscriptionRequestBody.ts +0 -31
  185. package/models/UpdateLiveActivityRequest.ts +0 -109
  186. package/models/UpdateLiveActivitySuccessResponse.ts +0 -31
  187. package/models/UpdateUserRequest.ts +0 -47
  188. package/models/User.ts +0 -47
  189. package/models/UserIdentityBody.ts +0 -31
  190. package/models/WebButton.ts +0 -52
  191. package/models/all.ts +0 -53
  192. package/rxjsStub.ts +0 -27
  193. package/servers.ts +0 -53
  194. package/tsconfig.json +0 -28
  195. package/types/ObjectParamAPI.ts +0 -884
  196. package/types/ObservableAPI.ts +0 -831
  197. package/types/PromiseAPI.ts +0 -411
  198. package/util.ts +0 -37
package/DefaultApi.md DELETED
@@ -1,2177 +0,0 @@
1
- # .DefaultApi
2
-
3
- All URIs are relative to *https://api.onesignal.com*
4
-
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**cancelNotification**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
8
- [**createAlias**](DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
9
- [**createAliasBySubscription**](DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
10
- [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app
11
- [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification
12
- [**createSegment**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment
13
- [**createSubscription**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions |
14
- [**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users |
15
- [**deleteAlias**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} |
16
- [**deleteSegment**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment
17
- [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} |
18
- [**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
19
- [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events
20
- [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions
21
- [**getAliases**](DefaultApi.md#getAliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
22
- [**getAliasesBySubscription**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
23
- [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app
24
- [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps
25
- [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification
26
- [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History
27
- [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications
28
- [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
29
- [**getSegments**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments
30
- [**getUser**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
31
- [**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner |
32
- [**unsubscribeEmailWithToken**](DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token
33
- [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app
34
- [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
35
- [**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} |
36
- [**updateUser**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
37
-
38
-
39
- # **cancelNotification**
40
- > GenericSuccessBoolResponse cancelNotification()
41
-
42
- Used to stop a scheduled or currently outgoing notification
43
-
44
- ### Example
45
-
46
-
47
- ```typescript
48
- import { } from '';
49
- import * as fs from 'fs';
50
-
51
- const configuration = .createConfiguration();
52
- const apiInstance = new .DefaultApi(configuration);
53
-
54
- let body:.DefaultApiCancelNotificationRequest = {
55
- // string
56
- appId: "app_id_example",
57
- // string
58
- notificationId: "notification_id_example",
59
- };
60
-
61
- apiInstance.cancelNotification(body).then((data:any) => {
62
- console.log('API called successfully. Returned data: ' + data);
63
- }).catch((error:any) => console.error(error));
64
- ```
65
-
66
-
67
- ### Parameters
68
-
69
- Name | Type | Description | Notes
70
- ------------- | ------------- | ------------- | -------------
71
- **appId** | [**string**] | | defaults to undefined
72
- **notificationId** | [**string**] | | defaults to undefined
73
-
74
-
75
- ### Return type
76
-
77
- **GenericSuccessBoolResponse**
78
-
79
- ### Authorization
80
-
81
- [rest_api_key](README.md#rest_api_key)
82
-
83
- ### HTTP request headers
84
-
85
- - **Content-Type**: Not defined
86
- - **Accept**: application/json
87
-
88
-
89
- ### HTTP response details
90
- | Status code | Description | Response headers |
91
- |-------------|-------------|------------------|
92
- **200** | OK | - |
93
- **400** | Bad Request | - |
94
- **404** | Not Found | - |
95
- **429** | Rate Limit Exceeded | - |
96
-
97
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
98
-
99
- # **createAlias**
100
- > UserIdentityBody createAlias(userIdentityBody)
101
-
102
- Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
103
-
104
- ### Example
105
-
106
-
107
- ```typescript
108
- import { } from '';
109
- import * as fs from 'fs';
110
-
111
- const configuration = .createConfiguration();
112
- const apiInstance = new .DefaultApi(configuration);
113
-
114
- let body:.DefaultApiCreateAliasRequest = {
115
- // string
116
- appId: "app_id_example",
117
- // string
118
- aliasLabel: "alias_label_example",
119
- // string
120
- aliasId: "alias_id_example",
121
- // UserIdentityBody
122
- userIdentityBody: {
123
- identity: {
124
- "key": "key_example",
125
- },
126
- },
127
- };
128
-
129
- apiInstance.createAlias(body).then((data:any) => {
130
- console.log('API called successfully. Returned data: ' + data);
131
- }).catch((error:any) => console.error(error));
132
- ```
133
-
134
-
135
- ### Parameters
136
-
137
- Name | Type | Description | Notes
138
- ------------- | ------------- | ------------- | -------------
139
- **userIdentityBody** | **UserIdentityBody**| |
140
- **appId** | [**string**] | | defaults to undefined
141
- **aliasLabel** | [**string**] | | defaults to undefined
142
- **aliasId** | [**string**] | | defaults to undefined
143
-
144
-
145
- ### Return type
146
-
147
- **UserIdentityBody**
148
-
149
- ### Authorization
150
-
151
- [rest_api_key](README.md#rest_api_key)
152
-
153
- ### HTTP request headers
154
-
155
- - **Content-Type**: application/json
156
- - **Accept**: application/json
157
-
158
-
159
- ### HTTP response details
160
- | Status code | Description | Response headers |
161
- |-------------|-------------|------------------|
162
- **200** | OK | - |
163
- **400** | Bad Request | - |
164
- **404** | Not Found | - |
165
- **409** | Conflict | - |
166
- **429** | Rate Limit Exceeded | - |
167
-
168
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
169
-
170
- # **createAliasBySubscription**
171
- > UserIdentityBody createAliasBySubscription(userIdentityBody)
172
-
173
- Upserts one or more Aliases for the User identified by :subscription_id.
174
-
175
- ### Example
176
-
177
-
178
- ```typescript
179
- import { } from '';
180
- import * as fs from 'fs';
181
-
182
- const configuration = .createConfiguration();
183
- const apiInstance = new .DefaultApi(configuration);
184
-
185
- let body:.DefaultApiCreateAliasBySubscriptionRequest = {
186
- // string
187
- appId: "app_id_example",
188
- // string
189
- subscriptionId: "subscription_id_example",
190
- // UserIdentityBody
191
- userIdentityBody: {
192
- identity: {
193
- "key": "key_example",
194
- },
195
- },
196
- };
197
-
198
- apiInstance.createAliasBySubscription(body).then((data:any) => {
199
- console.log('API called successfully. Returned data: ' + data);
200
- }).catch((error:any) => console.error(error));
201
- ```
202
-
203
-
204
- ### Parameters
205
-
206
- Name | Type | Description | Notes
207
- ------------- | ------------- | ------------- | -------------
208
- **userIdentityBody** | **UserIdentityBody**| |
209
- **appId** | [**string**] | | defaults to undefined
210
- **subscriptionId** | [**string**] | | defaults to undefined
211
-
212
-
213
- ### Return type
214
-
215
- **UserIdentityBody**
216
-
217
- ### Authorization
218
-
219
- [rest_api_key](README.md#rest_api_key)
220
-
221
- ### HTTP request headers
222
-
223
- - **Content-Type**: application/json
224
- - **Accept**: application/json
225
-
226
-
227
- ### HTTP response details
228
- | Status code | Description | Response headers |
229
- |-------------|-------------|------------------|
230
- **200** | OK | - |
231
- **400** | Bad Request | - |
232
- **404** | Not Found | - |
233
- **409** | Conflict | - |
234
- **429** | Rate Limit Exceeded | - |
235
-
236
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
237
-
238
- # **createApp**
239
- > App createApp(app)
240
-
241
- Creates a new OneSignal app
242
-
243
- ### Example
244
-
245
-
246
- ```typescript
247
- import { } from '';
248
- import * as fs from 'fs';
249
-
250
- const configuration = .createConfiguration();
251
- const apiInstance = new .DefaultApi(configuration);
252
-
253
- let body:.DefaultApiCreateAppRequest = {
254
- // App
255
- app: {
256
- name: "name_example",
257
- android_gcm_sender_id: "android_gcm_sender_id_example",
258
- gcm_key: "gcm_key_example",
259
- chrome_web_origin: "chrome_web_origin_example",
260
- chrome_key: "chrome_key_example",
261
- chrome_web_default_notification_icon: "chrome_web_default_notification_icon_example",
262
- chrome_web_sub_domain: "chrome_web_sub_domain_example",
263
- apns_env: "sandbox",
264
- apns_p12: "apns_p12_example",
265
- apns_p12_password: "apns_p12_password_example",
266
- safari_apns_p12: "safari_apns_p12_example",
267
- safari_apns_p12_password: "safari_apns_p12_password_example",
268
- apns_key_id: "apns_key_id_example",
269
- apns_team_id: "apns_team_id_example",
270
- apns_bundle_id: "apns_bundle_id_example",
271
- apns_p8: "apns_p8_example",
272
- safari_site_origin: "safari_site_origin_example",
273
- safari_icon_256_256: "safari_icon_256_256_example",
274
- site_name: "site_name_example",
275
- organization_id: "organization_id_example",
276
- additional_data_is_root_payload: true,
277
- },
278
- };
279
-
280
- apiInstance.createApp(body).then((data:any) => {
281
- console.log('API called successfully. Returned data: ' + data);
282
- }).catch((error:any) => console.error(error));
283
- ```
284
-
285
-
286
- ### Parameters
287
-
288
- Name | Type | Description | Notes
289
- ------------- | ------------- | ------------- | -------------
290
- **app** | **App**| |
291
-
292
-
293
- ### Return type
294
-
295
- **App**
296
-
297
- ### Authorization
298
-
299
- [organization_api_key](README.md#organization_api_key)
300
-
301
- ### HTTP request headers
302
-
303
- - **Content-Type**: application/json
304
- - **Accept**: application/json
305
-
306
-
307
- ### HTTP response details
308
- | Status code | Description | Response headers |
309
- |-------------|-------------|------------------|
310
- **200** | OK | - |
311
- **400** | Bad Request | - |
312
- **429** | Rate Limit Exceeded | - |
313
-
314
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
315
-
316
- # **createNotification**
317
- > CreateNotificationSuccessResponse createNotification(notification)
318
-
319
- Sends notifications to your users
320
-
321
- ### Example
322
-
323
-
324
- ```typescript
325
- import { } from '';
326
- import * as fs from 'fs';
327
-
328
- const configuration = .createConfiguration();
329
- const apiInstance = new .DefaultApi(configuration);
330
-
331
- let body:.DefaultApiCreateNotificationRequest = {
332
- // Notification
333
- notification: null,
334
- };
335
-
336
- apiInstance.createNotification(body).then((data:any) => {
337
- console.log('API called successfully. Returned data: ' + data);
338
- }).catch((error:any) => console.error(error));
339
- ```
340
-
341
-
342
- ### Parameters
343
-
344
- Name | Type | Description | Notes
345
- ------------- | ------------- | ------------- | -------------
346
- **notification** | **Notification**| |
347
-
348
-
349
- ### Return type
350
-
351
- **CreateNotificationSuccessResponse**
352
-
353
- ### Authorization
354
-
355
- [rest_api_key](README.md#rest_api_key)
356
-
357
- ### HTTP request headers
358
-
359
- - **Content-Type**: application/json
360
- - **Accept**: application/json
361
-
362
-
363
- ### HTTP response details
364
- | Status code | Description | Response headers |
365
- |-------------|-------------|------------------|
366
- **200** | OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. | - |
367
- **400** | Bad Request | - |
368
- **429** | Rate Limit Exceeded | - |
369
-
370
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
371
-
372
- # **createSegment**
373
- > CreateSegmentSuccessResponse createSegment()
374
-
375
- 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.
376
-
377
- ### Example
378
-
379
-
380
- ```typescript
381
- import { } from '';
382
- import * as fs from 'fs';
383
-
384
- const configuration = .createConfiguration();
385
- const apiInstance = new .DefaultApi(configuration);
386
-
387
- let body:.DefaultApiCreateSegmentRequest = {
388
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
389
- appId: "app_id_example",
390
- // Segment (optional)
391
- segment: {
392
- id: "id_example",
393
- name: "name_example",
394
- filters: [
395
- null,
396
- ],
397
- },
398
- };
399
-
400
- apiInstance.createSegment(body).then((data:any) => {
401
- console.log('API called successfully. Returned data: ' + data);
402
- }).catch((error:any) => console.error(error));
403
- ```
404
-
405
-
406
- ### Parameters
407
-
408
- Name | Type | Description | Notes
409
- ------------- | ------------- | ------------- | -------------
410
- **segment** | **Segment**| |
411
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined
412
-
413
-
414
- ### Return type
415
-
416
- **CreateSegmentSuccessResponse**
417
-
418
- ### Authorization
419
-
420
- [rest_api_key](README.md#rest_api_key)
421
-
422
- ### HTTP request headers
423
-
424
- - **Content-Type**: application/json
425
- - **Accept**: application/json
426
-
427
-
428
- ### HTTP response details
429
- | Status code | Description | Response headers |
430
- |-------------|-------------|------------------|
431
- **201** | Created | - |
432
- **400** | Bad Request | - |
433
- **409** | Conflict | - |
434
- **429** | Rate Limit Exceeded | - |
435
-
436
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
437
-
438
- # **createSubscription**
439
- > SubscriptionBody createSubscription(subscriptionBody)
440
-
441
- Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
442
-
443
- ### Example
444
-
445
-
446
- ```typescript
447
- import { } from '';
448
- import * as fs from 'fs';
449
-
450
- const configuration = .createConfiguration();
451
- const apiInstance = new .DefaultApi(configuration);
452
-
453
- let body:.DefaultApiCreateSubscriptionRequest = {
454
- // string
455
- appId: "app_id_example",
456
- // string
457
- aliasLabel: "alias_label_example",
458
- // string
459
- aliasId: "alias_id_example",
460
- // SubscriptionBody
461
- subscriptionBody: {
462
- subscription: {
463
- id: "id_example",
464
- type: "iOSPush",
465
- token: "token_example",
466
- enabled: true,
467
- notification_types: 1,
468
- session_time: 1,
469
- session_count: 1,
470
- sdk: "sdk_example",
471
- device_model: "device_model_example",
472
- device_os: "device_os_example",
473
- rooted: true,
474
- test_type: 1,
475
- app_version: "app_version_example",
476
- net_type: 1,
477
- carrier: "carrier_example",
478
- web_auth: "web_auth_example",
479
- web_p256: "web_p256_example",
480
- },
481
- },
482
- };
483
-
484
- apiInstance.createSubscription(body).then((data:any) => {
485
- console.log('API called successfully. Returned data: ' + data);
486
- }).catch((error:any) => console.error(error));
487
- ```
488
-
489
-
490
- ### Parameters
491
-
492
- Name | Type | Description | Notes
493
- ------------- | ------------- | ------------- | -------------
494
- **subscriptionBody** | **SubscriptionBody**| |
495
- **appId** | [**string**] | | defaults to undefined
496
- **aliasLabel** | [**string**] | | defaults to undefined
497
- **aliasId** | [**string**] | | defaults to undefined
498
-
499
-
500
- ### Return type
501
-
502
- **SubscriptionBody**
503
-
504
- ### Authorization
505
-
506
- [rest_api_key](README.md#rest_api_key)
507
-
508
- ### HTTP request headers
509
-
510
- - **Content-Type**: application/json
511
- - **Accept**: application/json
512
-
513
-
514
- ### HTTP response details
515
- | Status code | Description | Response headers |
516
- |-------------|-------------|------------------|
517
- **201** | CREATED | - |
518
- **202** | ACCEPTED | - |
519
- **400** | Bad Request | - |
520
- **404** | Not Found | - |
521
- **409** | Operation is not permitted due to user having the maximum number of subscriptions assigned | - |
522
- **429** | Rate Limit Exceeded | - |
523
-
524
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
525
-
526
- # **createUser**
527
- > User createUser(user)
528
-
529
- Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
530
-
531
- ### Example
532
-
533
-
534
- ```typescript
535
- import { } from '';
536
- import * as fs from 'fs';
537
-
538
- const configuration = .createConfiguration();
539
- const apiInstance = new .DefaultApi(configuration);
540
-
541
- let body:.DefaultApiCreateUserRequest = {
542
- // string
543
- appId: "app_id_example",
544
- // User
545
- user: {
546
- properties: {
547
- tags: {},
548
- language: "language_example",
549
- timezone_id: "timezone_id_example",
550
- lat: 3.14,
551
- long: 3.14,
552
- country: "country_example",
553
- first_active: 1,
554
- last_active: 1,
555
- amount_spent: 3.14,
556
- purchases: [
557
- {
558
- sku: "sku_example",
559
- amount: "amount_example",
560
- iso: "iso_example",
561
- count: 1,
562
- },
563
- ],
564
- ip: "ip_example",
565
- },
566
- identity: {
567
- "key": "key_example",
568
- },
569
- subscriptions: [
570
- {
571
- id: "id_example",
572
- type: "iOSPush",
573
- token: "token_example",
574
- enabled: true,
575
- notification_types: 1,
576
- session_time: 1,
577
- session_count: 1,
578
- sdk: "sdk_example",
579
- device_model: "device_model_example",
580
- device_os: "device_os_example",
581
- rooted: true,
582
- test_type: 1,
583
- app_version: "app_version_example",
584
- net_type: 1,
585
- carrier: "carrier_example",
586
- web_auth: "web_auth_example",
587
- web_p256: "web_p256_example",
588
- },
589
- ],
590
- },
591
- };
592
-
593
- apiInstance.createUser(body).then((data:any) => {
594
- console.log('API called successfully. Returned data: ' + data);
595
- }).catch((error:any) => console.error(error));
596
- ```
597
-
598
-
599
- ### Parameters
600
-
601
- Name | Type | Description | Notes
602
- ------------- | ------------- | ------------- | -------------
603
- **user** | **User**| |
604
- **appId** | [**string**] | | defaults to undefined
605
-
606
-
607
- ### Return type
608
-
609
- **User**
610
-
611
- ### Authorization
612
-
613
- [rest_api_key](README.md#rest_api_key)
614
-
615
- ### HTTP request headers
616
-
617
- - **Content-Type**: application/json
618
- - **Accept**: application/json
619
-
620
-
621
- ### HTTP response details
622
- | Status code | Description | Response headers |
623
- |-------------|-------------|------------------|
624
- **200** | CREATED | - |
625
- **201** | CREATED | - |
626
- **202** | ACCEPTED | - |
627
- **400** | Bad Request | - |
628
- **409** | Multiple User Identity Conflict | - |
629
- **429** | Rate Limit Exceeded | - |
630
-
631
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
632
-
633
- # **deleteAlias**
634
- > UserIdentityBody deleteAlias()
635
-
636
- Deletes an alias by alias label
637
-
638
- ### Example
639
-
640
-
641
- ```typescript
642
- import { } from '';
643
- import * as fs from 'fs';
644
-
645
- const configuration = .createConfiguration();
646
- const apiInstance = new .DefaultApi(configuration);
647
-
648
- let body:.DefaultApiDeleteAliasRequest = {
649
- // string
650
- appId: "app_id_example",
651
- // string
652
- aliasLabel: "alias_label_example",
653
- // string
654
- aliasId: "alias_id_example",
655
- // string
656
- aliasLabelToDelete: "alias_label_to_delete_example",
657
- };
658
-
659
- apiInstance.deleteAlias(body).then((data:any) => {
660
- console.log('API called successfully. Returned data: ' + data);
661
- }).catch((error:any) => console.error(error));
662
- ```
663
-
664
-
665
- ### Parameters
666
-
667
- Name | Type | Description | Notes
668
- ------------- | ------------- | ------------- | -------------
669
- **appId** | [**string**] | | defaults to undefined
670
- **aliasLabel** | [**string**] | | defaults to undefined
671
- **aliasId** | [**string**] | | defaults to undefined
672
- **aliasLabelToDelete** | [**string**] | | defaults to undefined
673
-
674
-
675
- ### Return type
676
-
677
- **UserIdentityBody**
678
-
679
- ### Authorization
680
-
681
- [rest_api_key](README.md#rest_api_key)
682
-
683
- ### HTTP request headers
684
-
685
- - **Content-Type**: Not defined
686
- - **Accept**: application/json
687
-
688
-
689
- ### HTTP response details
690
- | Status code | Description | Response headers |
691
- |-------------|-------------|------------------|
692
- **200** | OK | - |
693
- **400** | Bad Request | - |
694
- **404** | Not Found | - |
695
- **409** | Conflict | - |
696
- **429** | Rate Limit Exceeded | - |
697
-
698
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
699
-
700
- # **deleteSegment**
701
- > GenericSuccessBoolResponse deleteSegment()
702
-
703
- 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.
704
-
705
- ### Example
706
-
707
-
708
- ```typescript
709
- import { } from '';
710
- import * as fs from 'fs';
711
-
712
- const configuration = .createConfiguration();
713
- const apiInstance = new .DefaultApi(configuration);
714
-
715
- let body:.DefaultApiDeleteSegmentRequest = {
716
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
717
- appId: "app_id_example",
718
- // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
719
- segmentId: "segment_id_example",
720
- };
721
-
722
- apiInstance.deleteSegment(body).then((data:any) => {
723
- console.log('API called successfully. Returned data: ' + data);
724
- }).catch((error:any) => console.error(error));
725
- ```
726
-
727
-
728
- ### Parameters
729
-
730
- Name | Type | Description | Notes
731
- ------------- | ------------- | ------------- | -------------
732
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined
733
- **segmentId** | [**string**] | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | defaults to undefined
734
-
735
-
736
- ### Return type
737
-
738
- **GenericSuccessBoolResponse**
739
-
740
- ### Authorization
741
-
742
- [rest_api_key](README.md#rest_api_key)
743
-
744
- ### HTTP request headers
745
-
746
- - **Content-Type**: Not defined
747
- - **Accept**: application/json
748
-
749
-
750
- ### HTTP response details
751
- | Status code | Description | Response headers |
752
- |-------------|-------------|------------------|
753
- **200** | OK | - |
754
- **400** | Bad Request | - |
755
- **404** | Not Found | - |
756
- **429** | Rate Limit Exceeded | - |
757
-
758
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
759
-
760
- # **deleteSubscription**
761
- > void deleteSubscription()
762
-
763
- Deletes the Subscription.
764
-
765
- ### Example
766
-
767
-
768
- ```typescript
769
- import { } from '';
770
- import * as fs from 'fs';
771
-
772
- const configuration = .createConfiguration();
773
- const apiInstance = new .DefaultApi(configuration);
774
-
775
- let body:.DefaultApiDeleteSubscriptionRequest = {
776
- // string
777
- appId: "app_id_example",
778
- // string
779
- subscriptionId: "subscription_id_example",
780
- };
781
-
782
- apiInstance.deleteSubscription(body).then((data:any) => {
783
- console.log('API called successfully. Returned data: ' + data);
784
- }).catch((error:any) => console.error(error));
785
- ```
786
-
787
-
788
- ### Parameters
789
-
790
- Name | Type | Description | Notes
791
- ------------- | ------------- | ------------- | -------------
792
- **appId** | [**string**] | | defaults to undefined
793
- **subscriptionId** | [**string**] | | defaults to undefined
794
-
795
-
796
- ### Return type
797
-
798
- **void**
799
-
800
- ### Authorization
801
-
802
- [rest_api_key](README.md#rest_api_key)
803
-
804
- ### HTTP request headers
805
-
806
- - **Content-Type**: Not defined
807
- - **Accept**: application/json
808
-
809
-
810
- ### HTTP response details
811
- | Status code | Description | Response headers |
812
- |-------------|-------------|------------------|
813
- **202** | ACCEPTED | - |
814
- **400** | Bad Request | - |
815
- **404** | Not Found | - |
816
- **409** | Conflict | - |
817
- **429** | Rate Limit Exceeded | - |
818
-
819
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
820
-
821
- # **deleteUser**
822
- > void deleteUser()
823
-
824
- Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
825
-
826
- ### Example
827
-
828
-
829
- ```typescript
830
- import { } from '';
831
- import * as fs from 'fs';
832
-
833
- const configuration = .createConfiguration();
834
- const apiInstance = new .DefaultApi(configuration);
835
-
836
- let body:.DefaultApiDeleteUserRequest = {
837
- // string
838
- appId: "app_id_example",
839
- // string
840
- aliasLabel: "alias_label_example",
841
- // string
842
- aliasId: "alias_id_example",
843
- };
844
-
845
- apiInstance.deleteUser(body).then((data:any) => {
846
- console.log('API called successfully. Returned data: ' + data);
847
- }).catch((error:any) => console.error(error));
848
- ```
849
-
850
-
851
- ### Parameters
852
-
853
- Name | Type | Description | Notes
854
- ------------- | ------------- | ------------- | -------------
855
- **appId** | [**string**] | | defaults to undefined
856
- **aliasLabel** | [**string**] | | defaults to undefined
857
- **aliasId** | [**string**] | | defaults to undefined
858
-
859
-
860
- ### Return type
861
-
862
- **void**
863
-
864
- ### Authorization
865
-
866
- [rest_api_key](README.md#rest_api_key)
867
-
868
- ### HTTP request headers
869
-
870
- - **Content-Type**: Not defined
871
- - **Accept**: application/json
872
-
873
-
874
- ### HTTP response details
875
- | Status code | Description | Response headers |
876
- |-------------|-------------|------------------|
877
- **200** | OK | - |
878
- **400** | Bad Request | - |
879
- **409** | Conflict | - |
880
- **429** | Rate Limit Exceeded | - |
881
-
882
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
883
-
884
- # **exportEvents**
885
- > ExportEventsSuccessResponse exportEvents()
886
-
887
- 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.
888
-
889
- ### Example
890
-
891
-
892
- ```typescript
893
- import { } from '';
894
- import * as fs from 'fs';
895
-
896
- const configuration = .createConfiguration();
897
- const apiInstance = new .DefaultApi(configuration);
898
-
899
- let body:.DefaultApiExportEventsRequest = {
900
- // string | The ID of the notification to export events from.
901
- notificationId: "notification_id_example",
902
- // string | The ID of the app that the notification belongs to.
903
- appId: "app_id_example",
904
- };
905
-
906
- apiInstance.exportEvents(body).then((data:any) => {
907
- console.log('API called successfully. Returned data: ' + data);
908
- }).catch((error:any) => console.error(error));
909
- ```
910
-
911
-
912
- ### Parameters
913
-
914
- Name | Type | Description | Notes
915
- ------------- | ------------- | ------------- | -------------
916
- **notificationId** | [**string**] | The ID of the notification to export events from. | defaults to undefined
917
- **appId** | [**string**] | The ID of the app that the notification belongs to. | defaults to undefined
918
-
919
-
920
- ### Return type
921
-
922
- **ExportEventsSuccessResponse**
923
-
924
- ### Authorization
925
-
926
- [rest_api_key](README.md#rest_api_key)
927
-
928
- ### HTTP request headers
929
-
930
- - **Content-Type**: Not defined
931
- - **Accept**: application/json
932
-
933
-
934
- ### HTTP response details
935
- | Status code | Description | Response headers |
936
- |-------------|-------------|------------------|
937
- **200** | OK | - |
938
- **400** | Bad Request | - |
939
- **404** | Not Found | - |
940
- **429** | Rate Limit Exceeded | - |
941
-
942
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
943
-
944
- # **exportSubscriptions**
945
- > ExportSubscriptionsSuccessResponse exportSubscriptions()
946
-
947
- 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. |
948
-
949
- ### Example
950
-
951
-
952
- ```typescript
953
- import { } from '';
954
- import * as fs from 'fs';
955
-
956
- const configuration = .createConfiguration();
957
- const apiInstance = new .DefaultApi(configuration);
958
-
959
- let body:.DefaultApiExportSubscriptionsRequest = {
960
- // string | The app ID that you want to export devices from
961
- appId: "app_id_example",
962
- // ExportSubscriptionsRequestBody (optional)
963
- exportSubscriptionsRequestBody: {
964
- extra_fields: [
965
- "extra_fields_example",
966
- ],
967
- last_active_since: "last_active_since_example",
968
- segment_name: "segment_name_example",
969
- },
970
- };
971
-
972
- apiInstance.exportSubscriptions(body).then((data:any) => {
973
- console.log('API called successfully. Returned data: ' + data);
974
- }).catch((error:any) => console.error(error));
975
- ```
976
-
977
-
978
- ### Parameters
979
-
980
- Name | Type | Description | Notes
981
- ------------- | ------------- | ------------- | -------------
982
- **exportSubscriptionsRequestBody** | **ExportSubscriptionsRequestBody**| |
983
- **appId** | [**string**] | The app ID that you want to export devices from | defaults to undefined
984
-
985
-
986
- ### Return type
987
-
988
- **ExportSubscriptionsSuccessResponse**
989
-
990
- ### Authorization
991
-
992
- [rest_api_key](README.md#rest_api_key)
993
-
994
- ### HTTP request headers
995
-
996
- - **Content-Type**: application/json
997
- - **Accept**: application/json
998
-
999
-
1000
- ### HTTP response details
1001
- | Status code | Description | Response headers |
1002
- |-------------|-------------|------------------|
1003
- **200** | OK | - |
1004
- **400** | Bad Request | - |
1005
- **429** | Rate Limit Exceeded | - |
1006
-
1007
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1008
-
1009
- # **getAliases**
1010
- > UserIdentityBody getAliases()
1011
-
1012
- Lists all Aliases for the User identified by (:alias_label, :alias_id).
1013
-
1014
- ### Example
1015
-
1016
-
1017
- ```typescript
1018
- import { } from '';
1019
- import * as fs from 'fs';
1020
-
1021
- const configuration = .createConfiguration();
1022
- const apiInstance = new .DefaultApi(configuration);
1023
-
1024
- let body:.DefaultApiGetAliasesRequest = {
1025
- // string
1026
- appId: "app_id_example",
1027
- // string
1028
- aliasLabel: "alias_label_example",
1029
- // string
1030
- aliasId: "alias_id_example",
1031
- };
1032
-
1033
- apiInstance.getAliases(body).then((data:any) => {
1034
- console.log('API called successfully. Returned data: ' + data);
1035
- }).catch((error:any) => console.error(error));
1036
- ```
1037
-
1038
-
1039
- ### Parameters
1040
-
1041
- Name | Type | Description | Notes
1042
- ------------- | ------------- | ------------- | -------------
1043
- **appId** | [**string**] | | defaults to undefined
1044
- **aliasLabel** | [**string**] | | defaults to undefined
1045
- **aliasId** | [**string**] | | defaults to undefined
1046
-
1047
-
1048
- ### Return type
1049
-
1050
- **UserIdentityBody**
1051
-
1052
- ### Authorization
1053
-
1054
- [rest_api_key](README.md#rest_api_key)
1055
-
1056
- ### HTTP request headers
1057
-
1058
- - **Content-Type**: Not defined
1059
- - **Accept**: application/json
1060
-
1061
-
1062
- ### HTTP response details
1063
- | Status code | Description | Response headers |
1064
- |-------------|-------------|------------------|
1065
- **200** | OK | - |
1066
- **400** | Bad Request | - |
1067
- **404** | Not Found | - |
1068
- **429** | Rate Limit Exceeded | - |
1069
-
1070
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1071
-
1072
- # **getAliasesBySubscription**
1073
- > UserIdentityBody getAliasesBySubscription()
1074
-
1075
- Lists all Aliases for the User identified by :subscription_id.
1076
-
1077
- ### Example
1078
-
1079
-
1080
- ```typescript
1081
- import { } from '';
1082
- import * as fs from 'fs';
1083
-
1084
- const configuration = .createConfiguration();
1085
- const apiInstance = new .DefaultApi(configuration);
1086
-
1087
- let body:.DefaultApiGetAliasesBySubscriptionRequest = {
1088
- // string
1089
- appId: "app_id_example",
1090
- // string
1091
- subscriptionId: "subscription_id_example",
1092
- };
1093
-
1094
- apiInstance.getAliasesBySubscription(body).then((data:any) => {
1095
- console.log('API called successfully. Returned data: ' + data);
1096
- }).catch((error:any) => console.error(error));
1097
- ```
1098
-
1099
-
1100
- ### Parameters
1101
-
1102
- Name | Type | Description | Notes
1103
- ------------- | ------------- | ------------- | -------------
1104
- **appId** | [**string**] | | defaults to undefined
1105
- **subscriptionId** | [**string**] | | defaults to undefined
1106
-
1107
-
1108
- ### Return type
1109
-
1110
- **UserIdentityBody**
1111
-
1112
- ### Authorization
1113
-
1114
- [rest_api_key](README.md#rest_api_key)
1115
-
1116
- ### HTTP request headers
1117
-
1118
- - **Content-Type**: Not defined
1119
- - **Accept**: application/json
1120
-
1121
-
1122
- ### HTTP response details
1123
- | Status code | Description | Response headers |
1124
- |-------------|-------------|------------------|
1125
- **200** | OK | - |
1126
- **400** | Bad Request | - |
1127
- **404** | Not Found | - |
1128
-
1129
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1130
-
1131
- # **getApp**
1132
- > App getApp()
1133
-
1134
- View the details of a single OneSignal app
1135
-
1136
- ### Example
1137
-
1138
-
1139
- ```typescript
1140
- import { } from '';
1141
- import * as fs from 'fs';
1142
-
1143
- const configuration = .createConfiguration();
1144
- const apiInstance = new .DefaultApi(configuration);
1145
-
1146
- let body:.DefaultApiGetAppRequest = {
1147
- // string | An app id
1148
- appId: "app_id_example",
1149
- };
1150
-
1151
- apiInstance.getApp(body).then((data:any) => {
1152
- console.log('API called successfully. Returned data: ' + data);
1153
- }).catch((error:any) => console.error(error));
1154
- ```
1155
-
1156
-
1157
- ### Parameters
1158
-
1159
- Name | Type | Description | Notes
1160
- ------------- | ------------- | ------------- | -------------
1161
- **appId** | [**string**] | An app id | defaults to undefined
1162
-
1163
-
1164
- ### Return type
1165
-
1166
- **App**
1167
-
1168
- ### Authorization
1169
-
1170
- [organization_api_key](README.md#organization_api_key)
1171
-
1172
- ### HTTP request headers
1173
-
1174
- - **Content-Type**: Not defined
1175
- - **Accept**: application/json
1176
-
1177
-
1178
- ### HTTP response details
1179
- | Status code | Description | Response headers |
1180
- |-------------|-------------|------------------|
1181
- **200** | OK | - |
1182
- **400** | Bad Request | - |
1183
- **429** | Rate Limit Exceeded | - |
1184
-
1185
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1186
-
1187
- # **getApps**
1188
- > Array<App> getApps()
1189
-
1190
- View the details of all of your current OneSignal apps
1191
-
1192
- ### Example
1193
-
1194
-
1195
- ```typescript
1196
- import { } from '';
1197
- import * as fs from 'fs';
1198
-
1199
- const configuration = .createConfiguration();
1200
- const apiInstance = new .DefaultApi(configuration);
1201
-
1202
- let body:any = {};
1203
-
1204
- apiInstance.getApps(body).then((data:any) => {
1205
- console.log('API called successfully. Returned data: ' + data);
1206
- }).catch((error:any) => console.error(error));
1207
- ```
1208
-
1209
-
1210
- ### Parameters
1211
- This endpoint does not need any parameter.
1212
-
1213
-
1214
- ### Return type
1215
-
1216
- **Array<App>**
1217
-
1218
- ### Authorization
1219
-
1220
- [organization_api_key](README.md#organization_api_key)
1221
-
1222
- ### HTTP request headers
1223
-
1224
- - **Content-Type**: Not defined
1225
- - **Accept**: application/json
1226
-
1227
-
1228
- ### HTTP response details
1229
- | Status code | Description | Response headers |
1230
- |-------------|-------------|------------------|
1231
- **200** | OK | - |
1232
- **400** | Bad Request | - |
1233
- **429** | Rate Limit Exceeded | - |
1234
-
1235
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1236
-
1237
- # **getNotification**
1238
- > NotificationWithMeta getNotification()
1239
-
1240
- View the details of a single notification and outcomes associated with it
1241
-
1242
- ### Example
1243
-
1244
-
1245
- ```typescript
1246
- import { } from '';
1247
- import * as fs from 'fs';
1248
-
1249
- const configuration = .createConfiguration();
1250
- const apiInstance = new .DefaultApi(configuration);
1251
-
1252
- let body:.DefaultApiGetNotificationRequest = {
1253
- // string
1254
- appId: "app_id_example",
1255
- // string
1256
- notificationId: "notification_id_example",
1257
- };
1258
-
1259
- apiInstance.getNotification(body).then((data:any) => {
1260
- console.log('API called successfully. Returned data: ' + data);
1261
- }).catch((error:any) => console.error(error));
1262
- ```
1263
-
1264
-
1265
- ### Parameters
1266
-
1267
- Name | Type | Description | Notes
1268
- ------------- | ------------- | ------------- | -------------
1269
- **appId** | [**string**] | | defaults to undefined
1270
- **notificationId** | [**string**] | | defaults to undefined
1271
-
1272
-
1273
- ### Return type
1274
-
1275
- **NotificationWithMeta**
1276
-
1277
- ### Authorization
1278
-
1279
- [rest_api_key](README.md#rest_api_key)
1280
-
1281
- ### HTTP request headers
1282
-
1283
- - **Content-Type**: Not defined
1284
- - **Accept**: application/json
1285
-
1286
-
1287
- ### HTTP response details
1288
- | Status code | Description | Response headers |
1289
- |-------------|-------------|------------------|
1290
- **200** | OK | - |
1291
- **400** | Bad Request | - |
1292
- **404** | Not Found | - |
1293
- **429** | Rate Limit Exceeded | - |
1294
-
1295
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1296
-
1297
- # **getNotificationHistory**
1298
- > NotificationHistorySuccessResponse getNotificationHistory(getNotificationHistoryRequestBody)
1299
-
1300
- -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App\'s REST API Key, available in Keys & IDs.
1301
-
1302
- ### Example
1303
-
1304
-
1305
- ```typescript
1306
- import { } from '';
1307
- import * as fs from 'fs';
1308
-
1309
- const configuration = .createConfiguration();
1310
- const apiInstance = new .DefaultApi(configuration);
1311
-
1312
- let body:.DefaultApiGetNotificationHistoryRequest = {
1313
- // string | The \"id\" of the message found in the Notification object
1314
- notificationId: "notification_id_example",
1315
- // GetNotificationHistoryRequestBody
1316
- getNotificationHistoryRequestBody: {
1317
- events: "sent",
1318
- email: "email_example",
1319
- app_id: "app_id_example",
1320
- },
1321
- };
1322
-
1323
- apiInstance.getNotificationHistory(body).then((data:any) => {
1324
- console.log('API called successfully. Returned data: ' + data);
1325
- }).catch((error:any) => console.error(error));
1326
- ```
1327
-
1328
-
1329
- ### Parameters
1330
-
1331
- Name | Type | Description | Notes
1332
- ------------- | ------------- | ------------- | -------------
1333
- **getNotificationHistoryRequestBody** | **GetNotificationHistoryRequestBody**| |
1334
- **notificationId** | [**string**] | The \&quot;id\&quot; of the message found in the Notification object | defaults to undefined
1335
-
1336
-
1337
- ### Return type
1338
-
1339
- **NotificationHistorySuccessResponse**
1340
-
1341
- ### Authorization
1342
-
1343
- [rest_api_key](README.md#rest_api_key)
1344
-
1345
- ### HTTP request headers
1346
-
1347
- - **Content-Type**: application/json
1348
- - **Accept**: application/json
1349
-
1350
-
1351
- ### HTTP response details
1352
- | Status code | Description | Response headers |
1353
- |-------------|-------------|------------------|
1354
- **200** | OK | - |
1355
- **400** | Bad Request | - |
1356
- **404** | Not Found | - |
1357
- **429** | Rate Limit Exceeded | - |
1358
-
1359
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1360
-
1361
- # **getNotifications**
1362
- > NotificationSlice getNotifications()
1363
-
1364
- View the details of multiple notifications
1365
-
1366
- ### Example
1367
-
1368
-
1369
- ```typescript
1370
- import { } from '';
1371
- import * as fs from 'fs';
1372
-
1373
- const configuration = .createConfiguration();
1374
- const apiInstance = new .DefaultApi(configuration);
1375
-
1376
- let body:.DefaultApiGetNotificationsRequest = {
1377
- // string | The app ID that you want to view notifications from
1378
- appId: "app_id_example",
1379
- // number | How many notifications to return. Max is 50. Default is 50. (optional)
1380
- limit: 1,
1381
- // number | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional)
1382
- offset: 1,
1383
- // 0 | 1 | 3 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional)
1384
- kind: 0,
1385
- };
1386
-
1387
- apiInstance.getNotifications(body).then((data:any) => {
1388
- console.log('API called successfully. Returned data: ' + data);
1389
- }).catch((error:any) => console.error(error));
1390
- ```
1391
-
1392
-
1393
- ### Parameters
1394
-
1395
- Name | Type | Description | Notes
1396
- ------------- | ------------- | ------------- | -------------
1397
- **appId** | [**string**] | The app ID that you want to view notifications from | defaults to undefined
1398
- **limit** | [**number**] | How many notifications to return. Max is 50. Default is 50. | (optional) defaults to undefined
1399
- **offset** | [**number**] | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | (optional) defaults to undefined
1400
- **kind** | [**0 | 1 | 3**]**Array<0 &#124; 1 &#124; 3>** | Kind of notifications returned: * unset - All notification types (default) * &#x60;0&#x60; - Dashboard only * &#x60;1&#x60; - API only * &#x60;3&#x60; - Automated only | (optional) defaults to undefined
1401
-
1402
-
1403
- ### Return type
1404
-
1405
- **NotificationSlice**
1406
-
1407
- ### Authorization
1408
-
1409
- [rest_api_key](README.md#rest_api_key)
1410
-
1411
- ### HTTP request headers
1412
-
1413
- - **Content-Type**: Not defined
1414
- - **Accept**: application/json
1415
-
1416
-
1417
- ### HTTP response details
1418
- | Status code | Description | Response headers |
1419
- |-------------|-------------|------------------|
1420
- **200** | OK | - |
1421
- **400** | Bad Request | - |
1422
- **429** | Rate Limit Exceeded | - |
1423
-
1424
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1425
-
1426
- # **getOutcomes**
1427
- > OutcomesData getOutcomes()
1428
-
1429
- View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it.
1430
-
1431
- ### Example
1432
-
1433
-
1434
- ```typescript
1435
- import { } from '';
1436
- import * as fs from 'fs';
1437
-
1438
- const configuration = .createConfiguration();
1439
- const apiInstance = new .DefaultApi(configuration);
1440
-
1441
- let body:.DefaultApiGetOutcomesRequest = {
1442
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1443
- appId: "app_id_example",
1444
- // string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum
1445
- outcomeNames: "outcome_names_example",
1446
- // string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional)
1447
- outcomeNames2: "outcome_names[]_example",
1448
- // string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional)
1449
- outcomeTimeRange: "outcome_time_range_example",
1450
- // string | Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional)
1451
- outcomePlatforms: "outcome_platforms_example",
1452
- // string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional)
1453
- outcomeAttribution: "outcome_attribution_example",
1454
- };
1455
-
1456
- apiInstance.getOutcomes(body).then((data:any) => {
1457
- console.log('API called successfully. Returned data: ' + data);
1458
- }).catch((error:any) => console.error(error));
1459
- ```
1460
-
1461
-
1462
- ### Parameters
1463
-
1464
- Name | Type | Description | Notes
1465
- ------------- | ------------- | ------------- | -------------
1466
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1467
- **outcomeNames** | [**string**] | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \&quot;os\&quot; prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | defaults to undefined
1468
- **outcomeNames2** | [**string**] | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; is the custom outcomes with a comma in the name. | (optional) defaults to undefined
1469
- **outcomeTimeRange** | [**string**] | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | (optional) defaults to undefined
1470
- **outcomePlatforms** | [**string**] | Optional Platform id. Refer device\&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | (optional) defaults to undefined
1471
- **outcomeAttribution** | [**string**] | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | (optional) defaults to undefined
1472
-
1473
-
1474
- ### Return type
1475
-
1476
- **OutcomesData**
1477
-
1478
- ### Authorization
1479
-
1480
- [rest_api_key](README.md#rest_api_key)
1481
-
1482
- ### HTTP request headers
1483
-
1484
- - **Content-Type**: Not defined
1485
- - **Accept**: application/json
1486
-
1487
-
1488
- ### HTTP response details
1489
- | Status code | Description | Response headers |
1490
- |-------------|-------------|------------------|
1491
- **200** | OK | - |
1492
- **400** | Bad Request | - |
1493
- **429** | Rate Limit Exceeded | - |
1494
-
1495
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1496
-
1497
- # **getSegments**
1498
- > GetSegmentsSuccessResponse getSegments()
1499
-
1500
- Returns an array of segments from an app.
1501
-
1502
- ### Example
1503
-
1504
-
1505
- ```typescript
1506
- import { } from '';
1507
- import * as fs from 'fs';
1508
-
1509
- const configuration = .createConfiguration();
1510
- const apiInstance = new .DefaultApi(configuration);
1511
-
1512
- let body:.DefaultApiGetSegmentsRequest = {
1513
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1514
- appId: "app_id_example",
1515
- // number | 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)
1516
- offset: 1,
1517
- // number | The amount of Segments in the response. Maximum 300. (optional)
1518
- limit: 1,
1519
- };
1520
-
1521
- apiInstance.getSegments(body).then((data:any) => {
1522
- console.log('API called successfully. Returned data: ' + data);
1523
- }).catch((error:any) => console.error(error));
1524
- ```
1525
-
1526
-
1527
- ### Parameters
1528
-
1529
- Name | Type | Description | Notes
1530
- ------------- | ------------- | ------------- | -------------
1531
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1532
- **offset** | [**number**] | 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) defaults to undefined
1533
- **limit** | [**number**] | The amount of Segments in the response. Maximum 300. | (optional) defaults to undefined
1534
-
1535
-
1536
- ### Return type
1537
-
1538
- **GetSegmentsSuccessResponse**
1539
-
1540
- ### Authorization
1541
-
1542
- [rest_api_key](README.md#rest_api_key)
1543
-
1544
- ### HTTP request headers
1545
-
1546
- - **Content-Type**: Not defined
1547
- - **Accept**: application/json
1548
-
1549
-
1550
- ### HTTP response details
1551
- | Status code | Description | Response headers |
1552
- |-------------|-------------|------------------|
1553
- **201** | OK | - |
1554
- **400** | Bad Request | - |
1555
- **429** | Rate Limit Exceeded | - |
1556
-
1557
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1558
-
1559
- # **getUser**
1560
- > User getUser()
1561
-
1562
- Returns the User’s properties, Aliases, and Subscriptions.
1563
-
1564
- ### Example
1565
-
1566
-
1567
- ```typescript
1568
- import { } from '';
1569
- import * as fs from 'fs';
1570
-
1571
- const configuration = .createConfiguration();
1572
- const apiInstance = new .DefaultApi(configuration);
1573
-
1574
- let body:.DefaultApiGetUserRequest = {
1575
- // string
1576
- appId: "app_id_example",
1577
- // string
1578
- aliasLabel: "alias_label_example",
1579
- // string
1580
- aliasId: "alias_id_example",
1581
- };
1582
-
1583
- apiInstance.getUser(body).then((data:any) => {
1584
- console.log('API called successfully. Returned data: ' + data);
1585
- }).catch((error:any) => console.error(error));
1586
- ```
1587
-
1588
-
1589
- ### Parameters
1590
-
1591
- Name | Type | Description | Notes
1592
- ------------- | ------------- | ------------- | -------------
1593
- **appId** | [**string**] | | defaults to undefined
1594
- **aliasLabel** | [**string**] | | defaults to undefined
1595
- **aliasId** | [**string**] | | defaults to undefined
1596
-
1597
-
1598
- ### Return type
1599
-
1600
- **User**
1601
-
1602
- ### Authorization
1603
-
1604
- [rest_api_key](README.md#rest_api_key)
1605
-
1606
- ### HTTP request headers
1607
-
1608
- - **Content-Type**: Not defined
1609
- - **Accept**: application/json
1610
-
1611
-
1612
- ### HTTP response details
1613
- | Status code | Description | Response headers |
1614
- |-------------|-------------|------------------|
1615
- **200** | OK | - |
1616
- **400** | Bad Request | - |
1617
- **404** | Not Found | - |
1618
- **429** | Rate Limit Exceeded | - |
1619
-
1620
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1621
-
1622
- # **transferSubscription**
1623
- > UserIdentityBody transferSubscription(transferSubscriptionRequestBody)
1624
-
1625
- Transfers this Subscription to the User identified by the identity in the payload.
1626
-
1627
- ### Example
1628
-
1629
-
1630
- ```typescript
1631
- import { } from '';
1632
- import * as fs from 'fs';
1633
-
1634
- const configuration = .createConfiguration();
1635
- const apiInstance = new .DefaultApi(configuration);
1636
-
1637
- let body:.DefaultApiTransferSubscriptionRequest = {
1638
- // string
1639
- appId: "app_id_example",
1640
- // string
1641
- subscriptionId: "subscription_id_example",
1642
- // TransferSubscriptionRequestBody
1643
- transferSubscriptionRequestBody: {
1644
- identity: {
1645
- "key": "key_example",
1646
- },
1647
- },
1648
- };
1649
-
1650
- apiInstance.transferSubscription(body).then((data:any) => {
1651
- console.log('API called successfully. Returned data: ' + data);
1652
- }).catch((error:any) => console.error(error));
1653
- ```
1654
-
1655
-
1656
- ### Parameters
1657
-
1658
- Name | Type | Description | Notes
1659
- ------------- | ------------- | ------------- | -------------
1660
- **transferSubscriptionRequestBody** | **TransferSubscriptionRequestBody**| |
1661
- **appId** | [**string**] | | defaults to undefined
1662
- **subscriptionId** | [**string**] | | defaults to undefined
1663
-
1664
-
1665
- ### Return type
1666
-
1667
- **UserIdentityBody**
1668
-
1669
- ### Authorization
1670
-
1671
- [rest_api_key](README.md#rest_api_key)
1672
-
1673
- ### HTTP request headers
1674
-
1675
- - **Content-Type**: application/json
1676
- - **Accept**: application/json
1677
-
1678
-
1679
- ### HTTP response details
1680
- | Status code | Description | Response headers |
1681
- |-------------|-------------|------------------|
1682
- **200** | OK | - |
1683
- **400** | Bad Request | - |
1684
- **404** | Not Found | - |
1685
- **409** | Conflict | - |
1686
- **429** | Rate Limit Exceeded | - |
1687
-
1688
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1689
-
1690
- # **unsubscribeEmailWithToken**
1691
- > GenericSuccessBoolResponse unsubscribeEmailWithToken()
1692
-
1693
- Unsubscribe an email with a token when using your own custom email unsubscribe landing page
1694
-
1695
- ### Example
1696
-
1697
-
1698
- ```typescript
1699
- import { } from '';
1700
- import * as fs from 'fs';
1701
-
1702
- const configuration = .createConfiguration();
1703
- const apiInstance = new .DefaultApi(configuration);
1704
-
1705
- let body:.DefaultApiUnsubscribeEmailWithTokenRequest = {
1706
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1707
- appId: "app_id_example",
1708
- // string | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
1709
- notificationId: "notification_id_example",
1710
- // string | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
1711
- token: "token_example",
1712
- };
1713
-
1714
- apiInstance.unsubscribeEmailWithToken(body).then((data:any) => {
1715
- console.log('API called successfully. Returned data: ' + data);
1716
- }).catch((error:any) => console.error(error));
1717
- ```
1718
-
1719
-
1720
- ### Parameters
1721
-
1722
- Name | Type | Description | Notes
1723
- ------------- | ------------- | ------------- | -------------
1724
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1725
- **notificationId** | [**string**] | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | defaults to undefined
1726
- **token** | [**string**] | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | defaults to undefined
1727
-
1728
-
1729
- ### Return type
1730
-
1731
- **GenericSuccessBoolResponse**
1732
-
1733
- ### Authorization
1734
-
1735
- [rest_api_key](README.md#rest_api_key)
1736
-
1737
- ### HTTP request headers
1738
-
1739
- - **Content-Type**: Not defined
1740
- - **Accept**: application/json
1741
-
1742
-
1743
- ### HTTP response details
1744
- | Status code | Description | Response headers |
1745
- |-------------|-------------|------------------|
1746
- **202** | OK | - |
1747
- **400** | Bad Request | - |
1748
- **429** | Rate Limit Exceeded | - |
1749
-
1750
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1751
-
1752
- # **updateApp**
1753
- > App updateApp(app)
1754
-
1755
- Updates the name or configuration settings of an existing OneSignal app
1756
-
1757
- ### Example
1758
-
1759
-
1760
- ```typescript
1761
- import { } from '';
1762
- import * as fs from 'fs';
1763
-
1764
- const configuration = .createConfiguration();
1765
- const apiInstance = new .DefaultApi(configuration);
1766
-
1767
- let body:.DefaultApiUpdateAppRequest = {
1768
- // string | An app id
1769
- appId: "app_id_example",
1770
- // App
1771
- app: {
1772
- name: "name_example",
1773
- android_gcm_sender_id: "android_gcm_sender_id_example",
1774
- gcm_key: "gcm_key_example",
1775
- chrome_web_origin: "chrome_web_origin_example",
1776
- chrome_key: "chrome_key_example",
1777
- chrome_web_default_notification_icon: "chrome_web_default_notification_icon_example",
1778
- chrome_web_sub_domain: "chrome_web_sub_domain_example",
1779
- apns_env: "sandbox",
1780
- apns_p12: "apns_p12_example",
1781
- apns_p12_password: "apns_p12_password_example",
1782
- safari_apns_p12: "safari_apns_p12_example",
1783
- safari_apns_p12_password: "safari_apns_p12_password_example",
1784
- apns_key_id: "apns_key_id_example",
1785
- apns_team_id: "apns_team_id_example",
1786
- apns_bundle_id: "apns_bundle_id_example",
1787
- apns_p8: "apns_p8_example",
1788
- safari_site_origin: "safari_site_origin_example",
1789
- safari_icon_256_256: "safari_icon_256_256_example",
1790
- site_name: "site_name_example",
1791
- organization_id: "organization_id_example",
1792
- additional_data_is_root_payload: true,
1793
- },
1794
- };
1795
-
1796
- apiInstance.updateApp(body).then((data:any) => {
1797
- console.log('API called successfully. Returned data: ' + data);
1798
- }).catch((error:any) => console.error(error));
1799
- ```
1800
-
1801
-
1802
- ### Parameters
1803
-
1804
- Name | Type | Description | Notes
1805
- ------------- | ------------- | ------------- | -------------
1806
- **app** | **App**| |
1807
- **appId** | [**string**] | An app id | defaults to undefined
1808
-
1809
-
1810
- ### Return type
1811
-
1812
- **App**
1813
-
1814
- ### Authorization
1815
-
1816
- [organization_api_key](README.md#organization_api_key)
1817
-
1818
- ### HTTP request headers
1819
-
1820
- - **Content-Type**: application/json
1821
- - **Accept**: application/json
1822
-
1823
-
1824
- ### HTTP response details
1825
- | Status code | Description | Response headers |
1826
- |-------------|-------------|------------------|
1827
- **200** | OK | - |
1828
- **400** | Bad Request | - |
1829
- **429** | Rate Limit Exceeded | - |
1830
-
1831
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1832
-
1833
- # **updateLiveActivity**
1834
- > UpdateLiveActivitySuccessResponse updateLiveActivity(updateLiveActivityRequest)
1835
-
1836
- Updates a specified live activity.
1837
-
1838
- ### Example
1839
-
1840
-
1841
- ```typescript
1842
- import { } from '';
1843
- import * as fs from 'fs';
1844
-
1845
- const configuration = .createConfiguration();
1846
- const apiInstance = new .DefaultApi(configuration);
1847
-
1848
- let body:.DefaultApiUpdateLiveActivityRequest = {
1849
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1850
- appId: "app_id_example",
1851
- // string | Live Activity record ID
1852
- activityId: "activity_id_example",
1853
- // UpdateLiveActivityRequest
1854
- updateLiveActivityRequest: {
1855
- name: "name_example",
1856
- event: "update",
1857
- event_updates: {},
1858
- contents: {
1859
- en: "en_example",
1860
- ar: "ar_example",
1861
- bs: "bs_example",
1862
- bg: "bg_example",
1863
- ca: "ca_example",
1864
- zh_hans: "zh_hans_example",
1865
- zh_hant: "zh_hant_example",
1866
- zh: "zh_example",
1867
- hr: "hr_example",
1868
- cs: "cs_example",
1869
- da: "da_example",
1870
- nl: "nl_example",
1871
- et: "et_example",
1872
- fi: "fi_example",
1873
- fr: "fr_example",
1874
- ka: "ka_example",
1875
- de: "de_example",
1876
- el: "el_example",
1877
- hi: "hi_example",
1878
- he: "he_example",
1879
- hu: "hu_example",
1880
- id: "id_example",
1881
- it: "it_example",
1882
- ja: "ja_example",
1883
- ko: "ko_example",
1884
- lv: "lv_example",
1885
- lt: "lt_example",
1886
- ms: "ms_example",
1887
- nb: "nb_example",
1888
- pl: "pl_example",
1889
- fa: "fa_example",
1890
- pt: "pt_example",
1891
- pa: "pa_example",
1892
- ro: "ro_example",
1893
- ru: "ru_example",
1894
- sr: "sr_example",
1895
- sk: "sk_example",
1896
- es: "es_example",
1897
- sv: "sv_example",
1898
- th: "th_example",
1899
- tr: "tr_example",
1900
- uk: "uk_example",
1901
- vi: "vi_example",
1902
- },
1903
- headings: {
1904
- en: "en_example",
1905
- ar: "ar_example",
1906
- bs: "bs_example",
1907
- bg: "bg_example",
1908
- ca: "ca_example",
1909
- zh_hans: "zh_hans_example",
1910
- zh_hant: "zh_hant_example",
1911
- zh: "zh_example",
1912
- hr: "hr_example",
1913
- cs: "cs_example",
1914
- da: "da_example",
1915
- nl: "nl_example",
1916
- et: "et_example",
1917
- fi: "fi_example",
1918
- fr: "fr_example",
1919
- ka: "ka_example",
1920
- de: "de_example",
1921
- el: "el_example",
1922
- hi: "hi_example",
1923
- he: "he_example",
1924
- hu: "hu_example",
1925
- id: "id_example",
1926
- it: "it_example",
1927
- ja: "ja_example",
1928
- ko: "ko_example",
1929
- lv: "lv_example",
1930
- lt: "lt_example",
1931
- ms: "ms_example",
1932
- nb: "nb_example",
1933
- pl: "pl_example",
1934
- fa: "fa_example",
1935
- pt: "pt_example",
1936
- pa: "pa_example",
1937
- ro: "ro_example",
1938
- ru: "ru_example",
1939
- sr: "sr_example",
1940
- sk: "sk_example",
1941
- es: "es_example",
1942
- sv: "sv_example",
1943
- th: "th_example",
1944
- tr: "tr_example",
1945
- uk: "uk_example",
1946
- vi: "vi_example",
1947
- },
1948
- sound: "sound_example",
1949
- stale_date: 1,
1950
- dismissal_date: 1,
1951
- priority: 1,
1952
- },
1953
- };
1954
-
1955
- apiInstance.updateLiveActivity(body).then((data:any) => {
1956
- console.log('API called successfully. Returned data: ' + data);
1957
- }).catch((error:any) => console.error(error));
1958
- ```
1959
-
1960
-
1961
- ### Parameters
1962
-
1963
- Name | Type | Description | Notes
1964
- ------------- | ------------- | ------------- | -------------
1965
- **updateLiveActivityRequest** | **UpdateLiveActivityRequest**| |
1966
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1967
- **activityId** | [**string**] | Live Activity record ID | defaults to undefined
1968
-
1969
-
1970
- ### Return type
1971
-
1972
- **UpdateLiveActivitySuccessResponse**
1973
-
1974
- ### Authorization
1975
-
1976
- [rest_api_key](README.md#rest_api_key)
1977
-
1978
- ### HTTP request headers
1979
-
1980
- - **Content-Type**: application/json
1981
- - **Accept**: application/json
1982
-
1983
-
1984
- ### HTTP response details
1985
- | Status code | Description | Response headers |
1986
- |-------------|-------------|------------------|
1987
- **200** | OK | - |
1988
- **400** | Bad Request | - |
1989
- **429** | Rate Limit Exceeded | - |
1990
-
1991
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1992
-
1993
- # **updateSubscription**
1994
- > void updateSubscription(subscriptionBody)
1995
-
1996
- Updates an existing Subscription’s properties.
1997
-
1998
- ### Example
1999
-
2000
-
2001
- ```typescript
2002
- import { } from '';
2003
- import * as fs from 'fs';
2004
-
2005
- const configuration = .createConfiguration();
2006
- const apiInstance = new .DefaultApi(configuration);
2007
-
2008
- let body:.DefaultApiUpdateSubscriptionRequest = {
2009
- // string
2010
- appId: "app_id_example",
2011
- // string
2012
- subscriptionId: "subscription_id_example",
2013
- // SubscriptionBody
2014
- subscriptionBody: {
2015
- subscription: {
2016
- id: "id_example",
2017
- type: "iOSPush",
2018
- token: "token_example",
2019
- enabled: true,
2020
- notification_types: 1,
2021
- session_time: 1,
2022
- session_count: 1,
2023
- sdk: "sdk_example",
2024
- device_model: "device_model_example",
2025
- device_os: "device_os_example",
2026
- rooted: true,
2027
- test_type: 1,
2028
- app_version: "app_version_example",
2029
- net_type: 1,
2030
- carrier: "carrier_example",
2031
- web_auth: "web_auth_example",
2032
- web_p256: "web_p256_example",
2033
- },
2034
- },
2035
- };
2036
-
2037
- apiInstance.updateSubscription(body).then((data:any) => {
2038
- console.log('API called successfully. Returned data: ' + data);
2039
- }).catch((error:any) => console.error(error));
2040
- ```
2041
-
2042
-
2043
- ### Parameters
2044
-
2045
- Name | Type | Description | Notes
2046
- ------------- | ------------- | ------------- | -------------
2047
- **subscriptionBody** | **SubscriptionBody**| |
2048
- **appId** | [**string**] | | defaults to undefined
2049
- **subscriptionId** | [**string**] | | defaults to undefined
2050
-
2051
-
2052
- ### Return type
2053
-
2054
- **void**
2055
-
2056
- ### Authorization
2057
-
2058
- [rest_api_key](README.md#rest_api_key)
2059
-
2060
- ### HTTP request headers
2061
-
2062
- - **Content-Type**: application/json
2063
- - **Accept**: application/json
2064
-
2065
-
2066
- ### HTTP response details
2067
- | Status code | Description | Response headers |
2068
- |-------------|-------------|------------------|
2069
- **200** | OK | - |
2070
- **400** | Bad Request | - |
2071
- **404** | Not Found | - |
2072
- **409** | Conflict | - |
2073
- **429** | Rate Limit Exceeded | - |
2074
-
2075
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
2076
-
2077
- # **updateUser**
2078
- > PropertiesBody updateUser(updateUserRequest)
2079
-
2080
- Updates an existing User’s properties.
2081
-
2082
- ### Example
2083
-
2084
-
2085
- ```typescript
2086
- import { } from '';
2087
- import * as fs from 'fs';
2088
-
2089
- const configuration = .createConfiguration();
2090
- const apiInstance = new .DefaultApi(configuration);
2091
-
2092
- let body:.DefaultApiUpdateUserRequest = {
2093
- // string
2094
- appId: "app_id_example",
2095
- // string
2096
- aliasLabel: "alias_label_example",
2097
- // string
2098
- aliasId: "alias_id_example",
2099
- // UpdateUserRequest
2100
- updateUserRequest: {
2101
- properties: {
2102
- tags: {},
2103
- language: "language_example",
2104
- timezone_id: "timezone_id_example",
2105
- lat: 3.14,
2106
- long: 3.14,
2107
- country: "country_example",
2108
- first_active: 1,
2109
- last_active: 1,
2110
- amount_spent: 3.14,
2111
- purchases: [
2112
- {
2113
- sku: "sku_example",
2114
- amount: "amount_example",
2115
- iso: "iso_example",
2116
- count: 1,
2117
- },
2118
- ],
2119
- ip: "ip_example",
2120
- },
2121
- refresh_device_metadata: false,
2122
- deltas: {
2123
- session_time: 1,
2124
- session_count: 1,
2125
- purchases: [
2126
- {
2127
- sku: "sku_example",
2128
- amount: "amount_example",
2129
- iso: "iso_example",
2130
- count: 1,
2131
- },
2132
- ],
2133
- },
2134
- },
2135
- };
2136
-
2137
- apiInstance.updateUser(body).then((data:any) => {
2138
- console.log('API called successfully. Returned data: ' + data);
2139
- }).catch((error:any) => console.error(error));
2140
- ```
2141
-
2142
-
2143
- ### Parameters
2144
-
2145
- Name | Type | Description | Notes
2146
- ------------- | ------------- | ------------- | -------------
2147
- **updateUserRequest** | **UpdateUserRequest**| |
2148
- **appId** | [**string**] | | defaults to undefined
2149
- **aliasLabel** | [**string**] | | defaults to undefined
2150
- **aliasId** | [**string**] | | defaults to undefined
2151
-
2152
-
2153
- ### Return type
2154
-
2155
- **PropertiesBody**
2156
-
2157
- ### Authorization
2158
-
2159
- [rest_api_key](README.md#rest_api_key)
2160
-
2161
- ### HTTP request headers
2162
-
2163
- - **Content-Type**: application/json
2164
- - **Accept**: application/json
2165
-
2166
-
2167
- ### HTTP response details
2168
- | Status code | Description | Response headers |
2169
- |-------------|-------------|------------------|
2170
- **202** | ACCEPTED | - |
2171
- **400** | Bad Request | - |
2172
- **409** | Conflict | - |
2173
- **429** | Rate Limit Exceeded | - |
2174
-
2175
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
2176
-
2177
-