@onesignal/node-onesignal 5.2.0-beta1 → 5.3.0-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 (142) hide show
  1. package/DefaultApi.md +1547 -431
  2. package/apis/DefaultApi.ts +1492 -89
  3. package/dist/apis/DefaultApi.d.ts +40 -0
  4. package/dist/apis/DefaultApi.js +1363 -100
  5. package/dist/apis/DefaultApi.js.map +1 -1
  6. package/dist/models/ApiKeyToken.d.ts +23 -0
  7. package/dist/models/ApiKeyToken.js +52 -0
  8. package/dist/models/ApiKeyToken.js.map +1 -0
  9. package/dist/models/ApiKeyTokensListResponse.d.ts +18 -0
  10. package/dist/models/ApiKeyTokensListResponse.js +22 -0
  11. package/dist/models/ApiKeyTokensListResponse.js.map +1 -0
  12. package/dist/models/CopyTemplateRequest.d.ts +17 -0
  13. package/dist/models/CopyTemplateRequest.js +22 -0
  14. package/dist/models/CopyTemplateRequest.js.map +1 -0
  15. package/dist/models/CreateApiKeyRequest.d.ts +20 -0
  16. package/dist/models/CreateApiKeyRequest.js +34 -0
  17. package/dist/models/CreateApiKeyRequest.js.map +1 -0
  18. package/dist/models/CreateApiKeyResponse.d.ts +18 -0
  19. package/dist/models/CreateApiKeyResponse.js +28 -0
  20. package/dist/models/CreateApiKeyResponse.js.map +1 -0
  21. package/dist/models/CreateTemplateRequest.d.ts +25 -0
  22. package/dist/models/CreateTemplateRequest.js +64 -0
  23. package/dist/models/CreateTemplateRequest.js.map +1 -0
  24. package/dist/models/CustomEvent.d.ts +23 -0
  25. package/dist/models/CustomEvent.js +46 -0
  26. package/dist/models/CustomEvent.js.map +1 -0
  27. package/dist/models/CustomEventsRequest.d.ts +18 -0
  28. package/dist/models/CustomEventsRequest.js +22 -0
  29. package/dist/models/CustomEventsRequest.js.map +1 -0
  30. package/dist/models/NotificationWithMeta.d.ts +1 -0
  31. package/dist/models/NotificationWithMeta.js +6 -0
  32. package/dist/models/NotificationWithMeta.js.map +1 -1
  33. package/dist/models/NotificationWithMetaAllOf.d.ts +1 -0
  34. package/dist/models/NotificationWithMetaAllOf.js +6 -0
  35. package/dist/models/NotificationWithMetaAllOf.js.map +1 -1
  36. package/dist/models/ObjectSerializer.d.ts +14 -0
  37. package/dist/models/ObjectSerializer.js +47 -0
  38. package/dist/models/ObjectSerializer.js.map +1 -1
  39. package/dist/models/StartLiveActivityRequest.d.ts +37 -0
  40. package/dist/models/StartLiveActivityRequest.js +112 -0
  41. package/dist/models/StartLiveActivityRequest.js.map +1 -0
  42. package/dist/models/StartLiveActivitySuccessResponse.d.ts +17 -0
  43. package/dist/models/StartLiveActivitySuccessResponse.js +22 -0
  44. package/dist/models/StartLiveActivitySuccessResponse.js.map +1 -0
  45. package/dist/models/TemplateResource.d.ts +25 -0
  46. package/dist/models/TemplateResource.js +52 -0
  47. package/dist/models/TemplateResource.js.map +1 -0
  48. package/dist/models/TemplatesListResponse.d.ts +18 -0
  49. package/dist/models/TemplatesListResponse.js +22 -0
  50. package/dist/models/TemplatesListResponse.js.map +1 -0
  51. package/dist/models/UpdateApiKeyRequest.d.ts +20 -0
  52. package/dist/models/UpdateApiKeyRequest.js +34 -0
  53. package/dist/models/UpdateApiKeyRequest.js.map +1 -0
  54. package/dist/models/UpdateTemplateRequest.d.ts +24 -0
  55. package/dist/models/UpdateTemplateRequest.js +58 -0
  56. package/dist/models/UpdateTemplateRequest.js.map +1 -0
  57. package/dist/models/all.d.ts +14 -0
  58. package/dist/models/all.js +14 -0
  59. package/dist/models/all.js.map +1 -1
  60. package/dist/types/ObjectParamAPI.d.ts +88 -0
  61. package/dist/types/ObjectParamAPI.js +42 -0
  62. package/dist/types/ObjectParamAPI.js.map +1 -1
  63. package/dist/types/ObservableAPI.d.ts +26 -0
  64. package/dist/types/ObservableAPI.js +422 -86
  65. package/dist/types/ObservableAPI.js.map +1 -1
  66. package/dist/types/PromiseAPI.d.ts +26 -0
  67. package/dist/types/PromiseAPI.js +56 -0
  68. package/dist/types/PromiseAPI.js.map +1 -1
  69. package/models/ApiKeyToken.ts +69 -0
  70. package/models/ApiKeyTokensListResponse.ts +32 -0
  71. package/models/App.ts +1 -1
  72. package/models/BasicNotification.ts +1 -1
  73. package/models/BasicNotificationAllOf.ts +1 -1
  74. package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +1 -1
  75. package/models/Button.ts +1 -1
  76. package/models/CopyTemplateRequest.ts +34 -0
  77. package/models/CreateApiKeyRequest.ts +48 -0
  78. package/models/CreateApiKeyResponse.ts +38 -0
  79. package/models/CreateNotificationSuccessResponse.ts +1 -1
  80. package/models/CreateSegmentConflictResponse.ts +1 -1
  81. package/models/CreateSegmentSuccessResponse.ts +1 -1
  82. package/models/CreateTemplateRequest.ts +102 -0
  83. package/models/CreateUserConflictResponse.ts +1 -1
  84. package/models/CreateUserConflictResponseErrorsInner.ts +1 -1
  85. package/models/CreateUserConflictResponseErrorsItemsMeta.ts +1 -1
  86. package/models/CustomEvent.ts +74 -0
  87. package/models/CustomEventsRequest.ts +32 -0
  88. package/models/DeliveryData.ts +1 -1
  89. package/models/ExportEventsSuccessResponse.ts +1 -1
  90. package/models/ExportSubscriptionsRequestBody.ts +1 -1
  91. package/models/ExportSubscriptionsSuccessResponse.ts +1 -1
  92. package/models/Filter.ts +1 -1
  93. package/models/FilterExpression.ts +1 -1
  94. package/models/GenericError.ts +1 -1
  95. package/models/GenericSuccessBoolResponse.ts +1 -1
  96. package/models/GetNotificationHistoryRequestBody.ts +1 -1
  97. package/models/GetSegmentsSuccessResponse.ts +1 -1
  98. package/models/LanguageStringMap.ts +1 -1
  99. package/models/Notification.ts +1 -1
  100. package/models/NotificationAllOf.ts +1 -1
  101. package/models/NotificationHistorySuccessResponse.ts +1 -1
  102. package/models/NotificationSlice.ts +1 -1
  103. package/models/NotificationTarget.ts +1 -1
  104. package/models/NotificationWithMeta.ts +11 -1
  105. package/models/NotificationWithMetaAllOf.ts +11 -1
  106. package/models/ObjectSerializer.ts +48 -1
  107. package/models/Operator.ts +1 -1
  108. package/models/OutcomeData.ts +1 -1
  109. package/models/OutcomesData.ts +1 -1
  110. package/models/PlatformDeliveryData.ts +1 -1
  111. package/models/PlatformDeliveryDataEmailAllOf.ts +1 -1
  112. package/models/PlatformDeliveryDataSmsAllOf.ts +1 -1
  113. package/models/PropertiesBody.ts +1 -1
  114. package/models/PropertiesDeltas.ts +1 -1
  115. package/models/PropertiesObject.ts +1 -1
  116. package/models/Purchase.ts +1 -1
  117. package/models/RateLimitError.ts +1 -1
  118. package/models/Segment.ts +1 -1
  119. package/models/SegmentData.ts +1 -1
  120. package/models/SegmentNotificationTarget.ts +1 -1
  121. package/models/StartLiveActivityRequest.ts +177 -0
  122. package/models/StartLiveActivitySuccessResponse.ts +31 -0
  123. package/models/Subscription.ts +1 -1
  124. package/models/SubscriptionBody.ts +1 -1
  125. package/models/SubscriptionNotificationTarget.ts +1 -1
  126. package/models/TemplateResource.ts +72 -0
  127. package/models/TemplatesListResponse.ts +32 -0
  128. package/models/TransferSubscriptionRequestBody.ts +1 -1
  129. package/models/UpdateApiKeyRequest.ts +48 -0
  130. package/models/UpdateLiveActivityRequest.ts +1 -1
  131. package/models/UpdateLiveActivitySuccessResponse.ts +1 -1
  132. package/models/UpdateTemplateRequest.ts +92 -0
  133. package/models/UpdateUserRequest.ts +1 -1
  134. package/models/User.ts +1 -1
  135. package/models/UserIdentityBody.ts +1 -1
  136. package/models/WebButton.ts +1 -1
  137. package/models/all.ts +14 -0
  138. package/onesignal-node-onesignal-5.3.0-beta1.tgz +0 -0
  139. package/package.json +6 -5
  140. package/types/ObjectParamAPI.ts +386 -0
  141. package/types/ObservableAPI.ts +370 -0
  142. package/types/PromiseAPI.ts +174 -0
package/DefaultApi.md CHANGED
@@ -1,20 +1,26 @@
1
- # .DefaultApi
1
+ # Onesignal.DefaultApi
2
2
 
3
3
  All URIs are relative to *https://api.onesignal.com*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
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
8
9
  [**createAlias**](DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
9
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
10
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
11
14
  [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification
12
15
  [**createSegment**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment
13
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
14
18
  [**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users |
15
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
16
21
  [**deleteSegment**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment
17
22
  [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} |
23
+ [**deleteTemplate**](DefaultApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete template
18
24
  [**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
19
25
  [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events
20
26
  [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions
@@ -28,12 +34,20 @@ Method | HTTP request | Description
28
34
  [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
29
35
  [**getSegments**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments
30
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
31
39
  [**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner |
32
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
33
42
  [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app
34
43
  [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
35
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
36
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
37
51
 
38
52
 
39
53
  # **cancelNotification**
@@ -45,22 +59,22 @@ Used to stop a scheduled or currently outgoing notification
45
59
 
46
60
 
47
61
  ```typescript
48
- import { } from '';
49
- import * as fs from 'fs';
62
+ import Onesignal from '@onesignal/node-onesignal';
50
63
 
51
- const configuration = .createConfiguration();
52
- const apiInstance = new .DefaultApi(configuration);
64
+ const configuration = Onesignal.createConfiguration({
65
+ restApiKey: '<YOUR_REST_API_KEY>',
66
+ });
67
+ const apiInstance = new Onesignal.DefaultApi(configuration);
53
68
 
54
- let body:.DefaultApiCancelNotificationRequest = {
69
+ let body: Onesignal.DefaultApiCancelNotificationRequest = {
55
70
  // string
56
71
  appId: "app_id_example",
57
72
  // string
58
73
  notificationId: "notification_id_example",
59
74
  };
60
75
 
61
- apiInstance.cancelNotification(body).then((data:any) => {
62
- console.log('API called successfully. Returned data: ' + data);
63
- }).catch((error:any) => console.error(error));
76
+ const response = await apiInstance.cancelNotification(body);
77
+ console.log(response);
64
78
  ```
65
79
 
66
80
 
@@ -96,6 +110,69 @@ Name | Type | Description | Notes
96
110
 
97
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)
98
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
+
99
176
  # **createAlias**
100
177
  > UserIdentityBody createAlias(userIdentityBody)
101
178
 
@@ -105,13 +182,14 @@ Upserts one or more Aliases to an existing User identified by (:alias_label, :al
105
182
 
106
183
 
107
184
  ```typescript
108
- import { } from '';
109
- import * as fs from 'fs';
185
+ import Onesignal from '@onesignal/node-onesignal';
110
186
 
111
- const configuration = .createConfiguration();
112
- const apiInstance = new .DefaultApi(configuration);
187
+ const configuration = Onesignal.createConfiguration({
188
+ restApiKey: '<YOUR_REST_API_KEY>',
189
+ });
190
+ const apiInstance = new Onesignal.DefaultApi(configuration);
113
191
 
114
- let body:.DefaultApiCreateAliasRequest = {
192
+ let body: Onesignal.DefaultApiCreateAliasRequest = {
115
193
  // string
116
194
  appId: "app_id_example",
117
195
  // string
@@ -126,9 +204,8 @@ let body:.DefaultApiCreateAliasRequest = {
126
204
  },
127
205
  };
128
206
 
129
- apiInstance.createAlias(body).then((data:any) => {
130
- console.log('API called successfully. Returned data: ' + data);
131
- }).catch((error:any) => console.error(error));
207
+ const response = await apiInstance.createAlias(body);
208
+ console.log(response);
132
209
  ```
133
210
 
134
211
 
@@ -176,13 +253,14 @@ Upserts one or more Aliases for the User identified by :subscription_id.
176
253
 
177
254
 
178
255
  ```typescript
179
- import { } from '';
180
- import * as fs from 'fs';
256
+ import Onesignal from '@onesignal/node-onesignal';
181
257
 
182
- const configuration = .createConfiguration();
183
- const apiInstance = new .DefaultApi(configuration);
258
+ const configuration = Onesignal.createConfiguration({
259
+ restApiKey: '<YOUR_REST_API_KEY>',
260
+ });
261
+ const apiInstance = new Onesignal.DefaultApi(configuration);
184
262
 
185
- let body:.DefaultApiCreateAliasBySubscriptionRequest = {
263
+ let body: Onesignal.DefaultApiCreateAliasBySubscriptionRequest = {
186
264
  // string
187
265
  appId: "app_id_example",
188
266
  // string
@@ -195,9 +273,8 @@ let body:.DefaultApiCreateAliasBySubscriptionRequest = {
195
273
  },
196
274
  };
197
275
 
198
- apiInstance.createAliasBySubscription(body).then((data:any) => {
199
- console.log('API called successfully. Returned data: ' + data);
200
- }).catch((error:any) => console.error(error));
276
+ const response = await apiInstance.createAliasBySubscription(body);
277
+ console.log(response);
201
278
  ```
202
279
 
203
280
 
@@ -235,6 +312,70 @@ Name | Type | Description | Notes
235
312
 
236
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)
237
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
+
238
379
  # **createApp**
239
380
  > App createApp(app)
240
381
 
@@ -244,13 +385,14 @@ Creates a new OneSignal app
244
385
 
245
386
 
246
387
  ```typescript
247
- import { } from '';
248
- import * as fs from 'fs';
388
+ import Onesignal from '@onesignal/node-onesignal';
249
389
 
250
- const configuration = .createConfiguration();
251
- const apiInstance = new .DefaultApi(configuration);
390
+ const configuration = Onesignal.createConfiguration({
391
+ organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
392
+ });
393
+ const apiInstance = new Onesignal.DefaultApi(configuration);
252
394
 
253
- let body:.DefaultApiCreateAppRequest = {
395
+ let body: Onesignal.DefaultApiCreateAppRequest = {
254
396
  // App
255
397
  app: {
256
398
  name: "name_example",
@@ -277,9 +419,8 @@ let body:.DefaultApiCreateAppRequest = {
277
419
  },
278
420
  };
279
421
 
280
- apiInstance.createApp(body).then((data:any) => {
281
- console.log('API called successfully. Returned data: ' + data);
282
- }).catch((error:any) => console.error(error));
422
+ const response = await apiInstance.createApp(body);
423
+ console.log(response);
283
424
  ```
284
425
 
285
426
 
@@ -313,6 +454,76 @@ Name | Type | Description | Notes
313
454
 
314
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)
315
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
+
316
527
  # **createNotification**
317
528
  > CreateNotificationSuccessResponse createNotification(notification)
318
529
 
@@ -322,20 +533,20 @@ Sends notifications to your users
322
533
 
323
534
 
324
535
  ```typescript
325
- import { } from '';
326
- import * as fs from 'fs';
536
+ import Onesignal from '@onesignal/node-onesignal';
327
537
 
328
- const configuration = .createConfiguration();
329
- const apiInstance = new .DefaultApi(configuration);
538
+ const configuration = Onesignal.createConfiguration({
539
+ restApiKey: '<YOUR_REST_API_KEY>',
540
+ });
541
+ const apiInstance = new Onesignal.DefaultApi(configuration);
330
542
 
331
- let body:.DefaultApiCreateNotificationRequest = {
543
+ let body: Onesignal.DefaultApiCreateNotificationRequest = {
332
544
  // Notification
333
545
  notification: null,
334
546
  };
335
547
 
336
- apiInstance.createNotification(body).then((data:any) => {
337
- console.log('API called successfully. Returned data: ' + data);
338
- }).catch((error:any) => console.error(error));
548
+ const response = await apiInstance.createNotification(body);
549
+ console.log(response);
339
550
  ```
340
551
 
341
552
 
@@ -378,13 +589,14 @@ Create a segment visible and usable in the dashboard and API - Required: OneSign
378
589
 
379
590
 
380
591
  ```typescript
381
- import { } from '';
382
- import * as fs from 'fs';
592
+ import Onesignal from '@onesignal/node-onesignal';
383
593
 
384
- const configuration = .createConfiguration();
385
- const apiInstance = new .DefaultApi(configuration);
594
+ const configuration = Onesignal.createConfiguration({
595
+ restApiKey: '<YOUR_REST_API_KEY>',
596
+ });
597
+ const apiInstance = new Onesignal.DefaultApi(configuration);
386
598
 
387
- let body:.DefaultApiCreateSegmentRequest = {
599
+ let body: Onesignal.DefaultApiCreateSegmentRequest = {
388
600
  // string | The OneSignal App ID for your app. Available in Keys & IDs.
389
601
  appId: "app_id_example",
390
602
  // Segment (optional)
@@ -397,9 +609,8 @@ let body:.DefaultApiCreateSegmentRequest = {
397
609
  },
398
610
  };
399
611
 
400
- apiInstance.createSegment(body).then((data:any) => {
401
- console.log('API called successfully. Returned data: ' + data);
402
- }).catch((error:any) => console.error(error));
612
+ const response = await apiInstance.createSegment(body);
613
+ console.log(response);
403
614
  ```
404
615
 
405
616
 
@@ -444,13 +655,14 @@ Creates a new Subscription under the User provided. Useful to add email addresse
444
655
 
445
656
 
446
657
  ```typescript
447
- import { } from '';
448
- import * as fs from 'fs';
658
+ import Onesignal from '@onesignal/node-onesignal';
449
659
 
450
- const configuration = .createConfiguration();
451
- const apiInstance = new .DefaultApi(configuration);
660
+ const configuration = Onesignal.createConfiguration({
661
+ restApiKey: '<YOUR_REST_API_KEY>',
662
+ });
663
+ const apiInstance = new Onesignal.DefaultApi(configuration);
452
664
 
453
- let body:.DefaultApiCreateSubscriptionRequest = {
665
+ let body: Onesignal.DefaultApiCreateSubscriptionRequest = {
454
666
  // string
455
667
  appId: "app_id_example",
456
668
  // string
@@ -481,9 +693,8 @@ let body:.DefaultApiCreateSubscriptionRequest = {
481
693
  },
482
694
  };
483
695
 
484
- apiInstance.createSubscription(body).then((data:any) => {
485
- console.log('API called successfully. Returned data: ' + data);
486
- }).catch((error:any) => console.error(error));
696
+ const response = await apiInstance.createSubscription(body);
697
+ console.log(response);
487
698
  ```
488
699
 
489
700
 
@@ -523,6 +734,115 @@ Name | Type | Description | Notes
523
734
 
524
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)
525
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
+
526
846
  # **createUser**
527
847
  > User createUser(user)
528
848
 
@@ -532,13 +852,14 @@ Creates a User, optionally Subscriptions owned by the User as well as Aliases. A
532
852
 
533
853
 
534
854
  ```typescript
535
- import { } from '';
536
- import * as fs from 'fs';
855
+ import Onesignal from '@onesignal/node-onesignal';
537
856
 
538
- const configuration = .createConfiguration();
539
- const apiInstance = new .DefaultApi(configuration);
857
+ const configuration = Onesignal.createConfiguration({
858
+ restApiKey: '<YOUR_REST_API_KEY>',
859
+ });
860
+ const apiInstance = new Onesignal.DefaultApi(configuration);
540
861
 
541
- let body:.DefaultApiCreateUserRequest = {
862
+ let body: Onesignal.DefaultApiCreateUserRequest = {
542
863
  // string
543
864
  appId: "app_id_example",
544
865
  // User
@@ -590,9 +911,8 @@ let body:.DefaultApiCreateUserRequest = {
590
911
  },
591
912
  };
592
913
 
593
- apiInstance.createUser(body).then((data:any) => {
594
- console.log('API called successfully. Returned data: ' + data);
595
- }).catch((error:any) => console.error(error));
914
+ const response = await apiInstance.createUser(body);
915
+ console.log(response);
596
916
  ```
597
917
 
598
918
 
@@ -639,13 +959,14 @@ Deletes an alias by alias label
639
959
 
640
960
 
641
961
  ```typescript
642
- import { } from '';
643
- import * as fs from 'fs';
962
+ import Onesignal from '@onesignal/node-onesignal';
644
963
 
645
- const configuration = .createConfiguration();
646
- const apiInstance = new .DefaultApi(configuration);
964
+ const configuration = Onesignal.createConfiguration({
965
+ restApiKey: '<YOUR_REST_API_KEY>',
966
+ });
967
+ const apiInstance = new Onesignal.DefaultApi(configuration);
647
968
 
648
- let body:.DefaultApiDeleteAliasRequest = {
969
+ let body: Onesignal.DefaultApiDeleteAliasRequest = {
649
970
  // string
650
971
  appId: "app_id_example",
651
972
  // string
@@ -656,9 +977,8 @@ let body:.DefaultApiDeleteAliasRequest = {
656
977
  aliasLabelToDelete: "alias_label_to_delete_example",
657
978
  };
658
979
 
659
- apiInstance.deleteAlias(body).then((data:any) => {
660
- console.log('API called successfully. Returned data: ' + data);
661
- }).catch((error:any) => console.error(error));
980
+ const response = await apiInstance.deleteAlias(body);
981
+ console.log(response);
662
982
  ```
663
983
 
664
984
 
@@ -697,31 +1017,31 @@ Name | Type | Description | Notes
697
1017
 
698
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)
699
1019
 
700
- # **deleteSegment**
701
- > GenericSuccessBoolResponse deleteSegment()
1020
+ # **deleteApiKey**
1021
+ > object deleteApiKey()
702
1022
 
703
- Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
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.
704
1024
 
705
1025
  ### Example
706
1026
 
707
1027
 
708
1028
  ```typescript
709
- import { } from '';
710
- import * as fs from 'fs';
1029
+ import Onesignal from '@onesignal/node-onesignal';
711
1030
 
712
- const configuration = .createConfiguration();
713
- const apiInstance = new .DefaultApi(configuration);
1031
+ const configuration = Onesignal.createConfiguration({
1032
+ organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
1033
+ });
1034
+ const apiInstance = new Onesignal.DefaultApi(configuration);
714
1035
 
715
- let body:.DefaultApiDeleteSegmentRequest = {
716
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1036
+ let body: Onesignal.DefaultApiDeleteApiKeyRequest = {
1037
+ // string
717
1038
  appId: "app_id_example",
718
- // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
719
- segmentId: "segment_id_example",
1039
+ // string
1040
+ tokenId: "token_id_example",
720
1041
  };
721
1042
 
722
- apiInstance.deleteSegment(body).then((data:any) => {
723
- console.log('API called successfully. Returned data: ' + data);
724
- }).catch((error:any) => console.error(error));
1043
+ const response = await apiInstance.deleteApiKey(body);
1044
+ console.log(response);
725
1045
  ```
726
1046
 
727
1047
 
@@ -729,17 +1049,17 @@ apiInstance.deleteSegment(body).then((data:any) => {
729
1049
 
730
1050
  Name | Type | Description | Notes
731
1051
  ------------- | ------------- | ------------- | -------------
732
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
733
- **segmentId** | [**string**] | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | defaults to undefined
1052
+ **appId** | [**string**] | | defaults to undefined
1053
+ **tokenId** | [**string**] | | defaults to undefined
734
1054
 
735
1055
 
736
1056
  ### Return type
737
1057
 
738
- **GenericSuccessBoolResponse**
1058
+ **object**
739
1059
 
740
1060
  ### Authorization
741
1061
 
742
- [rest_api_key](README.md#rest_api_key)
1062
+ [organization_api_key](README.md#organization_api_key)
743
1063
 
744
1064
  ### HTTP request headers
745
1065
 
@@ -752,36 +1072,34 @@ Name | Type | Description | Notes
752
1072
  |-------------|-------------|------------------|
753
1073
  **200** | OK | - |
754
1074
  **400** | Bad Request | - |
755
- **404** | Not Found | - |
756
- **429** | Rate Limit Exceeded | - |
757
1075
 
758
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)
759
1077
 
760
- # **deleteSubscription**
761
- > void deleteSubscription()
1078
+ # **deleteSegment**
1079
+ > GenericSuccessBoolResponse deleteSegment()
762
1080
 
763
- Deletes the Subscription.
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.
764
1082
 
765
1083
  ### Example
766
1084
 
767
1085
 
768
1086
  ```typescript
769
- import { } from '';
770
- import * as fs from 'fs';
1087
+ import Onesignal from '@onesignal/node-onesignal';
771
1088
 
772
- const configuration = .createConfiguration();
773
- const apiInstance = new .DefaultApi(configuration);
1089
+ const configuration = Onesignal.createConfiguration({
1090
+ restApiKey: '<YOUR_REST_API_KEY>',
1091
+ });
1092
+ const apiInstance = new Onesignal.DefaultApi(configuration);
774
1093
 
775
- let body:.DefaultApiDeleteSubscriptionRequest = {
776
- // string
1094
+ let body: Onesignal.DefaultApiDeleteSegmentRequest = {
1095
+ // string | The OneSignal App ID for your app. Available in Keys & IDs.
777
1096
  appId: "app_id_example",
778
- // string
779
- subscriptionId: "subscription_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",
780
1099
  };
781
1100
 
782
- apiInstance.deleteSubscription(body).then((data:any) => {
783
- console.log('API called successfully. Returned data: ' + data);
784
- }).catch((error:any) => console.error(error));
1101
+ const response = await apiInstance.deleteSegment(body);
1102
+ console.log(response);
785
1103
  ```
786
1104
 
787
1105
 
@@ -789,9 +1107,69 @@ apiInstance.deleteSubscription(body).then((data:any) => {
789
1107
 
790
1108
  Name | Type | Description | Notes
791
1109
  ------------- | ------------- | ------------- | -------------
792
- **appId** | [**string**] | | defaults to undefined
793
- **subscriptionId** | [**string**] | | defaults to undefined
794
-
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
+
795
1173
 
796
1174
  ### Return type
797
1175
 
@@ -818,6 +1196,65 @@ Name | Type | Description | Notes
818
1196
 
819
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)
820
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
+
821
1258
  # **deleteUser**
822
1259
  > void deleteUser()
823
1260
 
@@ -827,13 +1264,14 @@ Removes the User identified by (:alias_label, :alias_id), and all Subscriptions
827
1264
 
828
1265
 
829
1266
  ```typescript
830
- import { } from '';
831
- import * as fs from 'fs';
1267
+ import Onesignal from '@onesignal/node-onesignal';
832
1268
 
833
- const configuration = .createConfiguration();
834
- const apiInstance = new .DefaultApi(configuration);
1269
+ const configuration = Onesignal.createConfiguration({
1270
+ restApiKey: '<YOUR_REST_API_KEY>',
1271
+ });
1272
+ const apiInstance = new Onesignal.DefaultApi(configuration);
835
1273
 
836
- let body:.DefaultApiDeleteUserRequest = {
1274
+ let body: Onesignal.DefaultApiDeleteUserRequest = {
837
1275
  // string
838
1276
  appId: "app_id_example",
839
1277
  // string
@@ -842,9 +1280,8 @@ let body:.DefaultApiDeleteUserRequest = {
842
1280
  aliasId: "alias_id_example",
843
1281
  };
844
1282
 
845
- apiInstance.deleteUser(body).then((data:any) => {
846
- console.log('API called successfully. Returned data: ' + data);
847
- }).catch((error:any) => console.error(error));
1283
+ const response = await apiInstance.deleteUser(body);
1284
+ console.log(response);
848
1285
  ```
849
1286
 
850
1287
 
@@ -890,22 +1327,22 @@ Generate a compressed CSV report of all of the events data for a notification. T
890
1327
 
891
1328
 
892
1329
  ```typescript
893
- import { } from '';
894
- import * as fs from 'fs';
1330
+ import Onesignal from '@onesignal/node-onesignal';
895
1331
 
896
- const configuration = .createConfiguration();
897
- const apiInstance = new .DefaultApi(configuration);
1332
+ const configuration = Onesignal.createConfiguration({
1333
+ restApiKey: '<YOUR_REST_API_KEY>',
1334
+ });
1335
+ const apiInstance = new Onesignal.DefaultApi(configuration);
898
1336
 
899
- let body:.DefaultApiExportEventsRequest = {
1337
+ let body: Onesignal.DefaultApiExportEventsRequest = {
900
1338
  // string | The ID of the notification to export events from.
901
1339
  notificationId: "notification_id_example",
902
1340
  // string | The ID of the app that the notification belongs to.
903
1341
  appId: "app_id_example",
904
1342
  };
905
1343
 
906
- apiInstance.exportEvents(body).then((data:any) => {
907
- console.log('API called successfully. Returned data: ' + data);
908
- }).catch((error:any) => console.error(error));
1344
+ const response = await apiInstance.exportEvents(body);
1345
+ console.log(response);
909
1346
  ```
910
1347
 
911
1348
 
@@ -950,13 +1387,14 @@ Generate a compressed CSV export of all of your current user data This method ca
950
1387
 
951
1388
 
952
1389
  ```typescript
953
- import { } from '';
954
- import * as fs from 'fs';
1390
+ import Onesignal from '@onesignal/node-onesignal';
955
1391
 
956
- const configuration = .createConfiguration();
957
- const apiInstance = new .DefaultApi(configuration);
1392
+ const configuration = Onesignal.createConfiguration({
1393
+ restApiKey: '<YOUR_REST_API_KEY>',
1394
+ });
1395
+ const apiInstance = new Onesignal.DefaultApi(configuration);
958
1396
 
959
- let body:.DefaultApiExportSubscriptionsRequest = {
1397
+ let body: Onesignal.DefaultApiExportSubscriptionsRequest = {
960
1398
  // string | The app ID that you want to export devices from
961
1399
  appId: "app_id_example",
962
1400
  // ExportSubscriptionsRequestBody (optional)
@@ -969,9 +1407,8 @@ let body:.DefaultApiExportSubscriptionsRequest = {
969
1407
  },
970
1408
  };
971
1409
 
972
- apiInstance.exportSubscriptions(body).then((data:any) => {
973
- console.log('API called successfully. Returned data: ' + data);
974
- }).catch((error:any) => console.error(error));
1410
+ const response = await apiInstance.exportSubscriptions(body);
1411
+ console.log(response);
975
1412
  ```
976
1413
 
977
1414
 
@@ -1015,13 +1452,14 @@ Lists all Aliases for the User identified by (:alias_label, :alias_id).
1015
1452
 
1016
1453
 
1017
1454
  ```typescript
1018
- import { } from '';
1019
- import * as fs from 'fs';
1455
+ import Onesignal from '@onesignal/node-onesignal';
1020
1456
 
1021
- const configuration = .createConfiguration();
1022
- const apiInstance = new .DefaultApi(configuration);
1457
+ const configuration = Onesignal.createConfiguration({
1458
+ restApiKey: '<YOUR_REST_API_KEY>',
1459
+ });
1460
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1023
1461
 
1024
- let body:.DefaultApiGetAliasesRequest = {
1462
+ let body: Onesignal.DefaultApiGetAliasesRequest = {
1025
1463
  // string
1026
1464
  appId: "app_id_example",
1027
1465
  // string
@@ -1030,9 +1468,8 @@ let body:.DefaultApiGetAliasesRequest = {
1030
1468
  aliasId: "alias_id_example",
1031
1469
  };
1032
1470
 
1033
- apiInstance.getAliases(body).then((data:any) => {
1034
- console.log('API called successfully. Returned data: ' + data);
1035
- }).catch((error:any) => console.error(error));
1471
+ const response = await apiInstance.getAliases(body);
1472
+ console.log(response);
1036
1473
  ```
1037
1474
 
1038
1475
 
@@ -1078,22 +1515,22 @@ Lists all Aliases for the User identified by :subscription_id.
1078
1515
 
1079
1516
 
1080
1517
  ```typescript
1081
- import { } from '';
1082
- import * as fs from 'fs';
1518
+ import Onesignal from '@onesignal/node-onesignal';
1083
1519
 
1084
- const configuration = .createConfiguration();
1085
- const apiInstance = new .DefaultApi(configuration);
1520
+ const configuration = Onesignal.createConfiguration({
1521
+ restApiKey: '<YOUR_REST_API_KEY>',
1522
+ });
1523
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1086
1524
 
1087
- let body:.DefaultApiGetAliasesBySubscriptionRequest = {
1525
+ let body: Onesignal.DefaultApiGetAliasesBySubscriptionRequest = {
1088
1526
  // string
1089
1527
  appId: "app_id_example",
1090
1528
  // string
1091
1529
  subscriptionId: "subscription_id_example",
1092
1530
  };
1093
1531
 
1094
- apiInstance.getAliasesBySubscription(body).then((data:any) => {
1095
- console.log('API called successfully. Returned data: ' + data);
1096
- }).catch((error:any) => console.error(error));
1532
+ const response = await apiInstance.getAliasesBySubscription(body);
1533
+ console.log(response);
1097
1534
  ```
1098
1535
 
1099
1536
 
@@ -1137,20 +1574,20 @@ View the details of a single OneSignal app
1137
1574
 
1138
1575
 
1139
1576
  ```typescript
1140
- import { } from '';
1141
- import * as fs from 'fs';
1577
+ import Onesignal from '@onesignal/node-onesignal';
1142
1578
 
1143
- const configuration = .createConfiguration();
1144
- const apiInstance = new .DefaultApi(configuration);
1579
+ const configuration = Onesignal.createConfiguration({
1580
+ organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
1581
+ });
1582
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1145
1583
 
1146
- let body:.DefaultApiGetAppRequest = {
1584
+ let body: Onesignal.DefaultApiGetAppRequest = {
1147
1585
  // string | An app id
1148
1586
  appId: "app_id_example",
1149
1587
  };
1150
1588
 
1151
- apiInstance.getApp(body).then((data:any) => {
1152
- console.log('API called successfully. Returned data: ' + data);
1153
- }).catch((error:any) => console.error(error));
1589
+ const response = await apiInstance.getApp(body);
1590
+ console.log(response);
1154
1591
  ```
1155
1592
 
1156
1593
 
@@ -1193,17 +1630,15 @@ View the details of all of your current OneSignal apps
1193
1630
 
1194
1631
 
1195
1632
  ```typescript
1196
- import { } from '';
1197
- import * as fs from 'fs';
1198
-
1199
- const configuration = .createConfiguration();
1200
- const apiInstance = new .DefaultApi(configuration);
1633
+ import Onesignal from '@onesignal/node-onesignal';
1201
1634
 
1202
- let body:any = {};
1635
+ const configuration = Onesignal.createConfiguration({
1636
+ organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
1637
+ });
1638
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1203
1639
 
1204
- apiInstance.getApps(body).then((data:any) => {
1205
- console.log('API called successfully. Returned data: ' + data);
1206
- }).catch((error:any) => console.error(error));
1640
+ const response = await apiInstance.getApps();
1641
+ console.log(response);
1207
1642
  ```
1208
1643
 
1209
1644
 
@@ -1243,22 +1678,22 @@ View the details of a single notification and outcomes associated with it
1243
1678
 
1244
1679
 
1245
1680
  ```typescript
1246
- import { } from '';
1247
- import * as fs from 'fs';
1681
+ import Onesignal from '@onesignal/node-onesignal';
1248
1682
 
1249
- const configuration = .createConfiguration();
1250
- const apiInstance = new .DefaultApi(configuration);
1683
+ const configuration = Onesignal.createConfiguration({
1684
+ restApiKey: '<YOUR_REST_API_KEY>',
1685
+ });
1686
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1251
1687
 
1252
- let body:.DefaultApiGetNotificationRequest = {
1688
+ let body: Onesignal.DefaultApiGetNotificationRequest = {
1253
1689
  // string
1254
1690
  appId: "app_id_example",
1255
1691
  // string
1256
1692
  notificationId: "notification_id_example",
1257
1693
  };
1258
1694
 
1259
- apiInstance.getNotification(body).then((data:any) => {
1260
- console.log('API called successfully. Returned data: ' + data);
1261
- }).catch((error:any) => console.error(error));
1695
+ const response = await apiInstance.getNotification(body);
1696
+ console.log(response);
1262
1697
  ```
1263
1698
 
1264
1699
 
@@ -1303,13 +1738,14 @@ Name | Type | Description | Notes
1303
1738
 
1304
1739
 
1305
1740
  ```typescript
1306
- import { } from '';
1307
- import * as fs from 'fs';
1741
+ import Onesignal from '@onesignal/node-onesignal';
1308
1742
 
1309
- const configuration = .createConfiguration();
1310
- const apiInstance = new .DefaultApi(configuration);
1743
+ const configuration = Onesignal.createConfiguration({
1744
+ restApiKey: '<YOUR_REST_API_KEY>',
1745
+ });
1746
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1311
1747
 
1312
- let body:.DefaultApiGetNotificationHistoryRequest = {
1748
+ let body: Onesignal.DefaultApiGetNotificationHistoryRequest = {
1313
1749
  // string | The \"id\" of the message found in the Notification object
1314
1750
  notificationId: "notification_id_example",
1315
1751
  // GetNotificationHistoryRequestBody
@@ -1320,9 +1756,8 @@ let body:.DefaultApiGetNotificationHistoryRequest = {
1320
1756
  },
1321
1757
  };
1322
1758
 
1323
- apiInstance.getNotificationHistory(body).then((data:any) => {
1324
- console.log('API called successfully. Returned data: ' + data);
1325
- }).catch((error:any) => console.error(error));
1759
+ const response = await apiInstance.getNotificationHistory(body);
1760
+ console.log(response);
1326
1761
  ```
1327
1762
 
1328
1763
 
@@ -1367,13 +1802,14 @@ View the details of multiple notifications
1367
1802
 
1368
1803
 
1369
1804
  ```typescript
1370
- import { } from '';
1371
- import * as fs from 'fs';
1805
+ import Onesignal from '@onesignal/node-onesignal';
1372
1806
 
1373
- const configuration = .createConfiguration();
1374
- const apiInstance = new .DefaultApi(configuration);
1807
+ const configuration = Onesignal.createConfiguration({
1808
+ restApiKey: '<YOUR_REST_API_KEY>',
1809
+ });
1810
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1375
1811
 
1376
- let body:.DefaultApiGetNotificationsRequest = {
1812
+ let body: Onesignal.DefaultApiGetNotificationsRequest = {
1377
1813
  // string | The app ID that you want to view notifications from
1378
1814
  appId: "app_id_example",
1379
1815
  // number | How many notifications to return. Max is 50. Default is 50. (optional)
@@ -1384,9 +1820,8 @@ let body:.DefaultApiGetNotificationsRequest = {
1384
1820
  kind: 0,
1385
1821
  };
1386
1822
 
1387
- apiInstance.getNotifications(body).then((data:any) => {
1388
- console.log('API called successfully. Returned data: ' + data);
1389
- }).catch((error:any) => console.error(error));
1823
+ const response = await apiInstance.getNotifications(body);
1824
+ console.log(response);
1390
1825
  ```
1391
1826
 
1392
1827
 
@@ -1432,13 +1867,14 @@ View the details of all the outcomes associated with your app &#x1F6A7; Require
1432
1867
 
1433
1868
 
1434
1869
  ```typescript
1435
- import { } from '';
1436
- import * as fs from 'fs';
1870
+ import Onesignal from '@onesignal/node-onesignal';
1437
1871
 
1438
- const configuration = .createConfiguration();
1439
- const apiInstance = new .DefaultApi(configuration);
1872
+ const configuration = Onesignal.createConfiguration({
1873
+ restApiKey: '<YOUR_REST_API_KEY>',
1874
+ });
1875
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1440
1876
 
1441
- let body:.DefaultApiGetOutcomesRequest = {
1877
+ let body: Onesignal.DefaultApiGetOutcomesRequest = {
1442
1878
  // string | The OneSignal App ID for your app. Available in Keys & IDs.
1443
1879
  appId: "app_id_example",
1444
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
@@ -1453,9 +1889,8 @@ let body:.DefaultApiGetOutcomesRequest = {
1453
1889
  outcomeAttribution: "outcome_attribution_example",
1454
1890
  };
1455
1891
 
1456
- apiInstance.getOutcomes(body).then((data:any) => {
1457
- console.log('API called successfully. Returned data: ' + data);
1458
- }).catch((error:any) => console.error(error));
1892
+ const response = await apiInstance.getOutcomes(body);
1893
+ console.log(response);
1459
1894
  ```
1460
1895
 
1461
1896
 
@@ -1503,13 +1938,14 @@ Returns an array of segments from an app.
1503
1938
 
1504
1939
 
1505
1940
  ```typescript
1506
- import { } from '';
1507
- import * as fs from 'fs';
1941
+ import Onesignal from '@onesignal/node-onesignal';
1508
1942
 
1509
- const configuration = .createConfiguration();
1510
- const apiInstance = new .DefaultApi(configuration);
1943
+ const configuration = Onesignal.createConfiguration({
1944
+ restApiKey: '<YOUR_REST_API_KEY>',
1945
+ });
1946
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1511
1947
 
1512
- let body:.DefaultApiGetSegmentsRequest = {
1948
+ let body: Onesignal.DefaultApiGetSegmentsRequest = {
1513
1949
  // string | The OneSignal App ID for your app. Available in Keys & IDs.
1514
1950
  appId: "app_id_example",
1515
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)
@@ -1518,9 +1954,8 @@ let body:.DefaultApiGetSegmentsRequest = {
1518
1954
  limit: 1,
1519
1955
  };
1520
1956
 
1521
- apiInstance.getSegments(body).then((data:any) => {
1522
- console.log('API called successfully. Returned data: ' + data);
1523
- }).catch((error:any) => console.error(error));
1957
+ const response = await apiInstance.getSegments(body);
1958
+ console.log(response);
1524
1959
  ```
1525
1960
 
1526
1961
 
@@ -1565,13 +2000,14 @@ Returns the User’s properties, Aliases, and Subscriptions.
1565
2000
 
1566
2001
 
1567
2002
  ```typescript
1568
- import { } from '';
1569
- import * as fs from 'fs';
2003
+ import Onesignal from '@onesignal/node-onesignal';
1570
2004
 
1571
- const configuration = .createConfiguration();
1572
- const apiInstance = new .DefaultApi(configuration);
2005
+ const configuration = Onesignal.createConfiguration({
2006
+ restApiKey: '<YOUR_REST_API_KEY>',
2007
+ });
2008
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1573
2009
 
1574
- let body:.DefaultApiGetUserRequest = {
2010
+ let body: Onesignal.DefaultApiGetUserRequest = {
1575
2011
  // string
1576
2012
  appId: "app_id_example",
1577
2013
  // string
@@ -1580,9 +2016,8 @@ let body:.DefaultApiGetUserRequest = {
1580
2016
  aliasId: "alias_id_example",
1581
2017
  };
1582
2018
 
1583
- apiInstance.getUser(body).then((data:any) => {
1584
- console.log('API called successfully. Returned data: ' + data);
1585
- }).catch((error:any) => console.error(error));
2019
+ const response = await apiInstance.getUser(body);
2020
+ console.log(response);
1586
2021
  ```
1587
2022
 
1588
2023
 
@@ -1619,37 +2054,31 @@ Name | Type | Description | Notes
1619
2054
 
1620
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)
1621
2056
 
1622
- # **transferSubscription**
1623
- > UserIdentityBody transferSubscription(transferSubscriptionRequestBody)
2057
+ # **rotateApiKey**
2058
+ > CreateApiKeyResponse rotateApiKey()
1624
2059
 
1625
- Transfers this Subscription to the User identified by the identity in the payload.
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.
1626
2061
 
1627
2062
  ### Example
1628
2063
 
1629
2064
 
1630
2065
  ```typescript
1631
- import { } from '';
1632
- import * as fs from 'fs';
2066
+ import Onesignal from '@onesignal/node-onesignal';
1633
2067
 
1634
- const configuration = .createConfiguration();
1635
- const apiInstance = new .DefaultApi(configuration);
2068
+ const configuration = Onesignal.createConfiguration({
2069
+ organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>',
2070
+ });
2071
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1636
2072
 
1637
- let body:.DefaultApiTransferSubscriptionRequest = {
2073
+ let body: Onesignal.DefaultApiRotateApiKeyRequest = {
1638
2074
  // string
1639
2075
  appId: "app_id_example",
1640
2076
  // string
1641
- subscriptionId: "subscription_id_example",
1642
- // TransferSubscriptionRequestBody
1643
- transferSubscriptionRequestBody: {
1644
- identity: {
1645
- "key": "key_example",
1646
- },
1647
- },
2077
+ tokenId: "token_id_example",
1648
2078
  };
1649
2079
 
1650
- apiInstance.transferSubscription(body).then((data:any) => {
1651
- console.log('API called successfully. Returned data: ' + data);
1652
- }).catch((error:any) => console.error(error));
2080
+ const response = await apiInstance.rotateApiKey(body);
2081
+ console.log(response);
1653
2082
  ```
1654
2083
 
1655
2084
 
@@ -1657,159 +2086,13 @@ apiInstance.transferSubscription(body).then((data:any) => {
1657
2086
 
1658
2087
  Name | Type | Description | Notes
1659
2088
  ------------- | ------------- | ------------- | -------------
1660
- **transferSubscriptionRequestBody** | **TransferSubscriptionRequestBody**| |
1661
2089
  **appId** | [**string**] | | defaults to undefined
1662
- **subscriptionId** | [**string**] | | defaults to undefined
1663
-
1664
-
1665
- ### Return type
1666
-
1667
- **UserIdentityBody**
1668
-
1669
- ### Authorization
1670
-
1671
- [rest_api_key](README.md#rest_api_key)
1672
-
1673
- ### HTTP request headers
1674
-
1675
- - **Content-Type**: application/json
1676
- - **Accept**: application/json
1677
-
1678
-
1679
- ### HTTP response details
1680
- | Status code | Description | Response headers |
1681
- |-------------|-------------|------------------|
1682
- **200** | OK | - |
1683
- **400** | Bad Request | - |
1684
- **404** | Not Found | - |
1685
- **409** | Conflict | - |
1686
- **429** | Rate Limit Exceeded | - |
1687
-
1688
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1689
-
1690
- # **unsubscribeEmailWithToken**
1691
- > GenericSuccessBoolResponse unsubscribeEmailWithToken()
1692
-
1693
- Unsubscribe an email with a token when using your own custom email unsubscribe landing page
1694
-
1695
- ### Example
1696
-
1697
-
1698
- ```typescript
1699
- import { } from '';
1700
- import * as fs from 'fs';
1701
-
1702
- const configuration = .createConfiguration();
1703
- const apiInstance = new .DefaultApi(configuration);
1704
-
1705
- let body:.DefaultApiUnsubscribeEmailWithTokenRequest = {
1706
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
1707
- appId: "app_id_example",
1708
- // string | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
1709
- notificationId: "notification_id_example",
1710
- // string | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
1711
- token: "token_example",
1712
- };
1713
-
1714
- apiInstance.unsubscribeEmailWithToken(body).then((data:any) => {
1715
- console.log('API called successfully. Returned data: ' + data);
1716
- }).catch((error:any) => console.error(error));
1717
- ```
1718
-
1719
-
1720
- ### Parameters
1721
-
1722
- Name | Type | Description | Notes
1723
- ------------- | ------------- | ------------- | -------------
1724
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1725
- **notificationId** | [**string**] | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | defaults to undefined
1726
- **token** | [**string**] | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | defaults to undefined
1727
-
1728
-
1729
- ### Return type
1730
-
1731
- **GenericSuccessBoolResponse**
1732
-
1733
- ### Authorization
1734
-
1735
- [rest_api_key](README.md#rest_api_key)
1736
-
1737
- ### HTTP request headers
1738
-
1739
- - **Content-Type**: Not defined
1740
- - **Accept**: application/json
1741
-
1742
-
1743
- ### HTTP response details
1744
- | Status code | Description | Response headers |
1745
- |-------------|-------------|------------------|
1746
- **202** | OK | - |
1747
- **400** | Bad Request | - |
1748
- **429** | Rate Limit Exceeded | - |
1749
-
1750
- [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
1751
-
1752
- # **updateApp**
1753
- > App updateApp(app)
1754
-
1755
- Updates the name or configuration settings of an existing OneSignal app
1756
-
1757
- ### Example
1758
-
1759
-
1760
- ```typescript
1761
- import { } from '';
1762
- import * as fs from 'fs';
1763
-
1764
- const configuration = .createConfiguration();
1765
- const apiInstance = new .DefaultApi(configuration);
1766
-
1767
- let body:.DefaultApiUpdateAppRequest = {
1768
- // string | An app id
1769
- appId: "app_id_example",
1770
- // App
1771
- app: {
1772
- name: "name_example",
1773
- android_gcm_sender_id: "android_gcm_sender_id_example",
1774
- gcm_key: "gcm_key_example",
1775
- chrome_web_origin: "chrome_web_origin_example",
1776
- chrome_key: "chrome_key_example",
1777
- chrome_web_default_notification_icon: "chrome_web_default_notification_icon_example",
1778
- chrome_web_sub_domain: "chrome_web_sub_domain_example",
1779
- apns_env: "sandbox",
1780
- apns_p12: "apns_p12_example",
1781
- apns_p12_password: "apns_p12_password_example",
1782
- safari_apns_p12: "safari_apns_p12_example",
1783
- safari_apns_p12_password: "safari_apns_p12_password_example",
1784
- apns_key_id: "apns_key_id_example",
1785
- apns_team_id: "apns_team_id_example",
1786
- apns_bundle_id: "apns_bundle_id_example",
1787
- apns_p8: "apns_p8_example",
1788
- safari_site_origin: "safari_site_origin_example",
1789
- safari_icon_256_256: "safari_icon_256_256_example",
1790
- site_name: "site_name_example",
1791
- organization_id: "organization_id_example",
1792
- additional_data_is_root_payload: true,
1793
- },
1794
- };
1795
-
1796
- apiInstance.updateApp(body).then((data:any) => {
1797
- console.log('API called successfully. Returned data: ' + data);
1798
- }).catch((error:any) => console.error(error));
1799
- ```
1800
-
1801
-
1802
- ### Parameters
1803
-
1804
- Name | Type | Description | Notes
1805
- ------------- | ------------- | ------------- | -------------
1806
- **app** | **App**| |
1807
- **appId** | [**string**] | An app id | defaults to undefined
2090
+ **tokenId** | [**string**] | | defaults to undefined
1808
2091
 
1809
2092
 
1810
2093
  ### Return type
1811
2094
 
1812
- **App**
2095
+ **CreateApiKeyResponse**
1813
2096
 
1814
2097
  ### Authorization
1815
2098
 
@@ -1817,7 +2100,7 @@ Name | Type | Description | Notes
1817
2100
 
1818
2101
  ### HTTP request headers
1819
2102
 
1820
- - **Content-Type**: application/json
2103
+ - **Content-Type**: Not defined
1821
2104
  - **Accept**: application/json
1822
2105
 
1823
2106
 
@@ -1826,34 +2109,491 @@ Name | Type | Description | Notes
1826
2109
  |-------------|-------------|------------------|
1827
2110
  **200** | OK | - |
1828
2111
  **400** | Bad Request | - |
1829
- **429** | Rate Limit Exceeded | - |
1830
2112
 
1831
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)
1832
2114
 
1833
- # **updateLiveActivity**
1834
- > UpdateLiveActivitySuccessResponse updateLiveActivity(updateLiveActivityRequest)
2115
+ # **startLiveActivity**
2116
+ > StartLiveActivitySuccessResponse startLiveActivity(startLiveActivityRequest)
1835
2117
 
1836
- Updates a specified live activity.
2118
+ Remotely start a Live Activity on iOS devices via OneSignal’s REST API.
1837
2119
 
1838
2120
  ### Example
1839
2121
 
1840
2122
 
1841
2123
  ```typescript
1842
- import { } from '';
1843
- import * as fs from 'fs';
2124
+ import Onesignal from '@onesignal/node-onesignal';
1844
2125
 
1845
- const configuration = .createConfiguration();
1846
- const apiInstance = new .DefaultApi(configuration);
2126
+ const configuration = Onesignal.createConfiguration({
2127
+ restApiKey: '<YOUR_REST_API_KEY>',
2128
+ });
2129
+ const apiInstance = new Onesignal.DefaultApi(configuration);
1847
2130
 
1848
- let body:.DefaultApiUpdateLiveActivityRequest = {
1849
- // string | The OneSignal App ID for your app. Available in Keys & IDs.
2131
+ let body: Onesignal.DefaultApiStartLiveActivityRequest = {
2132
+ // string | Your OneSignal App ID in UUID v4 format.
1850
2133
  appId: "app_id_example",
1851
- // string | Live Activity record ID
1852
- activityId: "activity_id_example",
1853
- // UpdateLiveActivityRequest
1854
- updateLiveActivityRequest: {
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: {
1855
2138
  name: "name_example",
1856
- event: "update",
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",
1857
2597
  event_updates: {},
1858
2598
  contents: {
1859
2599
  en: "en_example",
@@ -1952,9 +2692,90 @@ let body:.DefaultApiUpdateLiveActivityRequest = {
1952
2692
  },
1953
2693
  };
1954
2694
 
1955
- apiInstance.updateLiveActivity(body).then((data:any) => {
1956
- console.log('API called successfully. Returned data: ' + data);
1957
- }).catch((error:any) => console.error(error));
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);
1958
2779
  ```
1959
2780
 
1960
2781
 
@@ -1962,14 +2783,14 @@ apiInstance.updateLiveActivity(body).then((data:any) => {
1962
2783
 
1963
2784
  Name | Type | Description | Notes
1964
2785
  ------------- | ------------- | ------------- | -------------
1965
- **updateLiveActivityRequest** | **UpdateLiveActivityRequest**| |
1966
- **appId** | [**string**] | The OneSignal App ID for your app. Available in Keys &amp; IDs. | defaults to undefined
1967
- **activityId** | [**string**] | Live Activity record ID | defaults to undefined
2786
+ **subscriptionBody** | **SubscriptionBody**| |
2787
+ **appId** | [**string**] | | defaults to undefined
2788
+ **subscriptionId** | [**string**] | | defaults to undefined
1968
2789
 
1969
2790
 
1970
2791
  ### Return type
1971
2792
 
1972
- **UpdateLiveActivitySuccessResponse**
2793
+ **void**
1973
2794
 
1974
2795
  ### Authorization
1975
2796
 
@@ -1986,30 +2807,35 @@ Name | Type | Description | Notes
1986
2807
  |-------------|-------------|------------------|
1987
2808
  **200** | OK | - |
1988
2809
  **400** | Bad Request | - |
2810
+ **404** | Not Found | - |
2811
+ **409** | Conflict | - |
1989
2812
  **429** | Rate Limit Exceeded | - |
1990
2813
 
1991
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)
1992
2815
 
1993
- # **updateSubscription**
1994
- > void updateSubscription(subscriptionBody)
2816
+ # **updateSubscriptionByToken**
2817
+ > object updateSubscriptionByToken(subscriptionBody)
1995
2818
 
1996
- Updates an existing Subscription’s properties.
2819
+ Update properties on an existing OneSignal subscription using its token.
1997
2820
 
1998
2821
  ### Example
1999
2822
 
2000
2823
 
2001
2824
  ```typescript
2002
- import { } from '';
2003
- import * as fs from 'fs';
2825
+ import Onesignal from '@onesignal/node-onesignal';
2004
2826
 
2005
- const configuration = .createConfiguration();
2006
- const apiInstance = new .DefaultApi(configuration);
2827
+ const configuration = Onesignal.createConfiguration({
2828
+ restApiKey: '<YOUR_REST_API_KEY>',
2829
+ });
2830
+ const apiInstance = new Onesignal.DefaultApi(configuration);
2007
2831
 
2008
- let body:.DefaultApiUpdateSubscriptionRequest = {
2009
- // string
2832
+ let body: Onesignal.DefaultApiUpdateSubscriptionByTokenRequest = {
2833
+ // string | Your OneSignal App ID in UUID v4 format.
2010
2834
  appId: "app_id_example",
2011
- // string
2012
- subscriptionId: "subscription_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",
2013
2839
  // SubscriptionBody
2014
2840
  subscriptionBody: {
2015
2841
  subscription: {
@@ -2034,9 +2860,8 @@ let body:.DefaultApiUpdateSubscriptionRequest = {
2034
2860
  },
2035
2861
  };
2036
2862
 
2037
- apiInstance.updateSubscription(body).then((data:any) => {
2038
- console.log('API called successfully. Returned data: ' + data);
2039
- }).catch((error:any) => console.error(error));
2863
+ const response = await apiInstance.updateSubscriptionByToken(body);
2864
+ console.log(response);
2040
2865
  ```
2041
2866
 
2042
2867
 
@@ -2045,13 +2870,128 @@ apiInstance.updateSubscription(body).then((data:any) => {
2045
2870
  Name | Type | Description | Notes
2046
2871
  ------------- | ------------- | ------------- | -------------
2047
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
2048
2989
  **appId** | [**string**] | | defaults to undefined
2049
- **subscriptionId** | [**string**] | | defaults to undefined
2050
2990
 
2051
2991
 
2052
2992
  ### Return type
2053
2993
 
2054
- **void**
2994
+ **TemplateResource**
2055
2995
 
2056
2996
  ### Authorization
2057
2997
 
@@ -2068,9 +3008,6 @@ Name | Type | Description | Notes
2068
3008
  |-------------|-------------|------------------|
2069
3009
  **200** | OK | - |
2070
3010
  **400** | Bad Request | - |
2071
- **404** | Not Found | - |
2072
- **409** | Conflict | - |
2073
- **429** | Rate Limit Exceeded | - |
2074
3011
 
2075
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)
2076
3013
 
@@ -2083,13 +3020,14 @@ Updates an existing User’s properties.
2083
3020
 
2084
3021
 
2085
3022
  ```typescript
2086
- import { } from '';
2087
- import * as fs from 'fs';
3023
+ import Onesignal from '@onesignal/node-onesignal';
2088
3024
 
2089
- const configuration = .createConfiguration();
2090
- const apiInstance = new .DefaultApi(configuration);
3025
+ const configuration = Onesignal.createConfiguration({
3026
+ restApiKey: '<YOUR_REST_API_KEY>',
3027
+ });
3028
+ const apiInstance = new Onesignal.DefaultApi(configuration);
2091
3029
 
2092
- let body:.DefaultApiUpdateUserRequest = {
3030
+ let body: Onesignal.DefaultApiUpdateUserRequest = {
2093
3031
  // string
2094
3032
  appId: "app_id_example",
2095
3033
  // string
@@ -2134,9 +3072,8 @@ let body:.DefaultApiUpdateUserRequest = {
2134
3072
  },
2135
3073
  };
2136
3074
 
2137
- apiInstance.updateUser(body).then((data:any) => {
2138
- console.log('API called successfully. Returned data: ' + data);
2139
- }).catch((error:any) => console.error(error));
3075
+ const response = await apiInstance.updateUser(body);
3076
+ console.log(response);
2140
3077
  ```
2141
3078
 
2142
3079
 
@@ -2174,4 +3111,183 @@ Name | Type | Description | Notes
2174
3111
 
2175
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)
2176
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
+
2177
3293