@onesignal/node-onesignal 5.3.0-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 (184) hide show
  1. package/dist/apis/DefaultApi.js +44 -44
  2. package/package.json +9 -3
  3. package/.github/ISSUE_TEMPLATE/ask-question.yml +0 -25
  4. package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -51
  5. package/.github/ISSUE_TEMPLATE/general-feedback.yml +0 -25
  6. package/.github/pull_request_template.md +0 -44
  7. package/.github/workflows/asana-add-comment.yml +0 -47
  8. package/.github/workflows/asana-create-task.yml +0 -119
  9. package/.github/workflows/asana-update-issue.yml +0 -172
  10. package/.github/workflows/npm_deploy.yml +0 -22
  11. package/.github/workflows/project.yml +0 -17
  12. package/CHANGELOG.md +0 -48
  13. package/DefaultApi.md +0 -3293
  14. package/RELEASE_INSTRUCTIONS.md +0 -2
  15. package/apis/DefaultApi.ts +0 -4673
  16. package/apis/baseapi.ts +0 -37
  17. package/apis/exception.ts +0 -15
  18. package/auth/auth.ts +0 -110
  19. package/configuration.ts +0 -85
  20. package/dist/apis/DefaultApi.js.map +0 -1
  21. package/dist/apis/baseapi.js.map +0 -1
  22. package/dist/apis/exception.js.map +0 -1
  23. package/dist/auth/auth.js.map +0 -1
  24. package/dist/configuration.js.map +0 -1
  25. package/dist/http/http.js.map +0 -1
  26. package/dist/http/isomorphic-fetch.js.map +0 -1
  27. package/dist/index.js.map +0 -1
  28. package/dist/middleware.js.map +0 -1
  29. package/dist/models/ApiKeyToken.js.map +0 -1
  30. package/dist/models/ApiKeyTokensListResponse.js.map +0 -1
  31. package/dist/models/App.js.map +0 -1
  32. package/dist/models/BasicNotification.js.map +0 -1
  33. package/dist/models/BasicNotificationAllOf.js.map +0 -1
  34. package/dist/models/BasicNotificationAllOfAndroidBackgroundLayout.js.map +0 -1
  35. package/dist/models/Button.js.map +0 -1
  36. package/dist/models/CopyTemplateRequest.js.map +0 -1
  37. package/dist/models/CreateApiKeyRequest.js.map +0 -1
  38. package/dist/models/CreateApiKeyResponse.js.map +0 -1
  39. package/dist/models/CreateNotificationSuccessResponse.js.map +0 -1
  40. package/dist/models/CreateSegmentConflictResponse.js.map +0 -1
  41. package/dist/models/CreateSegmentSuccessResponse.js.map +0 -1
  42. package/dist/models/CreateTemplateRequest.js.map +0 -1
  43. package/dist/models/CreateUserConflictResponse.js.map +0 -1
  44. package/dist/models/CreateUserConflictResponseErrorsInner.js.map +0 -1
  45. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js.map +0 -1
  46. package/dist/models/CustomEvent.js.map +0 -1
  47. package/dist/models/CustomEventsRequest.js.map +0 -1
  48. package/dist/models/DeliveryData.js.map +0 -1
  49. package/dist/models/ExportEventsSuccessResponse.js.map +0 -1
  50. package/dist/models/ExportSubscriptionsRequestBody.js.map +0 -1
  51. package/dist/models/ExportSubscriptionsSuccessResponse.js.map +0 -1
  52. package/dist/models/Filter.js.map +0 -1
  53. package/dist/models/FilterExpression.js.map +0 -1
  54. package/dist/models/GenericError.js.map +0 -1
  55. package/dist/models/GenericSuccessBoolResponse.js.map +0 -1
  56. package/dist/models/GetNotificationHistoryRequestBody.js.map +0 -1
  57. package/dist/models/GetSegmentsSuccessResponse.js.map +0 -1
  58. package/dist/models/LanguageStringMap.js.map +0 -1
  59. package/dist/models/Notification.js.map +0 -1
  60. package/dist/models/NotificationAllOf.js.map +0 -1
  61. package/dist/models/NotificationHistorySuccessResponse.js.map +0 -1
  62. package/dist/models/NotificationSlice.js.map +0 -1
  63. package/dist/models/NotificationTarget.js.map +0 -1
  64. package/dist/models/NotificationWithMeta.js.map +0 -1
  65. package/dist/models/NotificationWithMetaAllOf.js.map +0 -1
  66. package/dist/models/ObjectSerializer.js.map +0 -1
  67. package/dist/models/Operator.js.map +0 -1
  68. package/dist/models/OutcomeData.js.map +0 -1
  69. package/dist/models/OutcomesData.js.map +0 -1
  70. package/dist/models/PlatformDeliveryData.js.map +0 -1
  71. package/dist/models/PlatformDeliveryDataEmailAllOf.js.map +0 -1
  72. package/dist/models/PlatformDeliveryDataSmsAllOf.js.map +0 -1
  73. package/dist/models/PropertiesBody.js.map +0 -1
  74. package/dist/models/PropertiesDeltas.js.map +0 -1
  75. package/dist/models/PropertiesObject.js.map +0 -1
  76. package/dist/models/Purchase.js.map +0 -1
  77. package/dist/models/RateLimitError.js.map +0 -1
  78. package/dist/models/Segment.js.map +0 -1
  79. package/dist/models/SegmentData.js.map +0 -1
  80. package/dist/models/SegmentNotificationTarget.js.map +0 -1
  81. package/dist/models/StartLiveActivityRequest.js.map +0 -1
  82. package/dist/models/StartLiveActivitySuccessResponse.js.map +0 -1
  83. package/dist/models/Subscription.js.map +0 -1
  84. package/dist/models/SubscriptionBody.js.map +0 -1
  85. package/dist/models/SubscriptionNotificationTarget.js.map +0 -1
  86. package/dist/models/TemplateResource.js.map +0 -1
  87. package/dist/models/TemplatesListResponse.js.map +0 -1
  88. package/dist/models/TransferSubscriptionRequestBody.js.map +0 -1
  89. package/dist/models/UpdateApiKeyRequest.js.map +0 -1
  90. package/dist/models/UpdateLiveActivityRequest.js.map +0 -1
  91. package/dist/models/UpdateLiveActivitySuccessResponse.js.map +0 -1
  92. package/dist/models/UpdateTemplateRequest.js.map +0 -1
  93. package/dist/models/UpdateUserRequest.js.map +0 -1
  94. package/dist/models/User.js.map +0 -1
  95. package/dist/models/UserIdentityBody.js.map +0 -1
  96. package/dist/models/WebButton.js.map +0 -1
  97. package/dist/models/all.js.map +0 -1
  98. package/dist/rxjsStub.js.map +0 -1
  99. package/dist/servers.js.map +0 -1
  100. package/dist/types/ObjectParamAPI.js.map +0 -1
  101. package/dist/types/ObservableAPI.js.map +0 -1
  102. package/dist/types/PromiseAPI.js.map +0 -1
  103. package/dist/util.js.map +0 -1
  104. package/http/http.ts +0 -205
  105. package/http/isomorphic-fetch.ts +0 -30
  106. package/index.ts +0 -12
  107. package/middleware.ts +0 -66
  108. package/models/ApiKeyToken.ts +0 -69
  109. package/models/ApiKeyTokensListResponse.ts +0 -32
  110. package/models/App.ts +0 -328
  111. package/models/BasicNotification.ts +0 -1088
  112. package/models/BasicNotificationAllOf.ts +0 -958
  113. package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +0 -57
  114. package/models/Button.ts +0 -45
  115. package/models/CopyTemplateRequest.ts +0 -34
  116. package/models/CreateApiKeyRequest.ts +0 -48
  117. package/models/CreateApiKeyResponse.ts +0 -38
  118. package/models/CreateNotificationSuccessResponse.ts +0 -48
  119. package/models/CreateSegmentConflictResponse.ts +0 -38
  120. package/models/CreateSegmentSuccessResponse.ts +0 -41
  121. package/models/CreateTemplateRequest.ts +0 -102
  122. package/models/CreateUserConflictResponse.ts +0 -32
  123. package/models/CreateUserConflictResponseErrorsInner.ts +0 -46
  124. package/models/CreateUserConflictResponseErrorsItemsMeta.ts +0 -31
  125. package/models/CustomEvent.ts +0 -74
  126. package/models/CustomEventsRequest.ts +0 -32
  127. package/models/DeliveryData.ts +0 -74
  128. package/models/ExportEventsSuccessResponse.ts +0 -31
  129. package/models/ExportSubscriptionsRequestBody.ts +0 -54
  130. package/models/ExportSubscriptionsSuccessResponse.ts +0 -31
  131. package/models/Filter.ts +0 -107
  132. package/models/FilterExpression.ts +0 -120
  133. package/models/GenericError.ts +0 -45
  134. package/models/GenericSuccessBoolResponse.ts +0 -31
  135. package/models/GetNotificationHistoryRequestBody.ts +0 -54
  136. package/models/GetSegmentsSuccessResponse.ts +0 -65
  137. package/models/LanguageStringMap.ts +0 -454
  138. package/models/Notification.ts +0 -1098
  139. package/models/NotificationAllOf.ts +0 -34
  140. package/models/NotificationHistorySuccessResponse.ts +0 -38
  141. package/models/NotificationSlice.ts +0 -53
  142. package/models/NotificationTarget.ts +0 -156
  143. package/models/NotificationWithMeta.ts +0 -1206
  144. package/models/NotificationWithMetaAllOf.ts +0 -142
  145. package/models/ObjectSerializer.ts +0 -442
  146. package/models/Operator.ts +0 -37
  147. package/models/OutcomeData.ts +0 -48
  148. package/models/OutcomesData.ts +0 -32
  149. package/models/PlatformDeliveryData.ts +0 -86
  150. package/models/PlatformDeliveryDataEmailAllOf.ts +0 -94
  151. package/models/PlatformDeliveryDataSmsAllOf.ts +0 -54
  152. package/models/PropertiesBody.ts +0 -32
  153. package/models/PropertiesDeltas.ts +0 -46
  154. package/models/PropertiesObject.ts +0 -102
  155. package/models/Purchase.ts +0 -61
  156. package/models/RateLimitError.ts +0 -38
  157. package/models/Segment.ts +0 -55
  158. package/models/SegmentData.ts +0 -94
  159. package/models/SegmentNotificationTarget.ts +0 -44
  160. package/models/StartLiveActivityRequest.ts +0 -177
  161. package/models/StartLiveActivitySuccessResponse.ts +0 -31
  162. package/models/Subscription.ts +0 -146
  163. package/models/SubscriptionBody.ts +0 -32
  164. package/models/SubscriptionNotificationTarget.ts +0 -134
  165. package/models/TemplateResource.ts +0 -72
  166. package/models/TemplatesListResponse.ts +0 -32
  167. package/models/TransferSubscriptionRequestBody.ts +0 -31
  168. package/models/UpdateApiKeyRequest.ts +0 -48
  169. package/models/UpdateLiveActivityRequest.ts +0 -109
  170. package/models/UpdateLiveActivitySuccessResponse.ts +0 -31
  171. package/models/UpdateTemplateRequest.ts +0 -92
  172. package/models/UpdateUserRequest.ts +0 -47
  173. package/models/User.ts +0 -47
  174. package/models/UserIdentityBody.ts +0 -31
  175. package/models/WebButton.ts +0 -52
  176. package/models/all.ts +0 -67
  177. package/onesignal-node-onesignal-5.3.0-beta1.tgz +0 -0
  178. package/rxjsStub.ts +0 -27
  179. package/servers.ts +0 -53
  180. package/tsconfig.json +0 -28
  181. package/types/ObjectParamAPI.ts +0 -1270
  182. package/types/ObservableAPI.ts +0 -1201
  183. package/types/PromiseAPI.ts +0 -585
  184. package/util.ts +0 -37
package/DefaultApi.md DELETED
@@ -1,3293 +0,0 @@
1
- # Onesignal.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
- [**copyTemplateToApp**](DefaultApi.md#copyTemplateToApp) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app
9
- [**createAlias**](DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
10
- [**createAliasBySubscription**](DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
11
- [**createApiKey**](DefaultApi.md#createApiKey) | **POST** /apps/{app_id}/auth/tokens | Create API key
12
- [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app
13
- [**createCustomEvents**](DefaultApi.md#createCustomEvents) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events
14
- [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification
15
- [**createSegment**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment
16
- [**createSubscription**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions |
17
- [**createTemplate**](DefaultApi.md#createTemplate) | **POST** /templates | Create template
18
- [**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users |
19
- [**deleteAlias**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} |
20
- [**deleteApiKey**](DefaultApi.md#deleteApiKey) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key
21
- [**deleteSegment**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment
22
- [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} |
23
- [**deleteTemplate**](DefaultApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete template
24
- [**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
25
- [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events
26
- [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions
27
- [**getAliases**](DefaultApi.md#getAliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
28
- [**getAliasesBySubscription**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
29
- [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app
30
- [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps
31
- [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification
32
- [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History
33
- [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications
34
- [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
35
- [**getSegments**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments
36
- [**getUser**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
37
- [**rotateApiKey**](DefaultApi.md#rotateApiKey) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key
38
- [**startLiveActivity**](DefaultApi.md#startLiveActivity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity
39
- [**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner |
40
- [**unsubscribeEmailWithToken**](DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token
41
- [**updateApiKey**](DefaultApi.md#updateApiKey) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key
42
- [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app
43
- [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
44
- [**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} |
45
- [**updateSubscriptionByToken**](DefaultApi.md#updateSubscriptionByToken) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token
46
- [**updateTemplate**](DefaultApi.md#updateTemplate) | **PATCH** /templates/{template_id} | Update template
47
- [**updateUser**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
48
- [**viewApiKeys**](DefaultApi.md#viewApiKeys) | **GET** /apps/{app_id}/auth/tokens | View API keys
49
- [**viewTemplate**](DefaultApi.md#viewTemplate) | **GET** /templates/{template_id} | View template
50
- [**viewTemplates**](DefaultApi.md#viewTemplates) | **GET** /templates | View templates
51
-
52
-
53
- # **cancelNotification**
54
- > GenericSuccessBoolResponse cancelNotification()
55
-
56
- Used to stop a scheduled or currently outgoing notification
57
-
58
- ### Example
59
-
60
-
61
- ```typescript
62
- import Onesignal from '@onesignal/node-onesignal';
63
-
64
- const configuration = Onesignal.createConfiguration({
65
- restApiKey: '<YOUR_REST_API_KEY>',
66
- });
67
- const apiInstance = new Onesignal.DefaultApi(configuration);
68
-
69
- let body: Onesignal.DefaultApiCancelNotificationRequest = {
70
- // string
71
- appId: "app_id_example",
72
- // string
73
- notificationId: "notification_id_example",
74
- };
75
-
76
- const response = await apiInstance.cancelNotification(body);
77
- console.log(response);
78
- ```
79
-
80
-
81
- ### Parameters
82
-
83
- Name | Type | Description | Notes
84
- ------------- | ------------- | ------------- | -------------
85
- **appId** | [**string**] | | defaults to undefined
86
- **notificationId** | [**string**] | | defaults to undefined
87
-
88
-
89
- ### Return type
90
-
91
- **GenericSuccessBoolResponse**
92
-
93
- ### Authorization
94
-
95
- [rest_api_key](README.md#rest_api_key)
96
-
97
- ### HTTP request headers
98
-
99
- - **Content-Type**: Not defined
100
- - **Accept**: application/json
101
-
102
-
103
- ### HTTP response details
104
- | Status code | Description | Response headers |
105
- |-------------|-------------|------------------|
106
- **200** | OK | - |
107
- **400** | Bad Request | - |
108
- **404** | Not Found | - |
109
- **429** | Rate Limit Exceeded | - |
110
-
111
- [[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)
112
-
113
- # **copyTemplateToApp**
114
- > TemplateResource copyTemplateToApp(copyTemplateRequest)
115
-
116
- Copy a template to a destination app.
117
-
118
- ### Example
119
-
120
-
121
- ```typescript
122
- import Onesignal from '@onesignal/node-onesignal';
123
-
124
- const configuration = Onesignal.createConfiguration({
125
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
126
- });
127
- const apiInstance = new Onesignal.DefaultApi(configuration);
128
-
129
- let body: Onesignal.DefaultApiCopyTemplateToAppRequest = {
130
- // string
131
- templateId: "template_id_example",
132
- // string
133
- appId: "app_id_example",
134
- // CopyTemplateRequest
135
- copyTemplateRequest: {
136
- target_app_id: "target_app_id_example",
137
- },
138
- };
139
-
140
- const response = await apiInstance.copyTemplateToApp(body);
141
- console.log(response);
142
- ```
143
-
144
-
145
- ### Parameters
146
-
147
- Name | Type | Description | Notes
148
- ------------- | ------------- | ------------- | -------------
149
- **copyTemplateRequest** | **CopyTemplateRequest**| |
150
- **templateId** | [**string**] | | defaults to undefined
151
- **appId** | [**string**] | | defaults to undefined
152
-
153
-
154
- ### Return type
155
-
156
- **TemplateResource**
157
-
158
- ### Authorization
159
-
160
- [organization_api_key](README.md#organization_api_key)
161
-
162
- ### HTTP request headers
163
-
164
- - **Content-Type**: application/json
165
- - **Accept**: application/json
166
-
167
-
168
- ### HTTP response details
169
- | Status code | Description | Response headers |
170
- |-------------|-------------|------------------|
171
- **200** | OK | - |
172
- **400** | Bad Request | - |
173
-
174
- [[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)
175
-
176
- # **createAlias**
177
- > UserIdentityBody createAlias(userIdentityBody)
178
-
179
- Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
180
-
181
- ### Example
182
-
183
-
184
- ```typescript
185
- import Onesignal from '@onesignal/node-onesignal';
186
-
187
- const configuration = Onesignal.createConfiguration({
188
- restApiKey: '<YOUR_REST_API_KEY>',
189
- });
190
- const apiInstance = new Onesignal.DefaultApi(configuration);
191
-
192
- let body: Onesignal.DefaultApiCreateAliasRequest = {
193
- // string
194
- appId: "app_id_example",
195
- // string
196
- aliasLabel: "alias_label_example",
197
- // string
198
- aliasId: "alias_id_example",
199
- // UserIdentityBody
200
- userIdentityBody: {
201
- identity: {
202
- "key": "key_example",
203
- },
204
- },
205
- };
206
-
207
- const response = await apiInstance.createAlias(body);
208
- console.log(response);
209
- ```
210
-
211
-
212
- ### Parameters
213
-
214
- Name | Type | Description | Notes
215
- ------------- | ------------- | ------------- | -------------
216
- **userIdentityBody** | **UserIdentityBody**| |
217
- **appId** | [**string**] | | defaults to undefined
218
- **aliasLabel** | [**string**] | | defaults to undefined
219
- **aliasId** | [**string**] | | defaults to undefined
220
-
221
-
222
- ### Return type
223
-
224
- **UserIdentityBody**
225
-
226
- ### Authorization
227
-
228
- [rest_api_key](README.md#rest_api_key)
229
-
230
- ### HTTP request headers
231
-
232
- - **Content-Type**: application/json
233
- - **Accept**: application/json
234
-
235
-
236
- ### HTTP response details
237
- | Status code | Description | Response headers |
238
- |-------------|-------------|------------------|
239
- **200** | OK | - |
240
- **400** | Bad Request | - |
241
- **404** | Not Found | - |
242
- **409** | Conflict | - |
243
- **429** | Rate Limit Exceeded | - |
244
-
245
- [[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)
246
-
247
- # **createAliasBySubscription**
248
- > UserIdentityBody createAliasBySubscription(userIdentityBody)
249
-
250
- Upserts one or more Aliases for the User identified by :subscription_id.
251
-
252
- ### Example
253
-
254
-
255
- ```typescript
256
- import Onesignal from '@onesignal/node-onesignal';
257
-
258
- const configuration = Onesignal.createConfiguration({
259
- restApiKey: '<YOUR_REST_API_KEY>',
260
- });
261
- const apiInstance = new Onesignal.DefaultApi(configuration);
262
-
263
- let body: Onesignal.DefaultApiCreateAliasBySubscriptionRequest = {
264
- // string
265
- appId: "app_id_example",
266
- // string
267
- subscriptionId: "subscription_id_example",
268
- // UserIdentityBody
269
- userIdentityBody: {
270
- identity: {
271
- "key": "key_example",
272
- },
273
- },
274
- };
275
-
276
- const response = await apiInstance.createAliasBySubscription(body);
277
- console.log(response);
278
- ```
279
-
280
-
281
- ### Parameters
282
-
283
- Name | Type | Description | Notes
284
- ------------- | ------------- | ------------- | -------------
285
- **userIdentityBody** | **UserIdentityBody**| |
286
- **appId** | [**string**] | | defaults to undefined
287
- **subscriptionId** | [**string**] | | defaults to undefined
288
-
289
-
290
- ### Return type
291
-
292
- **UserIdentityBody**
293
-
294
- ### Authorization
295
-
296
- [rest_api_key](README.md#rest_api_key)
297
-
298
- ### HTTP request headers
299
-
300
- - **Content-Type**: application/json
301
- - **Accept**: application/json
302
-
303
-
304
- ### HTTP response details
305
- | Status code | Description | Response headers |
306
- |-------------|-------------|------------------|
307
- **200** | OK | - |
308
- **400** | Bad Request | - |
309
- **404** | Not Found | - |
310
- **409** | Conflict | - |
311
- **429** | Rate Limit Exceeded | - |
312
-
313
- [[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)
314
-
315
- # **createApiKey**
316
- > CreateApiKeyResponse createApiKey(createApiKeyRequest)
317
-
318
- Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting.
319
-
320
- ### Example
321
-
322
-
323
- ```typescript
324
- import Onesignal from '@onesignal/node-onesignal';
325
-
326
- const configuration = Onesignal.createConfiguration({
327
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
328
- });
329
- const apiInstance = new Onesignal.DefaultApi(configuration);
330
-
331
- let body: Onesignal.DefaultApiCreateApiKeyRequest = {
332
- // string
333
- appId: "app_id_example",
334
- // CreateApiKeyRequest
335
- createApiKeyRequest: {
336
- name: "name_example",
337
- ip_allowlist_mode: "disabled",
338
- ip_allowlist: [
339
- "ip_allowlist_example",
340
- ],
341
- },
342
- };
343
-
344
- const response = await apiInstance.createApiKey(body);
345
- console.log(response);
346
- ```
347
-
348
-
349
- ### Parameters
350
-
351
- Name | Type | Description | Notes
352
- ------------- | ------------- | ------------- | -------------
353
- **createApiKeyRequest** | **CreateApiKeyRequest**| |
354
- **appId** | [**string**] | | defaults to undefined
355
-
356
-
357
- ### Return type
358
-
359
- **CreateApiKeyResponse**
360
-
361
- ### Authorization
362
-
363
- [organization_api_key](README.md#organization_api_key)
364
-
365
- ### HTTP request headers
366
-
367
- - **Content-Type**: application/json
368
- - **Accept**: application/json
369
-
370
-
371
- ### HTTP response details
372
- | Status code | Description | Response headers |
373
- |-------------|-------------|------------------|
374
- **200** | OK | - |
375
- **400** | Bad Request | - |
376
-
377
- [[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)
378
-
379
- # **createApp**
380
- > App createApp(app)
381
-
382
- Creates a new OneSignal app
383
-
384
- ### Example
385
-
386
-
387
- ```typescript
388
- import Onesignal from '@onesignal/node-onesignal';
389
-
390
- const configuration = Onesignal.createConfiguration({
391
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
392
- });
393
- const apiInstance = new Onesignal.DefaultApi(configuration);
394
-
395
- let body: Onesignal.DefaultApiCreateAppRequest = {
396
- // App
397
- app: {
398
- name: "name_example",
399
- android_gcm_sender_id: "android_gcm_sender_id_example",
400
- gcm_key: "gcm_key_example",
401
- chrome_web_origin: "chrome_web_origin_example",
402
- chrome_key: "chrome_key_example",
403
- chrome_web_default_notification_icon: "chrome_web_default_notification_icon_example",
404
- chrome_web_sub_domain: "chrome_web_sub_domain_example",
405
- apns_env: "sandbox",
406
- apns_p12: "apns_p12_example",
407
- apns_p12_password: "apns_p12_password_example",
408
- safari_apns_p12: "safari_apns_p12_example",
409
- safari_apns_p12_password: "safari_apns_p12_password_example",
410
- apns_key_id: "apns_key_id_example",
411
- apns_team_id: "apns_team_id_example",
412
- apns_bundle_id: "apns_bundle_id_example",
413
- apns_p8: "apns_p8_example",
414
- safari_site_origin: "safari_site_origin_example",
415
- safari_icon_256_256: "safari_icon_256_256_example",
416
- site_name: "site_name_example",
417
- organization_id: "organization_id_example",
418
- additional_data_is_root_payload: true,
419
- },
420
- };
421
-
422
- const response = await apiInstance.createApp(body);
423
- console.log(response);
424
- ```
425
-
426
-
427
- ### Parameters
428
-
429
- Name | Type | Description | Notes
430
- ------------- | ------------- | ------------- | -------------
431
- **app** | **App**| |
432
-
433
-
434
- ### Return type
435
-
436
- **App**
437
-
438
- ### Authorization
439
-
440
- [organization_api_key](README.md#organization_api_key)
441
-
442
- ### HTTP request headers
443
-
444
- - **Content-Type**: application/json
445
- - **Accept**: application/json
446
-
447
-
448
- ### HTTP response details
449
- | Status code | Description | Response headers |
450
- |-------------|-------------|------------------|
451
- **200** | OK | - |
452
- **400** | Bad Request | - |
453
- **429** | Rate Limit Exceeded | - |
454
-
455
- [[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)
456
-
457
- # **createCustomEvents**
458
- > object createCustomEvents(customEventsRequest)
459
-
460
- The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones.
461
-
462
- ### Example
463
-
464
-
465
- ```typescript
466
- import Onesignal from '@onesignal/node-onesignal';
467
-
468
- const configuration = Onesignal.createConfiguration({
469
- restApiKey: '<YOUR_REST_API_KEY>',
470
- });
471
- const apiInstance = new Onesignal.DefaultApi(configuration);
472
-
473
- let body: Onesignal.DefaultApiCreateCustomEventsRequest = {
474
- // string | Your OneSignal App ID in UUID v4 format.
475
- appId: "app_id_example",
476
- // CustomEventsRequest
477
- customEventsRequest: {
478
- events: [
479
- {
480
- name: "name_example",
481
- external_id: "external_id_example",
482
- onesignal_id: "onesignal_id_example",
483
- timestamp: new Date('1970-01-01T00:00:00.00Z'),
484
- payload: {},
485
- },
486
- ],
487
- },
488
- };
489
-
490
- const response = await apiInstance.createCustomEvents(body);
491
- console.log(response);
492
- ```
493
-
494
-
495
- ### Parameters
496
-
497
- Name | Type | Description | Notes
498
- ------------- | ------------- | ------------- | -------------
499
- **customEventsRequest** | **CustomEventsRequest**| |
500
- **appId** | [**string**] | Your OneSignal App ID in UUID v4 format. | defaults to undefined
501
-
502
-
503
- ### Return type
504
-
505
- **object**
506
-
507
- ### Authorization
508
-
509
- [rest_api_key](README.md#rest_api_key)
510
-
511
- ### HTTP request headers
512
-
513
- - **Content-Type**: application/json
514
- - **Accept**: application/json
515
-
516
-
517
- ### HTTP response details
518
- | Status code | Description | Response headers |
519
- |-------------|-------------|------------------|
520
- **200** | OK | - |
521
- **400** | Bad Request | - |
522
- **401** | Unauthorized | - |
523
- **429** | Rate Limit Exceeded | - |
524
-
525
- [[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)
526
-
527
- # **createNotification**
528
- > CreateNotificationSuccessResponse createNotification(notification)
529
-
530
- Sends notifications to your users
531
-
532
- ### Example
533
-
534
-
535
- ```typescript
536
- import Onesignal from '@onesignal/node-onesignal';
537
-
538
- const configuration = Onesignal.createConfiguration({
539
- restApiKey: '<YOUR_REST_API_KEY>',
540
- });
541
- const apiInstance = new Onesignal.DefaultApi(configuration);
542
-
543
- let body: Onesignal.DefaultApiCreateNotificationRequest = {
544
- // Notification
545
- notification: null,
546
- };
547
-
548
- const response = await apiInstance.createNotification(body);
549
- console.log(response);
550
- ```
551
-
552
-
553
- ### Parameters
554
-
555
- Name | Type | Description | Notes
556
- ------------- | ------------- | ------------- | -------------
557
- **notification** | **Notification**| |
558
-
559
-
560
- ### Return type
561
-
562
- **CreateNotificationSuccessResponse**
563
-
564
- ### Authorization
565
-
566
- [rest_api_key](README.md#rest_api_key)
567
-
568
- ### HTTP request headers
569
-
570
- - **Content-Type**: application/json
571
- - **Accept**: application/json
572
-
573
-
574
- ### HTTP response details
575
- | Status code | Description | Response headers |
576
- |-------------|-------------|------------------|
577
- **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 \&quot;invalid_aliases\&quot; 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. | - |
578
- **400** | Bad Request | - |
579
- **429** | Rate Limit Exceeded | - |
580
-
581
- [[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)
582
-
583
- # **createSegment**
584
- > CreateSegmentSuccessResponse createSegment()
585
-
586
- 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. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit.
587
-
588
- ### Example
589
-
590
-
591
- ```typescript
592
- import Onesignal from '@onesignal/node-onesignal';
593
-
594
- const configuration = Onesignal.createConfiguration({
595
- restApiKey: '<YOUR_REST_API_KEY>',
596
- });
597
- const apiInstance = new Onesignal.DefaultApi(configuration);
598
-
599
- let body: Onesignal.DefaultApiCreateSegmentRequest = {
600
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
601
- appId: "app_id_example",
602
- // Segment (optional)
603
- segment: {
604
- id: "id_example",
605
- name: "name_example",
606
- filters: [
607
- null,
608
- ],
609
- },
610
- };
611
-
612
- const response = await apiInstance.createSegment(body);
613
- console.log(response);
614
- ```
615
-
616
-
617
- ### Parameters
618
-
619
- Name | Type | Description | Notes
620
- ------------- | ------------- | ------------- | -------------
621
- **segment** | **Segment**| |
622
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
623
-
624
-
625
- ### Return type
626
-
627
- **CreateSegmentSuccessResponse**
628
-
629
- ### Authorization
630
-
631
- [rest_api_key](README.md#rest_api_key)
632
-
633
- ### HTTP request headers
634
-
635
- - **Content-Type**: application/json
636
- - **Accept**: application/json
637
-
638
-
639
- ### HTTP response details
640
- | Status code | Description | Response headers |
641
- |-------------|-------------|------------------|
642
- **201** | Created | - |
643
- **400** | Bad Request | - |
644
- **409** | Conflict | - |
645
- **429** | Rate Limit Exceeded | - |
646
-
647
- [[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)
648
-
649
- # **createSubscription**
650
- > SubscriptionBody createSubscription(subscriptionBody)
651
-
652
- Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
653
-
654
- ### Example
655
-
656
-
657
- ```typescript
658
- import Onesignal from '@onesignal/node-onesignal';
659
-
660
- const configuration = Onesignal.createConfiguration({
661
- restApiKey: '<YOUR_REST_API_KEY>',
662
- });
663
- const apiInstance = new Onesignal.DefaultApi(configuration);
664
-
665
- let body: Onesignal.DefaultApiCreateSubscriptionRequest = {
666
- // string
667
- appId: "app_id_example",
668
- // string
669
- aliasLabel: "alias_label_example",
670
- // string
671
- aliasId: "alias_id_example",
672
- // SubscriptionBody
673
- subscriptionBody: {
674
- subscription: {
675
- id: "id_example",
676
- type: "iOSPush",
677
- token: "token_example",
678
- enabled: true,
679
- notification_types: 1,
680
- session_time: 1,
681
- session_count: 1,
682
- sdk: "sdk_example",
683
- device_model: "device_model_example",
684
- device_os: "device_os_example",
685
- rooted: true,
686
- test_type: 1,
687
- app_version: "app_version_example",
688
- net_type: 1,
689
- carrier: "carrier_example",
690
- web_auth: "web_auth_example",
691
- web_p256: "web_p256_example",
692
- },
693
- },
694
- };
695
-
696
- const response = await apiInstance.createSubscription(body);
697
- console.log(response);
698
- ```
699
-
700
-
701
- ### Parameters
702
-
703
- Name | Type | Description | Notes
704
- ------------- | ------------- | ------------- | -------------
705
- **subscriptionBody** | **SubscriptionBody**| |
706
- **appId** | [**string**] | | defaults to undefined
707
- **aliasLabel** | [**string**] | | defaults to undefined
708
- **aliasId** | [**string**] | | defaults to undefined
709
-
710
-
711
- ### Return type
712
-
713
- **SubscriptionBody**
714
-
715
- ### Authorization
716
-
717
- [rest_api_key](README.md#rest_api_key)
718
-
719
- ### HTTP request headers
720
-
721
- - **Content-Type**: application/json
722
- - **Accept**: application/json
723
-
724
-
725
- ### HTTP response details
726
- | Status code | Description | Response headers |
727
- |-------------|-------------|------------------|
728
- **201** | CREATED | - |
729
- **202** | ACCEPTED | - |
730
- **400** | Bad Request | - |
731
- **404** | Not Found | - |
732
- **409** | Operation is not permitted due to user having the maximum number of subscriptions assigned | - |
733
- **429** | Rate Limit Exceeded | - |
734
-
735
- [[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)
736
-
737
- # **createTemplate**
738
- > TemplateResource createTemplate(createTemplateRequest)
739
-
740
- Create reusable message templates for push, email, and SMS channels.
741
-
742
- ### Example
743
-
744
-
745
- ```typescript
746
- import Onesignal from '@onesignal/node-onesignal';
747
-
748
- const configuration = Onesignal.createConfiguration({
749
- restApiKey: '<YOUR_REST_API_KEY>',
750
- });
751
- const apiInstance = new Onesignal.DefaultApi(configuration);
752
-
753
- let body: Onesignal.DefaultApiCreateTemplateRequest = {
754
- // CreateTemplateRequest
755
- createTemplateRequest: {
756
- app_id: "app_id_example",
757
- name: "name_example",
758
- contents: {
759
- en: "en_example",
760
- ar: "ar_example",
761
- bs: "bs_example",
762
- bg: "bg_example",
763
- ca: "ca_example",
764
- zh_hans: "zh_hans_example",
765
- zh_hant: "zh_hant_example",
766
- zh: "zh_example",
767
- hr: "hr_example",
768
- cs: "cs_example",
769
- da: "da_example",
770
- nl: "nl_example",
771
- et: "et_example",
772
- fi: "fi_example",
773
- fr: "fr_example",
774
- ka: "ka_example",
775
- de: "de_example",
776
- el: "el_example",
777
- hi: "hi_example",
778
- he: "he_example",
779
- hu: "hu_example",
780
- id: "id_example",
781
- it: "it_example",
782
- ja: "ja_example",
783
- ko: "ko_example",
784
- lv: "lv_example",
785
- lt: "lt_example",
786
- ms: "ms_example",
787
- nb: "nb_example",
788
- pl: "pl_example",
789
- fa: "fa_example",
790
- pt: "pt_example",
791
- pa: "pa_example",
792
- ro: "ro_example",
793
- ru: "ru_example",
794
- sr: "sr_example",
795
- sk: "sk_example",
796
- es: "es_example",
797
- sv: "sv_example",
798
- th: "th_example",
799
- tr: "tr_example",
800
- uk: "uk_example",
801
- vi: "vi_example",
802
- },
803
- is_email: true,
804
- email_subject: "email_subject_example",
805
- email_body: "email_body_example",
806
- is_sms: true,
807
- dynamic_content: "dynamic_content_example",
808
- },
809
- };
810
-
811
- const response = await apiInstance.createTemplate(body);
812
- console.log(response);
813
- ```
814
-
815
-
816
- ### Parameters
817
-
818
- Name | Type | Description | Notes
819
- ------------- | ------------- | ------------- | -------------
820
- **createTemplateRequest** | **CreateTemplateRequest**| |
821
-
822
-
823
- ### Return type
824
-
825
- **TemplateResource**
826
-
827
- ### Authorization
828
-
829
- [rest_api_key](README.md#rest_api_key)
830
-
831
- ### HTTP request headers
832
-
833
- - **Content-Type**: application/json
834
- - **Accept**: application/json
835
-
836
-
837
- ### HTTP response details
838
- | Status code | Description | Response headers |
839
- |-------------|-------------|------------------|
840
- **200** | OK | - |
841
- **400** | Bad Request | - |
842
- **422** | Unprocessable Entity | - |
843
-
844
- [[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)
845
-
846
- # **createUser**
847
- > User createUser(user)
848
-
849
- 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.
850
-
851
- ### Example
852
-
853
-
854
- ```typescript
855
- import Onesignal from '@onesignal/node-onesignal';
856
-
857
- const configuration = Onesignal.createConfiguration({
858
- restApiKey: '<YOUR_REST_API_KEY>',
859
- });
860
- const apiInstance = new Onesignal.DefaultApi(configuration);
861
-
862
- let body: Onesignal.DefaultApiCreateUserRequest = {
863
- // string
864
- appId: "app_id_example",
865
- // User
866
- user: {
867
- properties: {
868
- tags: {},
869
- language: "language_example",
870
- timezone_id: "timezone_id_example",
871
- lat: 3.14,
872
- long: 3.14,
873
- country: "country_example",
874
- first_active: 1,
875
- last_active: 1,
876
- amount_spent: 3.14,
877
- purchases: [
878
- {
879
- sku: "sku_example",
880
- amount: "amount_example",
881
- iso: "iso_example",
882
- count: 1,
883
- },
884
- ],
885
- ip: "ip_example",
886
- },
887
- identity: {
888
- "key": "key_example",
889
- },
890
- subscriptions: [
891
- {
892
- id: "id_example",
893
- type: "iOSPush",
894
- token: "token_example",
895
- enabled: true,
896
- notification_types: 1,
897
- session_time: 1,
898
- session_count: 1,
899
- sdk: "sdk_example",
900
- device_model: "device_model_example",
901
- device_os: "device_os_example",
902
- rooted: true,
903
- test_type: 1,
904
- app_version: "app_version_example",
905
- net_type: 1,
906
- carrier: "carrier_example",
907
- web_auth: "web_auth_example",
908
- web_p256: "web_p256_example",
909
- },
910
- ],
911
- },
912
- };
913
-
914
- const response = await apiInstance.createUser(body);
915
- console.log(response);
916
- ```
917
-
918
-
919
- ### Parameters
920
-
921
- Name | Type | Description | Notes
922
- ------------- | ------------- | ------------- | -------------
923
- **user** | **User**| |
924
- **appId** | [**string**] | | defaults to undefined
925
-
926
-
927
- ### Return type
928
-
929
- **User**
930
-
931
- ### Authorization
932
-
933
- [rest_api_key](README.md#rest_api_key)
934
-
935
- ### HTTP request headers
936
-
937
- - **Content-Type**: application/json
938
- - **Accept**: application/json
939
-
940
-
941
- ### HTTP response details
942
- | Status code | Description | Response headers |
943
- |-------------|-------------|------------------|
944
- **200** | CREATED | - |
945
- **201** | CREATED | - |
946
- **202** | ACCEPTED | - |
947
- **400** | Bad Request | - |
948
- **409** | Multiple User Identity Conflict | - |
949
- **429** | Rate Limit Exceeded | - |
950
-
951
- [[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)
952
-
953
- # **deleteAlias**
954
- > UserIdentityBody deleteAlias()
955
-
956
- Deletes an alias by alias label
957
-
958
- ### Example
959
-
960
-
961
- ```typescript
962
- import Onesignal from '@onesignal/node-onesignal';
963
-
964
- const configuration = Onesignal.createConfiguration({
965
- restApiKey: '<YOUR_REST_API_KEY>',
966
- });
967
- const apiInstance = new Onesignal.DefaultApi(configuration);
968
-
969
- let body: Onesignal.DefaultApiDeleteAliasRequest = {
970
- // string
971
- appId: "app_id_example",
972
- // string
973
- aliasLabel: "alias_label_example",
974
- // string
975
- aliasId: "alias_id_example",
976
- // string
977
- aliasLabelToDelete: "alias_label_to_delete_example",
978
- };
979
-
980
- const response = await apiInstance.deleteAlias(body);
981
- console.log(response);
982
- ```
983
-
984
-
985
- ### Parameters
986
-
987
- Name | Type | Description | Notes
988
- ------------- | ------------- | ------------- | -------------
989
- **appId** | [**string**] | | defaults to undefined
990
- **aliasLabel** | [**string**] | | defaults to undefined
991
- **aliasId** | [**string**] | | defaults to undefined
992
- **aliasLabelToDelete** | [**string**] | | defaults to undefined
993
-
994
-
995
- ### Return type
996
-
997
- **UserIdentityBody**
998
-
999
- ### Authorization
1000
-
1001
- [rest_api_key](README.md#rest_api_key)
1002
-
1003
- ### HTTP request headers
1004
-
1005
- - **Content-Type**: Not defined
1006
- - **Accept**: application/json
1007
-
1008
-
1009
- ### HTTP response details
1010
- | Status code | Description | Response headers |
1011
- |-------------|-------------|------------------|
1012
- **200** | OK | - |
1013
- **400** | Bad Request | - |
1014
- **404** | Not Found | - |
1015
- **409** | Conflict | - |
1016
- **429** | Rate Limit Exceeded | - |
1017
-
1018
- [[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)
1019
-
1020
- # **deleteApiKey**
1021
- > object deleteApiKey()
1022
-
1023
- Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself.
1024
-
1025
- ### Example
1026
-
1027
-
1028
- ```typescript
1029
- import Onesignal from '@onesignal/node-onesignal';
1030
-
1031
- const configuration = Onesignal.createConfiguration({
1032
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
1033
- });
1034
- const apiInstance = new Onesignal.DefaultApi(configuration);
1035
-
1036
- let body: Onesignal.DefaultApiDeleteApiKeyRequest = {
1037
- // string
1038
- appId: "app_id_example",
1039
- // string
1040
- tokenId: "token_id_example",
1041
- };
1042
-
1043
- const response = await apiInstance.deleteApiKey(body);
1044
- console.log(response);
1045
- ```
1046
-
1047
-
1048
- ### Parameters
1049
-
1050
- Name | Type | Description | Notes
1051
- ------------- | ------------- | ------------- | -------------
1052
- **appId** | [**string**] | | defaults to undefined
1053
- **tokenId** | [**string**] | | defaults to undefined
1054
-
1055
-
1056
- ### Return type
1057
-
1058
- **object**
1059
-
1060
- ### Authorization
1061
-
1062
- [organization_api_key](README.md#organization_api_key)
1063
-
1064
- ### HTTP request headers
1065
-
1066
- - **Content-Type**: Not defined
1067
- - **Accept**: application/json
1068
-
1069
-
1070
- ### HTTP response details
1071
- | Status code | Description | Response headers |
1072
- |-------------|-------------|------------------|
1073
- **200** | OK | - |
1074
- **400** | Bad Request | - |
1075
-
1076
- [[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)
1077
-
1078
- # **deleteSegment**
1079
- > GenericSuccessBoolResponse deleteSegment()
1080
-
1081
- 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.
1082
-
1083
- ### Example
1084
-
1085
-
1086
- ```typescript
1087
- import Onesignal from '@onesignal/node-onesignal';
1088
-
1089
- const configuration = Onesignal.createConfiguration({
1090
- restApiKey: '<YOUR_REST_API_KEY>',
1091
- });
1092
- const apiInstance = new Onesignal.DefaultApi(configuration);
1093
-
1094
- let body: Onesignal.DefaultApiDeleteSegmentRequest = {
1095
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1096
- appId: "app_id_example",
1097
- // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
1098
- segmentId: "segment_id_example",
1099
- };
1100
-
1101
- const response = await apiInstance.deleteSegment(body);
1102
- console.log(response);
1103
- ```
1104
-
1105
-
1106
- ### Parameters
1107
-
1108
- Name | Type | Description | Notes
1109
- ------------- | ------------- | ------------- | -------------
1110
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1111
- **segmentId** | [**string**] | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | defaults to undefined
1112
-
1113
-
1114
- ### Return type
1115
-
1116
- **GenericSuccessBoolResponse**
1117
-
1118
- ### Authorization
1119
-
1120
- [rest_api_key](README.md#rest_api_key)
1121
-
1122
- ### HTTP request headers
1123
-
1124
- - **Content-Type**: Not defined
1125
- - **Accept**: application/json
1126
-
1127
-
1128
- ### HTTP response details
1129
- | Status code | Description | Response headers |
1130
- |-------------|-------------|------------------|
1131
- **200** | OK | - |
1132
- **400** | Bad Request | - |
1133
- **404** | Not Found | - |
1134
- **429** | Rate Limit Exceeded | - |
1135
-
1136
- [[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)
1137
-
1138
- # **deleteSubscription**
1139
- > void deleteSubscription()
1140
-
1141
- Deletes the Subscription.
1142
-
1143
- ### Example
1144
-
1145
-
1146
- ```typescript
1147
- import Onesignal from '@onesignal/node-onesignal';
1148
-
1149
- const configuration = Onesignal.createConfiguration({
1150
- restApiKey: '<YOUR_REST_API_KEY>',
1151
- });
1152
- const apiInstance = new Onesignal.DefaultApi(configuration);
1153
-
1154
- let body: Onesignal.DefaultApiDeleteSubscriptionRequest = {
1155
- // string
1156
- appId: "app_id_example",
1157
- // string
1158
- subscriptionId: "subscription_id_example",
1159
- };
1160
-
1161
- const response = await apiInstance.deleteSubscription(body);
1162
- console.log(response);
1163
- ```
1164
-
1165
-
1166
- ### Parameters
1167
-
1168
- Name | Type | Description | Notes
1169
- ------------- | ------------- | ------------- | -------------
1170
- **appId** | [**string**] | | defaults to undefined
1171
- **subscriptionId** | [**string**] | | defaults to undefined
1172
-
1173
-
1174
- ### Return type
1175
-
1176
- **void**
1177
-
1178
- ### Authorization
1179
-
1180
- [rest_api_key](README.md#rest_api_key)
1181
-
1182
- ### HTTP request headers
1183
-
1184
- - **Content-Type**: Not defined
1185
- - **Accept**: application/json
1186
-
1187
-
1188
- ### HTTP response details
1189
- | Status code | Description | Response headers |
1190
- |-------------|-------------|------------------|
1191
- **202** | ACCEPTED | - |
1192
- **400** | Bad Request | - |
1193
- **404** | Not Found | - |
1194
- **409** | Conflict | - |
1195
- **429** | Rate Limit Exceeded | - |
1196
-
1197
- [[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)
1198
-
1199
- # **deleteTemplate**
1200
- > GenericSuccessBoolResponse deleteTemplate()
1201
-
1202
- Delete a template by id.
1203
-
1204
- ### Example
1205
-
1206
-
1207
- ```typescript
1208
- import Onesignal from '@onesignal/node-onesignal';
1209
-
1210
- const configuration = Onesignal.createConfiguration({
1211
- restApiKey: '<YOUR_REST_API_KEY>',
1212
- });
1213
- const apiInstance = new Onesignal.DefaultApi(configuration);
1214
-
1215
- let body: Onesignal.DefaultApiDeleteTemplateRequest = {
1216
- // string
1217
- templateId: "template_id_example",
1218
- // string
1219
- appId: "app_id_example",
1220
- };
1221
-
1222
- const response = await apiInstance.deleteTemplate(body);
1223
- console.log(response);
1224
- ```
1225
-
1226
-
1227
- ### Parameters
1228
-
1229
- Name | Type | Description | Notes
1230
- ------------- | ------------- | ------------- | -------------
1231
- **templateId** | [**string**] | | defaults to undefined
1232
- **appId** | [**string**] | | defaults to undefined
1233
-
1234
-
1235
- ### Return type
1236
-
1237
- **GenericSuccessBoolResponse**
1238
-
1239
- ### Authorization
1240
-
1241
- [rest_api_key](README.md#rest_api_key)
1242
-
1243
- ### HTTP request headers
1244
-
1245
- - **Content-Type**: Not defined
1246
- - **Accept**: application/json
1247
-
1248
-
1249
- ### HTTP response details
1250
- | Status code | Description | Response headers |
1251
- |-------------|-------------|------------------|
1252
- **200** | OK | - |
1253
- **400** | Bad Request | - |
1254
- **404** | Not Found | - |
1255
-
1256
- [[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)
1257
-
1258
- # **deleteUser**
1259
- > void deleteUser()
1260
-
1261
- Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
1262
-
1263
- ### Example
1264
-
1265
-
1266
- ```typescript
1267
- import Onesignal from '@onesignal/node-onesignal';
1268
-
1269
- const configuration = Onesignal.createConfiguration({
1270
- restApiKey: '<YOUR_REST_API_KEY>',
1271
- });
1272
- const apiInstance = new Onesignal.DefaultApi(configuration);
1273
-
1274
- let body: Onesignal.DefaultApiDeleteUserRequest = {
1275
- // string
1276
- appId: "app_id_example",
1277
- // string
1278
- aliasLabel: "alias_label_example",
1279
- // string
1280
- aliasId: "alias_id_example",
1281
- };
1282
-
1283
- const response = await apiInstance.deleteUser(body);
1284
- console.log(response);
1285
- ```
1286
-
1287
-
1288
- ### Parameters
1289
-
1290
- Name | Type | Description | Notes
1291
- ------------- | ------------- | ------------- | -------------
1292
- **appId** | [**string**] | | defaults to undefined
1293
- **aliasLabel** | [**string**] | | defaults to undefined
1294
- **aliasId** | [**string**] | | defaults to undefined
1295
-
1296
-
1297
- ### Return type
1298
-
1299
- **void**
1300
-
1301
- ### Authorization
1302
-
1303
- [rest_api_key](README.md#rest_api_key)
1304
-
1305
- ### HTTP request headers
1306
-
1307
- - **Content-Type**: Not defined
1308
- - **Accept**: application/json
1309
-
1310
-
1311
- ### HTTP response details
1312
- | Status code | Description | Response headers |
1313
- |-------------|-------------|------------------|
1314
- **200** | OK | - |
1315
- **400** | Bad Request | - |
1316
- **409** | Conflict | - |
1317
- **429** | Rate Limit Exceeded | - |
1318
-
1319
- [[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)
1320
-
1321
- # **exportEvents**
1322
- > ExportEventsSuccessResponse exportEvents()
1323
-
1324
- 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.
1325
-
1326
- ### Example
1327
-
1328
-
1329
- ```typescript
1330
- import Onesignal from '@onesignal/node-onesignal';
1331
-
1332
- const configuration = Onesignal.createConfiguration({
1333
- restApiKey: '<YOUR_REST_API_KEY>',
1334
- });
1335
- const apiInstance = new Onesignal.DefaultApi(configuration);
1336
-
1337
- let body: Onesignal.DefaultApiExportEventsRequest = {
1338
- // string | The ID of the notification to export events from.
1339
- notificationId: "notification_id_example",
1340
- // string | The ID of the app that the notification belongs to.
1341
- appId: "app_id_example",
1342
- };
1343
-
1344
- const response = await apiInstance.exportEvents(body);
1345
- console.log(response);
1346
- ```
1347
-
1348
-
1349
- ### Parameters
1350
-
1351
- Name | Type | Description | Notes
1352
- ------------- | ------------- | ------------- | -------------
1353
- **notificationId** | [**string**] | The ID of the notification to export events from. | defaults to undefined
1354
- **appId** | [**string**] | The ID of the app that the notification belongs to. | defaults to undefined
1355
-
1356
-
1357
- ### Return type
1358
-
1359
- **ExportEventsSuccessResponse**
1360
-
1361
- ### Authorization
1362
-
1363
- [rest_api_key](README.md#rest_api_key)
1364
-
1365
- ### HTTP request headers
1366
-
1367
- - **Content-Type**: Not defined
1368
- - **Accept**: application/json
1369
-
1370
-
1371
- ### HTTP response details
1372
- | Status code | Description | Response headers |
1373
- |-------------|-------------|------------------|
1374
- **200** | OK | - |
1375
- **400** | Bad Request | - |
1376
- **404** | Not Found | - |
1377
- **429** | Rate Limit Exceeded | - |
1378
-
1379
- [[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)
1380
-
1381
- # **exportSubscriptions**
1382
- > ExportSubscriptionsSuccessResponse exportSubscriptions()
1383
-
1384
- 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. |
1385
-
1386
- ### Example
1387
-
1388
-
1389
- ```typescript
1390
- import Onesignal from '@onesignal/node-onesignal';
1391
-
1392
- const configuration = Onesignal.createConfiguration({
1393
- restApiKey: '<YOUR_REST_API_KEY>',
1394
- });
1395
- const apiInstance = new Onesignal.DefaultApi(configuration);
1396
-
1397
- let body: Onesignal.DefaultApiExportSubscriptionsRequest = {
1398
- // string | The app ID that you want to export devices from
1399
- appId: "app_id_example",
1400
- // ExportSubscriptionsRequestBody (optional)
1401
- exportSubscriptionsRequestBody: {
1402
- extra_fields: [
1403
- "extra_fields_example",
1404
- ],
1405
- last_active_since: "last_active_since_example",
1406
- segment_name: "segment_name_example",
1407
- },
1408
- };
1409
-
1410
- const response = await apiInstance.exportSubscriptions(body);
1411
- console.log(response);
1412
- ```
1413
-
1414
-
1415
- ### Parameters
1416
-
1417
- Name | Type | Description | Notes
1418
- ------------- | ------------- | ------------- | -------------
1419
- **exportSubscriptionsRequestBody** | **ExportSubscriptionsRequestBody**| |
1420
- **appId** | [**string**] | The app ID that you want to export devices from | defaults to undefined
1421
-
1422
-
1423
- ### Return type
1424
-
1425
- **ExportSubscriptionsSuccessResponse**
1426
-
1427
- ### Authorization
1428
-
1429
- [rest_api_key](README.md#rest_api_key)
1430
-
1431
- ### HTTP request headers
1432
-
1433
- - **Content-Type**: application/json
1434
- - **Accept**: application/json
1435
-
1436
-
1437
- ### HTTP response details
1438
- | Status code | Description | Response headers |
1439
- |-------------|-------------|------------------|
1440
- **200** | OK | - |
1441
- **400** | Bad Request | - |
1442
- **429** | Rate Limit Exceeded | - |
1443
-
1444
- [[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)
1445
-
1446
- # **getAliases**
1447
- > UserIdentityBody getAliases()
1448
-
1449
- Lists all Aliases for the User identified by (:alias_label, :alias_id).
1450
-
1451
- ### Example
1452
-
1453
-
1454
- ```typescript
1455
- import Onesignal from '@onesignal/node-onesignal';
1456
-
1457
- const configuration = Onesignal.createConfiguration({
1458
- restApiKey: '<YOUR_REST_API_KEY>',
1459
- });
1460
- const apiInstance = new Onesignal.DefaultApi(configuration);
1461
-
1462
- let body: Onesignal.DefaultApiGetAliasesRequest = {
1463
- // string
1464
- appId: "app_id_example",
1465
- // string
1466
- aliasLabel: "alias_label_example",
1467
- // string
1468
- aliasId: "alias_id_example",
1469
- };
1470
-
1471
- const response = await apiInstance.getAliases(body);
1472
- console.log(response);
1473
- ```
1474
-
1475
-
1476
- ### Parameters
1477
-
1478
- Name | Type | Description | Notes
1479
- ------------- | ------------- | ------------- | -------------
1480
- **appId** | [**string**] | | defaults to undefined
1481
- **aliasLabel** | [**string**] | | defaults to undefined
1482
- **aliasId** | [**string**] | | defaults to undefined
1483
-
1484
-
1485
- ### Return type
1486
-
1487
- **UserIdentityBody**
1488
-
1489
- ### Authorization
1490
-
1491
- [rest_api_key](README.md#rest_api_key)
1492
-
1493
- ### HTTP request headers
1494
-
1495
- - **Content-Type**: Not defined
1496
- - **Accept**: application/json
1497
-
1498
-
1499
- ### HTTP response details
1500
- | Status code | Description | Response headers |
1501
- |-------------|-------------|------------------|
1502
- **200** | OK | - |
1503
- **400** | Bad Request | - |
1504
- **404** | Not Found | - |
1505
- **429** | Rate Limit Exceeded | - |
1506
-
1507
- [[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)
1508
-
1509
- # **getAliasesBySubscription**
1510
- > UserIdentityBody getAliasesBySubscription()
1511
-
1512
- Lists all Aliases for the User identified by :subscription_id.
1513
-
1514
- ### Example
1515
-
1516
-
1517
- ```typescript
1518
- import Onesignal from '@onesignal/node-onesignal';
1519
-
1520
- const configuration = Onesignal.createConfiguration({
1521
- restApiKey: '<YOUR_REST_API_KEY>',
1522
- });
1523
- const apiInstance = new Onesignal.DefaultApi(configuration);
1524
-
1525
- let body: Onesignal.DefaultApiGetAliasesBySubscriptionRequest = {
1526
- // string
1527
- appId: "app_id_example",
1528
- // string
1529
- subscriptionId: "subscription_id_example",
1530
- };
1531
-
1532
- const response = await apiInstance.getAliasesBySubscription(body);
1533
- console.log(response);
1534
- ```
1535
-
1536
-
1537
- ### Parameters
1538
-
1539
- Name | Type | Description | Notes
1540
- ------------- | ------------- | ------------- | -------------
1541
- **appId** | [**string**] | | defaults to undefined
1542
- **subscriptionId** | [**string**] | | defaults to undefined
1543
-
1544
-
1545
- ### Return type
1546
-
1547
- **UserIdentityBody**
1548
-
1549
- ### Authorization
1550
-
1551
- [rest_api_key](README.md#rest_api_key)
1552
-
1553
- ### HTTP request headers
1554
-
1555
- - **Content-Type**: Not defined
1556
- - **Accept**: application/json
1557
-
1558
-
1559
- ### HTTP response details
1560
- | Status code | Description | Response headers |
1561
- |-------------|-------------|------------------|
1562
- **200** | OK | - |
1563
- **400** | Bad Request | - |
1564
- **404** | Not Found | - |
1565
-
1566
- [[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)
1567
-
1568
- # **getApp**
1569
- > App getApp()
1570
-
1571
- View the details of a single OneSignal app
1572
-
1573
- ### Example
1574
-
1575
-
1576
- ```typescript
1577
- import Onesignal from '@onesignal/node-onesignal';
1578
-
1579
- const configuration = Onesignal.createConfiguration({
1580
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
1581
- });
1582
- const apiInstance = new Onesignal.DefaultApi(configuration);
1583
-
1584
- let body: Onesignal.DefaultApiGetAppRequest = {
1585
- // string | An app id
1586
- appId: "app_id_example",
1587
- };
1588
-
1589
- const response = await apiInstance.getApp(body);
1590
- console.log(response);
1591
- ```
1592
-
1593
-
1594
- ### Parameters
1595
-
1596
- Name | Type | Description | Notes
1597
- ------------- | ------------- | ------------- | -------------
1598
- **appId** | [**string**] | An app id | defaults to undefined
1599
-
1600
-
1601
- ### Return type
1602
-
1603
- **App**
1604
-
1605
- ### Authorization
1606
-
1607
- [organization_api_key](README.md#organization_api_key)
1608
-
1609
- ### HTTP request headers
1610
-
1611
- - **Content-Type**: Not defined
1612
- - **Accept**: application/json
1613
-
1614
-
1615
- ### HTTP response details
1616
- | Status code | Description | Response headers |
1617
- |-------------|-------------|------------------|
1618
- **200** | OK | - |
1619
- **400** | Bad Request | - |
1620
- **429** | Rate Limit Exceeded | - |
1621
-
1622
- [[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)
1623
-
1624
- # **getApps**
1625
- > Array<App> getApps()
1626
-
1627
- View the details of all of your current OneSignal apps
1628
-
1629
- ### Example
1630
-
1631
-
1632
- ```typescript
1633
- import Onesignal from '@onesignal/node-onesignal';
1634
-
1635
- const configuration = Onesignal.createConfiguration({
1636
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
1637
- });
1638
- const apiInstance = new Onesignal.DefaultApi(configuration);
1639
-
1640
- const response = await apiInstance.getApps();
1641
- console.log(response);
1642
- ```
1643
-
1644
-
1645
- ### Parameters
1646
- This endpoint does not need any parameter.
1647
-
1648
-
1649
- ### Return type
1650
-
1651
- **Array<App>**
1652
-
1653
- ### Authorization
1654
-
1655
- [organization_api_key](README.md#organization_api_key)
1656
-
1657
- ### HTTP request headers
1658
-
1659
- - **Content-Type**: Not defined
1660
- - **Accept**: application/json
1661
-
1662
-
1663
- ### HTTP response details
1664
- | Status code | Description | Response headers |
1665
- |-------------|-------------|------------------|
1666
- **200** | OK | - |
1667
- **400** | Bad Request | - |
1668
- **429** | Rate Limit Exceeded | - |
1669
-
1670
- [[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)
1671
-
1672
- # **getNotification**
1673
- > NotificationWithMeta getNotification()
1674
-
1675
- View the details of a single notification and outcomes associated with it
1676
-
1677
- ### Example
1678
-
1679
-
1680
- ```typescript
1681
- import Onesignal from '@onesignal/node-onesignal';
1682
-
1683
- const configuration = Onesignal.createConfiguration({
1684
- restApiKey: '<YOUR_REST_API_KEY>',
1685
- });
1686
- const apiInstance = new Onesignal.DefaultApi(configuration);
1687
-
1688
- let body: Onesignal.DefaultApiGetNotificationRequest = {
1689
- // string
1690
- appId: "app_id_example",
1691
- // string
1692
- notificationId: "notification_id_example",
1693
- };
1694
-
1695
- const response = await apiInstance.getNotification(body);
1696
- console.log(response);
1697
- ```
1698
-
1699
-
1700
- ### Parameters
1701
-
1702
- Name | Type | Description | Notes
1703
- ------------- | ------------- | ------------- | -------------
1704
- **appId** | [**string**] | | defaults to undefined
1705
- **notificationId** | [**string**] | | defaults to undefined
1706
-
1707
-
1708
- ### Return type
1709
-
1710
- **NotificationWithMeta**
1711
-
1712
- ### Authorization
1713
-
1714
- [rest_api_key](README.md#rest_api_key)
1715
-
1716
- ### HTTP request headers
1717
-
1718
- - **Content-Type**: Not defined
1719
- - **Accept**: application/json
1720
-
1721
-
1722
- ### HTTP response details
1723
- | Status code | Description | Response headers |
1724
- |-------------|-------------|------------------|
1725
- **200** | OK | - |
1726
- **400** | Bad Request | - |
1727
- **404** | Not Found | - |
1728
- **429** | Rate Limit Exceeded | - |
1729
-
1730
- [[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)
1731
-
1732
- # **getNotificationHistory**
1733
- > NotificationHistorySuccessResponse getNotificationHistory(getNotificationHistoryRequestBody)
1734
-
1735
- -> 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.
1736
-
1737
- ### Example
1738
-
1739
-
1740
- ```typescript
1741
- import Onesignal from '@onesignal/node-onesignal';
1742
-
1743
- const configuration = Onesignal.createConfiguration({
1744
- restApiKey: '<YOUR_REST_API_KEY>',
1745
- });
1746
- const apiInstance = new Onesignal.DefaultApi(configuration);
1747
-
1748
- let body: Onesignal.DefaultApiGetNotificationHistoryRequest = {
1749
- // string | The \"id\" of the message found in the Notification object
1750
- notificationId: "notification_id_example",
1751
- // GetNotificationHistoryRequestBody
1752
- getNotificationHistoryRequestBody: {
1753
- events: "sent",
1754
- email: "email_example",
1755
- app_id: "app_id_example",
1756
- },
1757
- };
1758
-
1759
- const response = await apiInstance.getNotificationHistory(body);
1760
- console.log(response);
1761
- ```
1762
-
1763
-
1764
- ### Parameters
1765
-
1766
- Name | Type | Description | Notes
1767
- ------------- | ------------- | ------------- | -------------
1768
- **getNotificationHistoryRequestBody** | **GetNotificationHistoryRequestBody**| |
1769
- **notificationId** | [**string**] | The \&quot;id\&quot; of the message found in the Notification object | defaults to undefined
1770
-
1771
-
1772
- ### Return type
1773
-
1774
- **NotificationHistorySuccessResponse**
1775
-
1776
- ### Authorization
1777
-
1778
- [rest_api_key](README.md#rest_api_key)
1779
-
1780
- ### HTTP request headers
1781
-
1782
- - **Content-Type**: application/json
1783
- - **Accept**: application/json
1784
-
1785
-
1786
- ### HTTP response details
1787
- | Status code | Description | Response headers |
1788
- |-------------|-------------|------------------|
1789
- **200** | OK | - |
1790
- **400** | Bad Request | - |
1791
- **404** | Not Found | - |
1792
- **429** | Rate Limit Exceeded | - |
1793
-
1794
- [[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)
1795
-
1796
- # **getNotifications**
1797
- > NotificationSlice getNotifications()
1798
-
1799
- View the details of multiple notifications
1800
-
1801
- ### Example
1802
-
1803
-
1804
- ```typescript
1805
- import Onesignal from '@onesignal/node-onesignal';
1806
-
1807
- const configuration = Onesignal.createConfiguration({
1808
- restApiKey: '<YOUR_REST_API_KEY>',
1809
- });
1810
- const apiInstance = new Onesignal.DefaultApi(configuration);
1811
-
1812
- let body: Onesignal.DefaultApiGetNotificationsRequest = {
1813
- // string | The app ID that you want to view notifications from
1814
- appId: "app_id_example",
1815
- // number | How many notifications to return. Max is 50. Default is 50. (optional)
1816
- limit: 1,
1817
- // 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)
1818
- offset: 1,
1819
- // 0 | 1 | 3 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional)
1820
- kind: 0,
1821
- };
1822
-
1823
- const response = await apiInstance.getNotifications(body);
1824
- console.log(response);
1825
- ```
1826
-
1827
-
1828
- ### Parameters
1829
-
1830
- Name | Type | Description | Notes
1831
- ------------- | ------------- | ------------- | -------------
1832
- **appId** | [**string**] | The app ID that you want to view notifications from | defaults to undefined
1833
- **limit** | [**number**] | How many notifications to return. Max is 50. Default is 50. | (optional) defaults to undefined
1834
- **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
1835
- **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
1836
-
1837
-
1838
- ### Return type
1839
-
1840
- **NotificationSlice**
1841
-
1842
- ### Authorization
1843
-
1844
- [rest_api_key](README.md#rest_api_key)
1845
-
1846
- ### HTTP request headers
1847
-
1848
- - **Content-Type**: Not defined
1849
- - **Accept**: application/json
1850
-
1851
-
1852
- ### HTTP response details
1853
- | Status code | Description | Response headers |
1854
- |-------------|-------------|------------------|
1855
- **200** | OK | - |
1856
- **400** | Bad Request | - |
1857
- **429** | Rate Limit Exceeded | - |
1858
-
1859
- [[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)
1860
-
1861
- # **getOutcomes**
1862
- > OutcomesData getOutcomes()
1863
-
1864
- 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.
1865
-
1866
- ### Example
1867
-
1868
-
1869
- ```typescript
1870
- import Onesignal from '@onesignal/node-onesignal';
1871
-
1872
- const configuration = Onesignal.createConfiguration({
1873
- restApiKey: '<YOUR_REST_API_KEY>',
1874
- });
1875
- const apiInstance = new Onesignal.DefaultApi(configuration);
1876
-
1877
- let body: Onesignal.DefaultApiGetOutcomesRequest = {
1878
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1879
- appId: "app_id_example",
1880
- // 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
1881
- outcomeNames: "outcome_names_example",
1882
- // 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)
1883
- outcomeNames2: "outcome_names[]_example",
1884
- // 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)
1885
- outcomeTimeRange: "outcome_time_range_example",
1886
- // 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)
1887
- outcomePlatforms: "outcome_platforms_example",
1888
- // 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)
1889
- outcomeAttribution: "outcome_attribution_example",
1890
- };
1891
-
1892
- const response = await apiInstance.getOutcomes(body);
1893
- console.log(response);
1894
- ```
1895
-
1896
-
1897
- ### Parameters
1898
-
1899
- Name | Type | Description | Notes
1900
- ------------- | ------------- | ------------- | -------------
1901
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1902
- **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
1903
- **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
1904
- **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
1905
- **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
1906
- **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
1907
-
1908
-
1909
- ### Return type
1910
-
1911
- **OutcomesData**
1912
-
1913
- ### Authorization
1914
-
1915
- [rest_api_key](README.md#rest_api_key)
1916
-
1917
- ### HTTP request headers
1918
-
1919
- - **Content-Type**: Not defined
1920
- - **Accept**: application/json
1921
-
1922
-
1923
- ### HTTP response details
1924
- | Status code | Description | Response headers |
1925
- |-------------|-------------|------------------|
1926
- **200** | OK | - |
1927
- **400** | Bad Request | - |
1928
- **429** | Rate Limit Exceeded | - |
1929
-
1930
- [[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)
1931
-
1932
- # **getSegments**
1933
- > GetSegmentsSuccessResponse getSegments()
1934
-
1935
- Returns an array of segments from an app.
1936
-
1937
- ### Example
1938
-
1939
-
1940
- ```typescript
1941
- import Onesignal from '@onesignal/node-onesignal';
1942
-
1943
- const configuration = Onesignal.createConfiguration({
1944
- restApiKey: '<YOUR_REST_API_KEY>',
1945
- });
1946
- const apiInstance = new Onesignal.DefaultApi(configuration);
1947
-
1948
- let body: Onesignal.DefaultApiGetSegmentsRequest = {
1949
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1950
- appId: "app_id_example",
1951
- // 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)
1952
- offset: 1,
1953
- // number | The amount of Segments in the response. Maximum 300. (optional)
1954
- limit: 1,
1955
- };
1956
-
1957
- const response = await apiInstance.getSegments(body);
1958
- console.log(response);
1959
- ```
1960
-
1961
-
1962
- ### Parameters
1963
-
1964
- Name | Type | Description | Notes
1965
- ------------- | ------------- | ------------- | -------------
1966
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1967
- **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
1968
- **limit** | [**number**] | The amount of Segments in the response. Maximum 300. | (optional) defaults to undefined
1969
-
1970
-
1971
- ### Return type
1972
-
1973
- **GetSegmentsSuccessResponse**
1974
-
1975
- ### Authorization
1976
-
1977
- [rest_api_key](README.md#rest_api_key)
1978
-
1979
- ### HTTP request headers
1980
-
1981
- - **Content-Type**: Not defined
1982
- - **Accept**: application/json
1983
-
1984
-
1985
- ### HTTP response details
1986
- | Status code | Description | Response headers |
1987
- |-------------|-------------|------------------|
1988
- **201** | OK | - |
1989
- **400** | Bad Request | - |
1990
- **429** | Rate Limit Exceeded | - |
1991
-
1992
- [[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)
1993
-
1994
- # **getUser**
1995
- > User getUser()
1996
-
1997
- Returns the User’s properties, Aliases, and Subscriptions.
1998
-
1999
- ### Example
2000
-
2001
-
2002
- ```typescript
2003
- import Onesignal from '@onesignal/node-onesignal';
2004
-
2005
- const configuration = Onesignal.createConfiguration({
2006
- restApiKey: '<YOUR_REST_API_KEY>',
2007
- });
2008
- const apiInstance = new Onesignal.DefaultApi(configuration);
2009
-
2010
- let body: Onesignal.DefaultApiGetUserRequest = {
2011
- // string
2012
- appId: "app_id_example",
2013
- // string
2014
- aliasLabel: "alias_label_example",
2015
- // string
2016
- aliasId: "alias_id_example",
2017
- };
2018
-
2019
- const response = await apiInstance.getUser(body);
2020
- console.log(response);
2021
- ```
2022
-
2023
-
2024
- ### Parameters
2025
-
2026
- Name | Type | Description | Notes
2027
- ------------- | ------------- | ------------- | -------------
2028
- **appId** | [**string**] | | defaults to undefined
2029
- **aliasLabel** | [**string**] | | defaults to undefined
2030
- **aliasId** | [**string**] | | defaults to undefined
2031
-
2032
-
2033
- ### Return type
2034
-
2035
- **User**
2036
-
2037
- ### Authorization
2038
-
2039
- [rest_api_key](README.md#rest_api_key)
2040
-
2041
- ### HTTP request headers
2042
-
2043
- - **Content-Type**: Not defined
2044
- - **Accept**: application/json
2045
-
2046
-
2047
- ### HTTP response details
2048
- | Status code | Description | Response headers |
2049
- |-------------|-------------|------------------|
2050
- **200** | OK | - |
2051
- **400** | Bad Request | - |
2052
- **404** | Not Found | - |
2053
- **429** | Rate Limit Exceeded | - |
2054
-
2055
- [[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)
2056
-
2057
- # **rotateApiKey**
2058
- > CreateApiKeyResponse rotateApiKey()
2059
-
2060
- Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch.
2061
-
2062
- ### Example
2063
-
2064
-
2065
- ```typescript
2066
- import Onesignal from '@onesignal/node-onesignal';
2067
-
2068
- const configuration = Onesignal.createConfiguration({
2069
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
2070
- });
2071
- const apiInstance = new Onesignal.DefaultApi(configuration);
2072
-
2073
- let body: Onesignal.DefaultApiRotateApiKeyRequest = {
2074
- // string
2075
- appId: "app_id_example",
2076
- // string
2077
- tokenId: "token_id_example",
2078
- };
2079
-
2080
- const response = await apiInstance.rotateApiKey(body);
2081
- console.log(response);
2082
- ```
2083
-
2084
-
2085
- ### Parameters
2086
-
2087
- Name | Type | Description | Notes
2088
- ------------- | ------------- | ------------- | -------------
2089
- **appId** | [**string**] | | defaults to undefined
2090
- **tokenId** | [**string**] | | defaults to undefined
2091
-
2092
-
2093
- ### Return type
2094
-
2095
- **CreateApiKeyResponse**
2096
-
2097
- ### Authorization
2098
-
2099
- [organization_api_key](README.md#organization_api_key)
2100
-
2101
- ### HTTP request headers
2102
-
2103
- - **Content-Type**: Not defined
2104
- - **Accept**: application/json
2105
-
2106
-
2107
- ### HTTP response details
2108
- | Status code | Description | Response headers |
2109
- |-------------|-------------|------------------|
2110
- **200** | OK | - |
2111
- **400** | Bad Request | - |
2112
-
2113
- [[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)
2114
-
2115
- # **startLiveActivity**
2116
- > StartLiveActivitySuccessResponse startLiveActivity(startLiveActivityRequest)
2117
-
2118
- Remotely start a Live Activity on iOS devices via OneSignal’s REST API.
2119
-
2120
- ### Example
2121
-
2122
-
2123
- ```typescript
2124
- import Onesignal from '@onesignal/node-onesignal';
2125
-
2126
- const configuration = Onesignal.createConfiguration({
2127
- restApiKey: '<YOUR_REST_API_KEY>',
2128
- });
2129
- const apiInstance = new Onesignal.DefaultApi(configuration);
2130
-
2131
- let body: Onesignal.DefaultApiStartLiveActivityRequest = {
2132
- // string | Your OneSignal App ID in UUID v4 format.
2133
- appId: "app_id_example",
2134
- // string | The name of the Live Activity defined in your app. This should match the attributes struct used in your app\'s Live Activity implementation.
2135
- activityType: "activity_type_example",
2136
- // StartLiveActivityRequest
2137
- startLiveActivityRequest: {
2138
- name: "name_example",
2139
- event: "start",
2140
- activity_id: "activity_id_example",
2141
- event_attributes: {},
2142
- event_updates: {},
2143
- contents: {
2144
- en: "en_example",
2145
- ar: "ar_example",
2146
- bs: "bs_example",
2147
- bg: "bg_example",
2148
- ca: "ca_example",
2149
- zh_hans: "zh_hans_example",
2150
- zh_hant: "zh_hant_example",
2151
- zh: "zh_example",
2152
- hr: "hr_example",
2153
- cs: "cs_example",
2154
- da: "da_example",
2155
- nl: "nl_example",
2156
- et: "et_example",
2157
- fi: "fi_example",
2158
- fr: "fr_example",
2159
- ka: "ka_example",
2160
- de: "de_example",
2161
- el: "el_example",
2162
- hi: "hi_example",
2163
- he: "he_example",
2164
- hu: "hu_example",
2165
- id: "id_example",
2166
- it: "it_example",
2167
- ja: "ja_example",
2168
- ko: "ko_example",
2169
- lv: "lv_example",
2170
- lt: "lt_example",
2171
- ms: "ms_example",
2172
- nb: "nb_example",
2173
- pl: "pl_example",
2174
- fa: "fa_example",
2175
- pt: "pt_example",
2176
- pa: "pa_example",
2177
- ro: "ro_example",
2178
- ru: "ru_example",
2179
- sr: "sr_example",
2180
- sk: "sk_example",
2181
- es: "es_example",
2182
- sv: "sv_example",
2183
- th: "th_example",
2184
- tr: "tr_example",
2185
- uk: "uk_example",
2186
- vi: "vi_example",
2187
- },
2188
- headings: {
2189
- en: "en_example",
2190
- ar: "ar_example",
2191
- bs: "bs_example",
2192
- bg: "bg_example",
2193
- ca: "ca_example",
2194
- zh_hans: "zh_hans_example",
2195
- zh_hant: "zh_hant_example",
2196
- zh: "zh_example",
2197
- hr: "hr_example",
2198
- cs: "cs_example",
2199
- da: "da_example",
2200
- nl: "nl_example",
2201
- et: "et_example",
2202
- fi: "fi_example",
2203
- fr: "fr_example",
2204
- ka: "ka_example",
2205
- de: "de_example",
2206
- el: "el_example",
2207
- hi: "hi_example",
2208
- he: "he_example",
2209
- hu: "hu_example",
2210
- id: "id_example",
2211
- it: "it_example",
2212
- ja: "ja_example",
2213
- ko: "ko_example",
2214
- lv: "lv_example",
2215
- lt: "lt_example",
2216
- ms: "ms_example",
2217
- nb: "nb_example",
2218
- pl: "pl_example",
2219
- fa: "fa_example",
2220
- pt: "pt_example",
2221
- pa: "pa_example",
2222
- ro: "ro_example",
2223
- ru: "ru_example",
2224
- sr: "sr_example",
2225
- sk: "sk_example",
2226
- es: "es_example",
2227
- sv: "sv_example",
2228
- th: "th_example",
2229
- tr: "tr_example",
2230
- uk: "uk_example",
2231
- vi: "vi_example",
2232
- },
2233
- stale_date: 1,
2234
- priority: 1,
2235
- ios_relevance_score: 3.14,
2236
- idempotency_key: "idempotency_key_example",
2237
- include_aliases: {
2238
- "key": [
2239
- "key_example",
2240
- ],
2241
- },
2242
- include_subscription_ids: [
2243
- "include_subscription_ids_example",
2244
- ],
2245
- included_segments: [
2246
- "included_segments_example",
2247
- ],
2248
- excluded_segments: [
2249
- "excluded_segments_example",
2250
- ],
2251
- filters: [
2252
- null,
2253
- ],
2254
- },
2255
- };
2256
-
2257
- const response = await apiInstance.startLiveActivity(body);
2258
- console.log(response);
2259
- ```
2260
-
2261
-
2262
- ### Parameters
2263
-
2264
- Name | Type | Description | Notes
2265
- ------------- | ------------- | ------------- | -------------
2266
- **startLiveActivityRequest** | **StartLiveActivityRequest**| |
2267
- **appId** | [**string**] | Your OneSignal App ID in UUID v4 format. | defaults to undefined
2268
- **activityType** | [**string**] | The name of the Live Activity defined in your app. This should match the attributes struct used in your app\&#39;s Live Activity implementation. | defaults to undefined
2269
-
2270
-
2271
- ### Return type
2272
-
2273
- **StartLiveActivitySuccessResponse**
2274
-
2275
- ### Authorization
2276
-
2277
- [rest_api_key](README.md#rest_api_key)
2278
-
2279
- ### HTTP request headers
2280
-
2281
- - **Content-Type**: application/json
2282
- - **Accept**: application/json
2283
-
2284
-
2285
- ### HTTP response details
2286
- | Status code | Description | Response headers |
2287
- |-------------|-------------|------------------|
2288
- **201** | Created | - |
2289
- **400** | Bad Request | - |
2290
- **429** | Rate Limit Exceeded | - |
2291
-
2292
- [[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)
2293
-
2294
- # **transferSubscription**
2295
- > UserIdentityBody transferSubscription(transferSubscriptionRequestBody)
2296
-
2297
- Transfers this Subscription to the User identified by the identity in the payload.
2298
-
2299
- ### Example
2300
-
2301
-
2302
- ```typescript
2303
- import Onesignal from '@onesignal/node-onesignal';
2304
-
2305
- const configuration = Onesignal.createConfiguration({
2306
- restApiKey: '<YOUR_REST_API_KEY>',
2307
- });
2308
- const apiInstance = new Onesignal.DefaultApi(configuration);
2309
-
2310
- let body: Onesignal.DefaultApiTransferSubscriptionRequest = {
2311
- // string
2312
- appId: "app_id_example",
2313
- // string
2314
- subscriptionId: "subscription_id_example",
2315
- // TransferSubscriptionRequestBody
2316
- transferSubscriptionRequestBody: {
2317
- identity: {
2318
- "key": "key_example",
2319
- },
2320
- },
2321
- };
2322
-
2323
- const response = await apiInstance.transferSubscription(body);
2324
- console.log(response);
2325
- ```
2326
-
2327
-
2328
- ### Parameters
2329
-
2330
- Name | Type | Description | Notes
2331
- ------------- | ------------- | ------------- | -------------
2332
- **transferSubscriptionRequestBody** | **TransferSubscriptionRequestBody**| |
2333
- **appId** | [**string**] | | defaults to undefined
2334
- **subscriptionId** | [**string**] | | defaults to undefined
2335
-
2336
-
2337
- ### Return type
2338
-
2339
- **UserIdentityBody**
2340
-
2341
- ### Authorization
2342
-
2343
- [rest_api_key](README.md#rest_api_key)
2344
-
2345
- ### HTTP request headers
2346
-
2347
- - **Content-Type**: application/json
2348
- - **Accept**: application/json
2349
-
2350
-
2351
- ### HTTP response details
2352
- | Status code | Description | Response headers |
2353
- |-------------|-------------|------------------|
2354
- **200** | OK | - |
2355
- **400** | Bad Request | - |
2356
- **404** | Not Found | - |
2357
- **409** | Conflict | - |
2358
- **429** | Rate Limit Exceeded | - |
2359
-
2360
- [[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)
2361
-
2362
- # **unsubscribeEmailWithToken**
2363
- > GenericSuccessBoolResponse unsubscribeEmailWithToken()
2364
-
2365
- Unsubscribe an email with a token when using your own custom email unsubscribe landing page
2366
-
2367
- ### Example
2368
-
2369
-
2370
- ```typescript
2371
- import Onesignal from '@onesignal/node-onesignal';
2372
-
2373
- const configuration = Onesignal.createConfiguration({
2374
- restApiKey: '<YOUR_REST_API_KEY>',
2375
- });
2376
- const apiInstance = new Onesignal.DefaultApi(configuration);
2377
-
2378
- let body: Onesignal.DefaultApiUnsubscribeEmailWithTokenRequest = {
2379
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
2380
- appId: "app_id_example",
2381
- // string | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
2382
- notificationId: "notification_id_example",
2383
- // string | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
2384
- token: "token_example",
2385
- };
2386
-
2387
- const response = await apiInstance.unsubscribeEmailWithToken(body);
2388
- console.log(response);
2389
- ```
2390
-
2391
-
2392
- ### Parameters
2393
-
2394
- Name | Type | Description | Notes
2395
- ------------- | ------------- | ------------- | -------------
2396
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
2397
- **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
2398
- **token** | [**string**] | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | defaults to undefined
2399
-
2400
-
2401
- ### Return type
2402
-
2403
- **GenericSuccessBoolResponse**
2404
-
2405
- ### Authorization
2406
-
2407
- [rest_api_key](README.md#rest_api_key)
2408
-
2409
- ### HTTP request headers
2410
-
2411
- - **Content-Type**: Not defined
2412
- - **Accept**: application/json
2413
-
2414
-
2415
- ### HTTP response details
2416
- | Status code | Description | Response headers |
2417
- |-------------|-------------|------------------|
2418
- **202** | OK | - |
2419
- **400** | Bad Request | - |
2420
- **429** | Rate Limit Exceeded | - |
2421
-
2422
- [[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)
2423
-
2424
- # **updateApiKey**
2425
- > object updateApiKey(updateApiKeyRequest)
2426
-
2427
- Update a Rich Authentication Token (App API Key) for a OneSignal app.
2428
-
2429
- ### Example
2430
-
2431
-
2432
- ```typescript
2433
- import Onesignal from '@onesignal/node-onesignal';
2434
-
2435
- const configuration = Onesignal.createConfiguration({
2436
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
2437
- });
2438
- const apiInstance = new Onesignal.DefaultApi(configuration);
2439
-
2440
- let body: Onesignal.DefaultApiUpdateApiKeyRequest = {
2441
- // string
2442
- appId: "app_id_example",
2443
- // string
2444
- tokenId: "token_id_example",
2445
- // UpdateApiKeyRequest
2446
- updateApiKeyRequest: {
2447
- name: "name_example",
2448
- ip_allowlist_mode: "disabled",
2449
- ip_allowlist: [
2450
- "ip_allowlist_example",
2451
- ],
2452
- },
2453
- };
2454
-
2455
- const response = await apiInstance.updateApiKey(body);
2456
- console.log(response);
2457
- ```
2458
-
2459
-
2460
- ### Parameters
2461
-
2462
- Name | Type | Description | Notes
2463
- ------------- | ------------- | ------------- | -------------
2464
- **updateApiKeyRequest** | **UpdateApiKeyRequest**| |
2465
- **appId** | [**string**] | | defaults to undefined
2466
- **tokenId** | [**string**] | | defaults to undefined
2467
-
2468
-
2469
- ### Return type
2470
-
2471
- **object**
2472
-
2473
- ### Authorization
2474
-
2475
- [organization_api_key](README.md#organization_api_key)
2476
-
2477
- ### HTTP request headers
2478
-
2479
- - **Content-Type**: application/json
2480
- - **Accept**: application/json
2481
-
2482
-
2483
- ### HTTP response details
2484
- | Status code | Description | Response headers |
2485
- |-------------|-------------|------------------|
2486
- **200** | OK | - |
2487
- **400** | Bad Request | - |
2488
-
2489
- [[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)
2490
-
2491
- # **updateApp**
2492
- > App updateApp(app)
2493
-
2494
- Updates the name or configuration settings of an existing OneSignal app
2495
-
2496
- ### Example
2497
-
2498
-
2499
- ```typescript
2500
- import Onesignal from '@onesignal/node-onesignal';
2501
-
2502
- const configuration = Onesignal.createConfiguration({
2503
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
2504
- });
2505
- const apiInstance = new Onesignal.DefaultApi(configuration);
2506
-
2507
- let body: Onesignal.DefaultApiUpdateAppRequest = {
2508
- // string | An app id
2509
- appId: "app_id_example",
2510
- // App
2511
- app: {
2512
- name: "name_example",
2513
- android_gcm_sender_id: "android_gcm_sender_id_example",
2514
- gcm_key: "gcm_key_example",
2515
- chrome_web_origin: "chrome_web_origin_example",
2516
- chrome_key: "chrome_key_example",
2517
- chrome_web_default_notification_icon: "chrome_web_default_notification_icon_example",
2518
- chrome_web_sub_domain: "chrome_web_sub_domain_example",
2519
- apns_env: "sandbox",
2520
- apns_p12: "apns_p12_example",
2521
- apns_p12_password: "apns_p12_password_example",
2522
- safari_apns_p12: "safari_apns_p12_example",
2523
- safari_apns_p12_password: "safari_apns_p12_password_example",
2524
- apns_key_id: "apns_key_id_example",
2525
- apns_team_id: "apns_team_id_example",
2526
- apns_bundle_id: "apns_bundle_id_example",
2527
- apns_p8: "apns_p8_example",
2528
- safari_site_origin: "safari_site_origin_example",
2529
- safari_icon_256_256: "safari_icon_256_256_example",
2530
- site_name: "site_name_example",
2531
- organization_id: "organization_id_example",
2532
- additional_data_is_root_payload: true,
2533
- },
2534
- };
2535
-
2536
- const response = await apiInstance.updateApp(body);
2537
- console.log(response);
2538
- ```
2539
-
2540
-
2541
- ### Parameters
2542
-
2543
- Name | Type | Description | Notes
2544
- ------------- | ------------- | ------------- | -------------
2545
- **app** | **App**| |
2546
- **appId** | [**string**] | An app id | defaults to undefined
2547
-
2548
-
2549
- ### Return type
2550
-
2551
- **App**
2552
-
2553
- ### Authorization
2554
-
2555
- [organization_api_key](README.md#organization_api_key)
2556
-
2557
- ### HTTP request headers
2558
-
2559
- - **Content-Type**: application/json
2560
- - **Accept**: application/json
2561
-
2562
-
2563
- ### HTTP response details
2564
- | Status code | Description | Response headers |
2565
- |-------------|-------------|------------------|
2566
- **200** | OK | - |
2567
- **400** | Bad Request | - |
2568
- **429** | Rate Limit Exceeded | - |
2569
-
2570
- [[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)
2571
-
2572
- # **updateLiveActivity**
2573
- > UpdateLiveActivitySuccessResponse updateLiveActivity(updateLiveActivityRequest)
2574
-
2575
- Updates a specified live activity.
2576
-
2577
- ### Example
2578
-
2579
-
2580
- ```typescript
2581
- import Onesignal from '@onesignal/node-onesignal';
2582
-
2583
- const configuration = Onesignal.createConfiguration({
2584
- restApiKey: '<YOUR_REST_API_KEY>',
2585
- });
2586
- const apiInstance = new Onesignal.DefaultApi(configuration);
2587
-
2588
- let body: Onesignal.DefaultApiUpdateLiveActivityRequest = {
2589
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
2590
- appId: "app_id_example",
2591
- // string | Live Activity record ID
2592
- activityId: "activity_id_example",
2593
- // UpdateLiveActivityRequest
2594
- updateLiveActivityRequest: {
2595
- name: "name_example",
2596
- event: "update",
2597
- event_updates: {},
2598
- contents: {
2599
- en: "en_example",
2600
- ar: "ar_example",
2601
- bs: "bs_example",
2602
- bg: "bg_example",
2603
- ca: "ca_example",
2604
- zh_hans: "zh_hans_example",
2605
- zh_hant: "zh_hant_example",
2606
- zh: "zh_example",
2607
- hr: "hr_example",
2608
- cs: "cs_example",
2609
- da: "da_example",
2610
- nl: "nl_example",
2611
- et: "et_example",
2612
- fi: "fi_example",
2613
- fr: "fr_example",
2614
- ka: "ka_example",
2615
- de: "de_example",
2616
- el: "el_example",
2617
- hi: "hi_example",
2618
- he: "he_example",
2619
- hu: "hu_example",
2620
- id: "id_example",
2621
- it: "it_example",
2622
- ja: "ja_example",
2623
- ko: "ko_example",
2624
- lv: "lv_example",
2625
- lt: "lt_example",
2626
- ms: "ms_example",
2627
- nb: "nb_example",
2628
- pl: "pl_example",
2629
- fa: "fa_example",
2630
- pt: "pt_example",
2631
- pa: "pa_example",
2632
- ro: "ro_example",
2633
- ru: "ru_example",
2634
- sr: "sr_example",
2635
- sk: "sk_example",
2636
- es: "es_example",
2637
- sv: "sv_example",
2638
- th: "th_example",
2639
- tr: "tr_example",
2640
- uk: "uk_example",
2641
- vi: "vi_example",
2642
- },
2643
- headings: {
2644
- en: "en_example",
2645
- ar: "ar_example",
2646
- bs: "bs_example",
2647
- bg: "bg_example",
2648
- ca: "ca_example",
2649
- zh_hans: "zh_hans_example",
2650
- zh_hant: "zh_hant_example",
2651
- zh: "zh_example",
2652
- hr: "hr_example",
2653
- cs: "cs_example",
2654
- da: "da_example",
2655
- nl: "nl_example",
2656
- et: "et_example",
2657
- fi: "fi_example",
2658
- fr: "fr_example",
2659
- ka: "ka_example",
2660
- de: "de_example",
2661
- el: "el_example",
2662
- hi: "hi_example",
2663
- he: "he_example",
2664
- hu: "hu_example",
2665
- id: "id_example",
2666
- it: "it_example",
2667
- ja: "ja_example",
2668
- ko: "ko_example",
2669
- lv: "lv_example",
2670
- lt: "lt_example",
2671
- ms: "ms_example",
2672
- nb: "nb_example",
2673
- pl: "pl_example",
2674
- fa: "fa_example",
2675
- pt: "pt_example",
2676
- pa: "pa_example",
2677
- ro: "ro_example",
2678
- ru: "ru_example",
2679
- sr: "sr_example",
2680
- sk: "sk_example",
2681
- es: "es_example",
2682
- sv: "sv_example",
2683
- th: "th_example",
2684
- tr: "tr_example",
2685
- uk: "uk_example",
2686
- vi: "vi_example",
2687
- },
2688
- sound: "sound_example",
2689
- stale_date: 1,
2690
- dismissal_date: 1,
2691
- priority: 1,
2692
- },
2693
- };
2694
-
2695
- const response = await apiInstance.updateLiveActivity(body);
2696
- console.log(response);
2697
- ```
2698
-
2699
-
2700
- ### Parameters
2701
-
2702
- Name | Type | Description | Notes
2703
- ------------- | ------------- | ------------- | -------------
2704
- **updateLiveActivityRequest** | **UpdateLiveActivityRequest**| |
2705
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
2706
- **activityId** | [**string**] | Live Activity record ID | defaults to undefined
2707
-
2708
-
2709
- ### Return type
2710
-
2711
- **UpdateLiveActivitySuccessResponse**
2712
-
2713
- ### Authorization
2714
-
2715
- [rest_api_key](README.md#rest_api_key)
2716
-
2717
- ### HTTP request headers
2718
-
2719
- - **Content-Type**: application/json
2720
- - **Accept**: application/json
2721
-
2722
-
2723
- ### HTTP response details
2724
- | Status code | Description | Response headers |
2725
- |-------------|-------------|------------------|
2726
- **200** | OK | - |
2727
- **400** | Bad Request | - |
2728
- **429** | Rate Limit Exceeded | - |
2729
-
2730
- [[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)
2731
-
2732
- # **updateSubscription**
2733
- > void updateSubscription(subscriptionBody)
2734
-
2735
- Updates an existing Subscription’s properties.
2736
-
2737
- ### Example
2738
-
2739
-
2740
- ```typescript
2741
- import Onesignal from '@onesignal/node-onesignal';
2742
-
2743
- const configuration = Onesignal.createConfiguration({
2744
- restApiKey: '<YOUR_REST_API_KEY>',
2745
- });
2746
- const apiInstance = new Onesignal.DefaultApi(configuration);
2747
-
2748
- let body: Onesignal.DefaultApiUpdateSubscriptionRequest = {
2749
- // string
2750
- appId: "app_id_example",
2751
- // string
2752
- subscriptionId: "subscription_id_example",
2753
- // SubscriptionBody
2754
- subscriptionBody: {
2755
- subscription: {
2756
- id: "id_example",
2757
- type: "iOSPush",
2758
- token: "token_example",
2759
- enabled: true,
2760
- notification_types: 1,
2761
- session_time: 1,
2762
- session_count: 1,
2763
- sdk: "sdk_example",
2764
- device_model: "device_model_example",
2765
- device_os: "device_os_example",
2766
- rooted: true,
2767
- test_type: 1,
2768
- app_version: "app_version_example",
2769
- net_type: 1,
2770
- carrier: "carrier_example",
2771
- web_auth: "web_auth_example",
2772
- web_p256: "web_p256_example",
2773
- },
2774
- },
2775
- };
2776
-
2777
- const response = await apiInstance.updateSubscription(body);
2778
- console.log(response);
2779
- ```
2780
-
2781
-
2782
- ### Parameters
2783
-
2784
- Name | Type | Description | Notes
2785
- ------------- | ------------- | ------------- | -------------
2786
- **subscriptionBody** | **SubscriptionBody**| |
2787
- **appId** | [**string**] | | defaults to undefined
2788
- **subscriptionId** | [**string**] | | defaults to undefined
2789
-
2790
-
2791
- ### Return type
2792
-
2793
- **void**
2794
-
2795
- ### Authorization
2796
-
2797
- [rest_api_key](README.md#rest_api_key)
2798
-
2799
- ### HTTP request headers
2800
-
2801
- - **Content-Type**: application/json
2802
- - **Accept**: application/json
2803
-
2804
-
2805
- ### HTTP response details
2806
- | Status code | Description | Response headers |
2807
- |-------------|-------------|------------------|
2808
- **200** | OK | - |
2809
- **400** | Bad Request | - |
2810
- **404** | Not Found | - |
2811
- **409** | Conflict | - |
2812
- **429** | Rate Limit Exceeded | - |
2813
-
2814
- [[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)
2815
-
2816
- # **updateSubscriptionByToken**
2817
- > object updateSubscriptionByToken(subscriptionBody)
2818
-
2819
- Update properties on an existing OneSignal subscription using its token.
2820
-
2821
- ### Example
2822
-
2823
-
2824
- ```typescript
2825
- import Onesignal from '@onesignal/node-onesignal';
2826
-
2827
- const configuration = Onesignal.createConfiguration({
2828
- restApiKey: '<YOUR_REST_API_KEY>',
2829
- });
2830
- const apiInstance = new Onesignal.DefaultApi(configuration);
2831
-
2832
- let body: Onesignal.DefaultApiUpdateSubscriptionByTokenRequest = {
2833
- // string | Your OneSignal App ID in UUID v4 format.
2834
- appId: "app_id_example",
2835
- // string | The type of token to use when looking up the subscription. See Subscription Types.
2836
- tokenType: "token_type_example",
2837
- // string | The value of the token to lookup by (e.g., email address, phone number).
2838
- token: "token_example",
2839
- // SubscriptionBody
2840
- subscriptionBody: {
2841
- subscription: {
2842
- id: "id_example",
2843
- type: "iOSPush",
2844
- token: "token_example",
2845
- enabled: true,
2846
- notification_types: 1,
2847
- session_time: 1,
2848
- session_count: 1,
2849
- sdk: "sdk_example",
2850
- device_model: "device_model_example",
2851
- device_os: "device_os_example",
2852
- rooted: true,
2853
- test_type: 1,
2854
- app_version: "app_version_example",
2855
- net_type: 1,
2856
- carrier: "carrier_example",
2857
- web_auth: "web_auth_example",
2858
- web_p256: "web_p256_example",
2859
- },
2860
- },
2861
- };
2862
-
2863
- const response = await apiInstance.updateSubscriptionByToken(body);
2864
- console.log(response);
2865
- ```
2866
-
2867
-
2868
- ### Parameters
2869
-
2870
- Name | Type | Description | Notes
2871
- ------------- | ------------- | ------------- | -------------
2872
- **subscriptionBody** | **SubscriptionBody**| |
2873
- **appId** | [**string**] | Your OneSignal App ID in UUID v4 format. | defaults to undefined
2874
- **tokenType** | [**string**] | The type of token to use when looking up the subscription. See Subscription Types. | defaults to undefined
2875
- **token** | [**string**] | The value of the token to lookup by (e.g., email address, phone number). | defaults to undefined
2876
-
2877
-
2878
- ### Return type
2879
-
2880
- **object**
2881
-
2882
- ### Authorization
2883
-
2884
- [rest_api_key](README.md#rest_api_key)
2885
-
2886
- ### HTTP request headers
2887
-
2888
- - **Content-Type**: application/json
2889
- - **Accept**: application/json
2890
-
2891
-
2892
- ### HTTP response details
2893
- | Status code | Description | Response headers |
2894
- |-------------|-------------|------------------|
2895
- **202** | ACCEPTED | - |
2896
- **400** | Bad Request | - |
2897
- **404** | Not Found | - |
2898
-
2899
- [[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)
2900
-
2901
- # **updateTemplate**
2902
- > TemplateResource updateTemplate(updateTemplateRequest)
2903
-
2904
- Update an existing template.
2905
-
2906
- ### Example
2907
-
2908
-
2909
- ```typescript
2910
- import Onesignal from '@onesignal/node-onesignal';
2911
-
2912
- const configuration = Onesignal.createConfiguration({
2913
- restApiKey: '<YOUR_REST_API_KEY>',
2914
- });
2915
- const apiInstance = new Onesignal.DefaultApi(configuration);
2916
-
2917
- let body: Onesignal.DefaultApiUpdateTemplateRequest = {
2918
- // string
2919
- templateId: "template_id_example",
2920
- // string
2921
- appId: "app_id_example",
2922
- // UpdateTemplateRequest
2923
- updateTemplateRequest: {
2924
- name: "name_example",
2925
- contents: {
2926
- en: "en_example",
2927
- ar: "ar_example",
2928
- bs: "bs_example",
2929
- bg: "bg_example",
2930
- ca: "ca_example",
2931
- zh_hans: "zh_hans_example",
2932
- zh_hant: "zh_hant_example",
2933
- zh: "zh_example",
2934
- hr: "hr_example",
2935
- cs: "cs_example",
2936
- da: "da_example",
2937
- nl: "nl_example",
2938
- et: "et_example",
2939
- fi: "fi_example",
2940
- fr: "fr_example",
2941
- ka: "ka_example",
2942
- de: "de_example",
2943
- el: "el_example",
2944
- hi: "hi_example",
2945
- he: "he_example",
2946
- hu: "hu_example",
2947
- id: "id_example",
2948
- it: "it_example",
2949
- ja: "ja_example",
2950
- ko: "ko_example",
2951
- lv: "lv_example",
2952
- lt: "lt_example",
2953
- ms: "ms_example",
2954
- nb: "nb_example",
2955
- pl: "pl_example",
2956
- fa: "fa_example",
2957
- pt: "pt_example",
2958
- pa: "pa_example",
2959
- ro: "ro_example",
2960
- ru: "ru_example",
2961
- sr: "sr_example",
2962
- sk: "sk_example",
2963
- es: "es_example",
2964
- sv: "sv_example",
2965
- th: "th_example",
2966
- tr: "tr_example",
2967
- uk: "uk_example",
2968
- vi: "vi_example",
2969
- },
2970
- is_email: true,
2971
- email_subject: "email_subject_example",
2972
- email_body: "email_body_example",
2973
- is_sms: true,
2974
- dynamic_content: "dynamic_content_example",
2975
- },
2976
- };
2977
-
2978
- const response = await apiInstance.updateTemplate(body);
2979
- console.log(response);
2980
- ```
2981
-
2982
-
2983
- ### Parameters
2984
-
2985
- Name | Type | Description | Notes
2986
- ------------- | ------------- | ------------- | -------------
2987
- **updateTemplateRequest** | **UpdateTemplateRequest**| |
2988
- **templateId** | [**string**] | | defaults to undefined
2989
- **appId** | [**string**] | | defaults to undefined
2990
-
2991
-
2992
- ### Return type
2993
-
2994
- **TemplateResource**
2995
-
2996
- ### Authorization
2997
-
2998
- [rest_api_key](README.md#rest_api_key)
2999
-
3000
- ### HTTP request headers
3001
-
3002
- - **Content-Type**: application/json
3003
- - **Accept**: application/json
3004
-
3005
-
3006
- ### HTTP response details
3007
- | Status code | Description | Response headers |
3008
- |-------------|-------------|------------------|
3009
- **200** | OK | - |
3010
- **400** | Bad Request | - |
3011
-
3012
- [[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)
3013
-
3014
- # **updateUser**
3015
- > PropertiesBody updateUser(updateUserRequest)
3016
-
3017
- Updates an existing User’s properties.
3018
-
3019
- ### Example
3020
-
3021
-
3022
- ```typescript
3023
- import Onesignal from '@onesignal/node-onesignal';
3024
-
3025
- const configuration = Onesignal.createConfiguration({
3026
- restApiKey: '<YOUR_REST_API_KEY>',
3027
- });
3028
- const apiInstance = new Onesignal.DefaultApi(configuration);
3029
-
3030
- let body: Onesignal.DefaultApiUpdateUserRequest = {
3031
- // string
3032
- appId: "app_id_example",
3033
- // string
3034
- aliasLabel: "alias_label_example",
3035
- // string
3036
- aliasId: "alias_id_example",
3037
- // UpdateUserRequest
3038
- updateUserRequest: {
3039
- properties: {
3040
- tags: {},
3041
- language: "language_example",
3042
- timezone_id: "timezone_id_example",
3043
- lat: 3.14,
3044
- long: 3.14,
3045
- country: "country_example",
3046
- first_active: 1,
3047
- last_active: 1,
3048
- amount_spent: 3.14,
3049
- purchases: [
3050
- {
3051
- sku: "sku_example",
3052
- amount: "amount_example",
3053
- iso: "iso_example",
3054
- count: 1,
3055
- },
3056
- ],
3057
- ip: "ip_example",
3058
- },
3059
- refresh_device_metadata: false,
3060
- deltas: {
3061
- session_time: 1,
3062
- session_count: 1,
3063
- purchases: [
3064
- {
3065
- sku: "sku_example",
3066
- amount: "amount_example",
3067
- iso: "iso_example",
3068
- count: 1,
3069
- },
3070
- ],
3071
- },
3072
- },
3073
- };
3074
-
3075
- const response = await apiInstance.updateUser(body);
3076
- console.log(response);
3077
- ```
3078
-
3079
-
3080
- ### Parameters
3081
-
3082
- Name | Type | Description | Notes
3083
- ------------- | ------------- | ------------- | -------------
3084
- **updateUserRequest** | **UpdateUserRequest**| |
3085
- **appId** | [**string**] | | defaults to undefined
3086
- **aliasLabel** | [**string**] | | defaults to undefined
3087
- **aliasId** | [**string**] | | defaults to undefined
3088
-
3089
-
3090
- ### Return type
3091
-
3092
- **PropertiesBody**
3093
-
3094
- ### Authorization
3095
-
3096
- [rest_api_key](README.md#rest_api_key)
3097
-
3098
- ### HTTP request headers
3099
-
3100
- - **Content-Type**: application/json
3101
- - **Accept**: application/json
3102
-
3103
-
3104
- ### HTTP response details
3105
- | Status code | Description | Response headers |
3106
- |-------------|-------------|------------------|
3107
- **202** | ACCEPTED | - |
3108
- **400** | Bad Request | - |
3109
- **409** | Conflict | - |
3110
- **429** | Rate Limit Exceeded | - |
3111
-
3112
- [[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)
3113
-
3114
- # **viewApiKeys**
3115
- > ApiKeyTokensListResponse viewApiKeys()
3116
-
3117
- View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app.
3118
-
3119
- ### Example
3120
-
3121
-
3122
- ```typescript
3123
- import Onesignal from '@onesignal/node-onesignal';
3124
-
3125
- const configuration = Onesignal.createConfiguration({
3126
- organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
3127
- });
3128
- const apiInstance = new Onesignal.DefaultApi(configuration);
3129
-
3130
- let body: Onesignal.DefaultApiViewApiKeysRequest = {
3131
- // string
3132
- appId: "app_id_example",
3133
- };
3134
-
3135
- const response = await apiInstance.viewApiKeys(body);
3136
- console.log(response);
3137
- ```
3138
-
3139
-
3140
- ### Parameters
3141
-
3142
- Name | Type | Description | Notes
3143
- ------------- | ------------- | ------------- | -------------
3144
- **appId** | [**string**] | | defaults to undefined
3145
-
3146
-
3147
- ### Return type
3148
-
3149
- **ApiKeyTokensListResponse**
3150
-
3151
- ### Authorization
3152
-
3153
- [organization_api_key](README.md#organization_api_key)
3154
-
3155
- ### HTTP request headers
3156
-
3157
- - **Content-Type**: Not defined
3158
- - **Accept**: application/json
3159
-
3160
-
3161
- ### HTTP response details
3162
- | Status code | Description | Response headers |
3163
- |-------------|-------------|------------------|
3164
- **200** | OK | - |
3165
- **400** | Bad Request | - |
3166
-
3167
- [[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)
3168
-
3169
- # **viewTemplate**
3170
- > TemplateResource viewTemplate()
3171
-
3172
- Fetch a single template by id.
3173
-
3174
- ### Example
3175
-
3176
-
3177
- ```typescript
3178
- import Onesignal from '@onesignal/node-onesignal';
3179
-
3180
- const configuration = Onesignal.createConfiguration({
3181
- restApiKey: '<YOUR_REST_API_KEY>',
3182
- });
3183
- const apiInstance = new Onesignal.DefaultApi(configuration);
3184
-
3185
- let body: Onesignal.DefaultApiViewTemplateRequest = {
3186
- // string
3187
- templateId: "template_id_example",
3188
- // string
3189
- appId: "app_id_example",
3190
- };
3191
-
3192
- const response = await apiInstance.viewTemplate(body);
3193
- console.log(response);
3194
- ```
3195
-
3196
-
3197
- ### Parameters
3198
-
3199
- Name | Type | Description | Notes
3200
- ------------- | ------------- | ------------- | -------------
3201
- **templateId** | [**string**] | | defaults to undefined
3202
- **appId** | [**string**] | | defaults to undefined
3203
-
3204
-
3205
- ### Return type
3206
-
3207
- **TemplateResource**
3208
-
3209
- ### Authorization
3210
-
3211
- [rest_api_key](README.md#rest_api_key)
3212
-
3213
- ### HTTP request headers
3214
-
3215
- - **Content-Type**: Not defined
3216
- - **Accept**: application/json
3217
-
3218
-
3219
- ### HTTP response details
3220
- | Status code | Description | Response headers |
3221
- |-------------|-------------|------------------|
3222
- **200** | OK | - |
3223
- **400** | Bad Request | - |
3224
- **404** | Not Found | - |
3225
-
3226
- [[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)
3227
-
3228
- # **viewTemplates**
3229
- > TemplatesListResponse viewTemplates()
3230
-
3231
- List templates for an app.
3232
-
3233
- ### Example
3234
-
3235
-
3236
- ```typescript
3237
- import Onesignal from '@onesignal/node-onesignal';
3238
-
3239
- const configuration = Onesignal.createConfiguration({
3240
- restApiKey: '<YOUR_REST_API_KEY>',
3241
- });
3242
- const apiInstance = new Onesignal.DefaultApi(configuration);
3243
-
3244
- let body: Onesignal.DefaultApiViewTemplatesRequest = {
3245
- // string | Your OneSignal App ID in UUID v4 format.
3246
- appId: "app_id_example",
3247
- // number | Maximum number of templates. Default and max is 50. (optional)
3248
- limit: 50,
3249
- // number | Pagination offset. (optional)
3250
- offset: 0,
3251
- // 'push' | 'email' | 'sms' | Filter by delivery channel. (optional)
3252
- channel: "push",
3253
- };
3254
-
3255
- const response = await apiInstance.viewTemplates(body);
3256
- console.log(response);
3257
- ```
3258
-
3259
-
3260
- ### Parameters
3261
-
3262
- Name | Type | Description | Notes
3263
- ------------- | ------------- | ------------- | -------------
3264
- **appId** | [**string**] | Your OneSignal App ID in UUID v4 format. | defaults to undefined
3265
- **limit** | [**number**] | Maximum number of templates. Default and max is 50. | (optional) defaults to 50
3266
- **offset** | [**number**] | Pagination offset. | (optional) defaults to 0
3267
- **channel** | [**&#39;push&#39; | &#39;email&#39; | &#39;sms&#39;**]**Array<&#39;push&#39; &#124; &#39;email&#39; &#124; &#39;sms&#39;>** | Filter by delivery channel. | (optional) defaults to undefined
3268
-
3269
-
3270
- ### Return type
3271
-
3272
- **TemplatesListResponse**
3273
-
3274
- ### Authorization
3275
-
3276
- [rest_api_key](README.md#rest_api_key)
3277
-
3278
- ### HTTP request headers
3279
-
3280
- - **Content-Type**: Not defined
3281
- - **Accept**: application/json
3282
-
3283
-
3284
- ### HTTP response details
3285
- | Status code | Description | Response headers |
3286
- |-------------|-------------|------------------|
3287
- **200** | OK | - |
3288
- **400** | Bad Request | - |
3289
- **429** | Rate Limit Exceeded | - |
3290
-
3291
- [[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)
3292
-
3293
-