@onesignal/node-onesignal 1.0.0-beta7 → 1.0.0-beta8
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.
- package/.github/workflows/npm_deploy.yml +6 -7
- package/CHANGELOG.md +4 -0
- package/DefaultApi.md +215 -0
- package/README.md +41 -0
- package/apis/DefaultApi.ts +401 -29
- package/dist/apis/DefaultApi.d.ts +9 -0
- package/dist/apis/DefaultApi.js +496 -132
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/auth/auth.d.ts +6 -6
- package/dist/auth/auth.js +1 -1
- package/dist/http/http.d.ts +2 -2
- package/dist/http/http.js +1 -1
- package/dist/models/App.d.ts +5 -1
- package/dist/models/App.js +24 -0
- package/dist/models/App.js.map +1 -1
- package/dist/models/BadRequestError.d.ts +17 -0
- package/dist/models/BadRequestError.js +22 -0
- package/dist/models/BadRequestError.js.map +1 -0
- package/dist/models/BasicNotification.d.ts +1 -1
- package/dist/models/BasicNotificationAllOf.d.ts +1 -1
- package/dist/models/BeginLiveActivityRequest.d.ts +18 -0
- package/dist/models/BeginLiveActivityRequest.js +28 -0
- package/dist/models/BeginLiveActivityRequest.js.map +1 -0
- package/dist/models/Filter.d.ts +1 -1
- package/dist/models/FilterExpressions.d.ts +2 -2
- package/dist/models/GetNotificationRequestBody.d.ts +1 -1
- package/dist/models/Notification.d.ts +1 -1
- package/dist/models/NotificationWithMeta.d.ts +1 -1
- package/dist/models/ObjectSerializer.d.ts +4 -5
- package/dist/models/ObjectSerializer.js +14 -15
- package/dist/models/ObjectSerializer.js.map +1 -1
- package/dist/models/Operator.d.ts +1 -1
- package/dist/models/OutcomeData.d.ts +1 -1
- package/dist/models/UpdateLiveActivityRequest.d.ts +22 -0
- package/dist/models/UpdateLiveActivityRequest.js +40 -0
- package/dist/models/UpdateLiveActivityRequest.js.map +1 -0
- package/dist/models/UpdateLiveActivitySuccessResponse.d.ts +19 -0
- package/dist/models/UpdateLiveActivitySuccessResponse.js +28 -0
- package/dist/models/UpdateLiveActivitySuccessResponse.js.map +1 -0
- package/dist/models/all.d.ts +4 -5
- package/dist/models/all.js +4 -5
- package/dist/models/all.js.map +1 -1
- package/dist/types/ObjectParamAPI.d.ts +21 -0
- package/dist/types/ObjectParamAPI.js +9 -0
- package/dist/types/ObjectParamAPI.js.map +1 -1
- package/dist/types/ObservableAPI.d.ts +6 -0
- package/dist/types/ObservableAPI.js +128 -56
- package/dist/types/ObservableAPI.js.map +1 -1
- package/dist/types/PromiseAPI.d.ts +6 -0
- package/dist/types/PromiseAPI.js +12 -0
- package/dist/types/PromiseAPI.js.map +1 -1
- package/models/App.ts +41 -1
- package/models/BadRequestError.ts +31 -0
- package/models/BasicNotification.ts +1 -1
- package/models/BasicNotificationAllOf.ts +1 -1
- package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +1 -1
- package/models/BeginLiveActivityRequest.ts +38 -0
- package/models/Button.ts +1 -1
- package/models/CancelNotificationSuccessResponse.ts +1 -1
- package/models/CreateNotificationSuccessResponse.ts +1 -1
- package/models/CreatePlayerSuccessResponse.ts +1 -1
- package/models/CreateSegmentConflictResponse.ts +1 -1
- package/models/CreateSegmentSuccessResponse.ts +1 -1
- package/models/DeletePlayerNotFoundResponse.ts +1 -1
- package/models/DeletePlayerSuccessResponse.ts +1 -1
- package/models/DeleteSegmentNotFoundResponse.ts +1 -1
- package/models/DeleteSegmentSuccessResponse.ts +1 -1
- package/models/DeliveryData.ts +1 -1
- package/models/ExportPlayersRequestBody.ts +1 -1
- package/models/ExportPlayersSuccessResponse.ts +1 -1
- package/models/Filter.ts +1 -1
- package/models/FilterExpressions.ts +1 -1
- package/models/GetNotificationRequestBody.ts +1 -1
- package/models/InvalidIdentifierError.ts +1 -1
- package/models/Notification.ts +1 -1
- package/models/Notification200Errors.ts +1 -1
- package/models/NotificationAllOf.ts +1 -1
- package/models/NotificationHistorySuccessResponse.ts +1 -1
- package/models/NotificationSlice.ts +1 -1
- package/models/NotificationTarget.ts +1 -1
- package/models/NotificationWithMeta.ts +1 -1
- package/models/NotificationWithMetaAllOf.ts +1 -1
- package/models/ObjectSerializer.ts +15 -16
- package/models/Operator.ts +1 -1
- package/models/OutcomeData.ts +1 -1
- package/models/OutcomesData.ts +1 -1
- package/models/PlatformDeliveryData.ts +1 -1
- package/models/PlatformDeliveryDataEmailAllOf.ts +1 -1
- package/models/PlatformDeliveryDataSmsAllOf.ts +1 -1
- package/models/Player.ts +1 -1
- package/models/PlayerNotificationTarget.ts +1 -1
- package/models/PlayerSlice.ts +1 -1
- package/models/Purchase.ts +1 -1
- package/models/Segment.ts +1 -1
- package/models/SegmentNotificationTarget.ts +1 -1
- package/models/StringMap.ts +1 -1
- package/models/UpdateLiveActivityRequest.ts +62 -0
- package/models/UpdateLiveActivitySuccessResponse.ts +39 -0
- package/models/UpdatePlayerSuccessResponse.ts +1 -1
- package/models/UpdatePlayerTagsRequestBody.ts +1 -1
- package/models/UpdatePlayerTagsSuccessResponse.ts +1 -1
- package/models/all.ts +4 -5
- package/package.json +3 -3
- package/types/ObjectParamAPI.ts +94 -5
- package/types/ObservableAPI.ts +82 -5
- package/types/PromiseAPI.ts +40 -5
|
@@ -12,12 +12,11 @@ jobs:
|
|
|
12
12
|
- uses: actions/setup-node@v3
|
|
13
13
|
with:
|
|
14
14
|
node-version: 18
|
|
15
|
-
registry-url: 'https://registry.npmjs.org'
|
|
16
15
|
- name: Install Node types
|
|
17
16
|
run: npm install @types/node
|
|
18
|
-
- name:
|
|
19
|
-
run: npm
|
|
20
|
-
- name: Publish package
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
- name: Run build
|
|
18
|
+
run: npm run build
|
|
19
|
+
- name: Publish package
|
|
20
|
+
uses: JS-DevTools/npm-publish@v1
|
|
21
|
+
with:
|
|
22
|
+
token: ${{ secrets.NPM }}
|
package/CHANGELOG.md
CHANGED
package/DefaultApi.md
CHANGED
|
@@ -4,6 +4,7 @@ All URIs are relative to *https://onesignal.com/api/v1*
|
|
|
4
4
|
|
|
5
5
|
Method | HTTP request | Description
|
|
6
6
|
------------- | ------------- | -------------
|
|
7
|
+
[**beginLiveActivity**](DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity
|
|
7
8
|
[**cancelNotification**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
|
|
8
9
|
[**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app
|
|
9
10
|
[**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification
|
|
@@ -11,6 +12,7 @@ Method | HTTP request | Description
|
|
|
11
12
|
[**createSegments**](DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments
|
|
12
13
|
[**deletePlayer**](DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record
|
|
13
14
|
[**deleteSegments**](DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments
|
|
15
|
+
[**endLiveActivity**](DefaultApi.md#endLiveActivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity
|
|
14
16
|
[**exportPlayers**](DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | CSV export
|
|
15
17
|
[**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app
|
|
16
18
|
[**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps
|
|
@@ -21,10 +23,75 @@ Method | HTTP request | Description
|
|
|
21
23
|
[**getPlayer**](DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device
|
|
22
24
|
[**getPlayers**](DefaultApi.md#getPlayers) | **GET** /players | View devices
|
|
23
25
|
[**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app
|
|
26
|
+
[**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
|
|
24
27
|
[**updatePlayer**](DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device
|
|
25
28
|
[**updatePlayerTags**](DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id
|
|
26
29
|
|
|
27
30
|
|
|
31
|
+
# **beginLiveActivity**
|
|
32
|
+
> void beginLiveActivity(beginLiveActivityRequest)
|
|
33
|
+
|
|
34
|
+
Starts a Live Activity
|
|
35
|
+
|
|
36
|
+
### Example
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { } from '';
|
|
41
|
+
import * as fs from 'fs';
|
|
42
|
+
|
|
43
|
+
const configuration = .createConfiguration();
|
|
44
|
+
const apiInstance = new .DefaultApi(configuration);
|
|
45
|
+
|
|
46
|
+
let body:.DefaultApiBeginLiveActivityRequest = {
|
|
47
|
+
// string | The OneSignal App ID for your app. Available in Keys & IDs.
|
|
48
|
+
appId: "app_id_example",
|
|
49
|
+
// string | Live Activity record ID
|
|
50
|
+
activityId: "activity_id_example",
|
|
51
|
+
// BeginLiveActivityRequest
|
|
52
|
+
beginLiveActivityRequest: {
|
|
53
|
+
push_token: "push_token_example",
|
|
54
|
+
subscription_id: "subscription_id_example",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
apiInstance.beginLiveActivity(body).then((data:any) => {
|
|
59
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
60
|
+
}).catch((error:any) => console.error(error));
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Parameters
|
|
65
|
+
|
|
66
|
+
Name | Type | Description | Notes
|
|
67
|
+
------------- | ------------- | ------------- | -------------
|
|
68
|
+
**beginLiveActivityRequest** | **BeginLiveActivityRequest**| |
|
|
69
|
+
**appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined
|
|
70
|
+
**activityId** | [**string**] | Live Activity record ID | defaults to undefined
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Return type
|
|
74
|
+
|
|
75
|
+
**void**
|
|
76
|
+
|
|
77
|
+
### Authorization
|
|
78
|
+
|
|
79
|
+
[app_key](README.md#app_key)
|
|
80
|
+
|
|
81
|
+
### HTTP request headers
|
|
82
|
+
|
|
83
|
+
- **Content-Type**: application/json
|
|
84
|
+
- **Accept**: application/json
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### HTTP response details
|
|
88
|
+
| Status code | Description | Response headers |
|
|
89
|
+
|-------------|-------------|------------------|
|
|
90
|
+
**204** | OK | - |
|
|
91
|
+
**400** | Bad Request | - |
|
|
92
|
+
|
|
93
|
+
[[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)
|
|
94
|
+
|
|
28
95
|
# **cancelNotification**
|
|
29
96
|
> CancelNotificationSuccessResponse cancelNotification()
|
|
30
97
|
|
|
@@ -79,6 +146,7 @@ Name | Type | Description | Notes
|
|
|
79
146
|
| Status code | Description | Response headers |
|
|
80
147
|
|-------------|-------------|------------------|
|
|
81
148
|
**200** | OK | - |
|
|
149
|
+
**400** | Bad Request | - |
|
|
82
150
|
|
|
83
151
|
[[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)
|
|
84
152
|
|
|
@@ -112,6 +180,10 @@ let body:.DefaultApiCreateAppRequest = {
|
|
|
112
180
|
apns_p12_password: "apns_p12_password_example",
|
|
113
181
|
safari_apns_p12: "safari_apns_p12_example",
|
|
114
182
|
safari_apns_p12_password: "safari_apns_p12_password_example",
|
|
183
|
+
apns_key_id: "apns_key_id_example",
|
|
184
|
+
apns_team_id: "apns_team_id_example",
|
|
185
|
+
apns_bundle_id: "apns_bundle_id_example",
|
|
186
|
+
apns_p8: "apns_p8_example",
|
|
115
187
|
safari_site_origin: "safari_site_origin_example",
|
|
116
188
|
safari_icon_256_256: "safari_icon_256_256_example",
|
|
117
189
|
site_name: "site_name_example",
|
|
@@ -151,6 +223,7 @@ Name | Type | Description | Notes
|
|
|
151
223
|
| Status code | Description | Response headers |
|
|
152
224
|
|-------------|-------------|------------------|
|
|
153
225
|
**200** | OK | - |
|
|
226
|
+
**400** | Bad Request | - |
|
|
154
227
|
|
|
155
228
|
[[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)
|
|
156
229
|
|
|
@@ -286,6 +359,7 @@ Name | Type | Description | Notes
|
|
|
286
359
|
| Status code | Description | Response headers |
|
|
287
360
|
|-------------|-------------|------------------|
|
|
288
361
|
**200** | OK | - |
|
|
362
|
+
**400** | Bad Request | - |
|
|
289
363
|
|
|
290
364
|
[[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)
|
|
291
365
|
|
|
@@ -472,6 +546,67 @@ Name | Type | Description | Notes
|
|
|
472
546
|
|
|
473
547
|
[[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)
|
|
474
548
|
|
|
549
|
+
# **endLiveActivity**
|
|
550
|
+
> void endLiveActivity()
|
|
551
|
+
|
|
552
|
+
Stops a Live Activity
|
|
553
|
+
|
|
554
|
+
### Example
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
```typescript
|
|
558
|
+
import { } from '';
|
|
559
|
+
import * as fs from 'fs';
|
|
560
|
+
|
|
561
|
+
const configuration = .createConfiguration();
|
|
562
|
+
const apiInstance = new .DefaultApi(configuration);
|
|
563
|
+
|
|
564
|
+
let body:.DefaultApiEndLiveActivityRequest = {
|
|
565
|
+
// string | The OneSignal App ID for your app. Available in Keys & IDs.
|
|
566
|
+
appId: "app_id_example",
|
|
567
|
+
// string | Live Activity record ID
|
|
568
|
+
activityId: "activity_id_example",
|
|
569
|
+
// string | Subscription ID
|
|
570
|
+
subscriptionId: "subscription_id_example",
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
apiInstance.endLiveActivity(body).then((data:any) => {
|
|
574
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
575
|
+
}).catch((error:any) => console.error(error));
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
### Parameters
|
|
580
|
+
|
|
581
|
+
Name | Type | Description | Notes
|
|
582
|
+
------------- | ------------- | ------------- | -------------
|
|
583
|
+
**appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined
|
|
584
|
+
**activityId** | [**string**] | Live Activity record ID | defaults to undefined
|
|
585
|
+
**subscriptionId** | [**string**] | Subscription ID | defaults to undefined
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
### Return type
|
|
589
|
+
|
|
590
|
+
**void**
|
|
591
|
+
|
|
592
|
+
### Authorization
|
|
593
|
+
|
|
594
|
+
[app_key](README.md#app_key)
|
|
595
|
+
|
|
596
|
+
### HTTP request headers
|
|
597
|
+
|
|
598
|
+
- **Content-Type**: Not defined
|
|
599
|
+
- **Accept**: application/json
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
### HTTP response details
|
|
603
|
+
| Status code | Description | Response headers |
|
|
604
|
+
|-------------|-------------|------------------|
|
|
605
|
+
**204** | OK | - |
|
|
606
|
+
**400** | Bad Request | - |
|
|
607
|
+
|
|
608
|
+
[[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)
|
|
609
|
+
|
|
475
610
|
# **exportPlayers**
|
|
476
611
|
> ExportPlayersSuccessResponse exportPlayers()
|
|
477
612
|
|
|
@@ -587,6 +722,7 @@ Name | Type | Description | Notes
|
|
|
587
722
|
| Status code | Description | Response headers |
|
|
588
723
|
|-------------|-------------|------------------|
|
|
589
724
|
**200** | OK | - |
|
|
725
|
+
**400** | Bad Request | - |
|
|
590
726
|
|
|
591
727
|
[[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)
|
|
592
728
|
|
|
@@ -635,6 +771,7 @@ This endpoint does not need any parameter.
|
|
|
635
771
|
| Status code | Description | Response headers |
|
|
636
772
|
|-------------|-------------|------------------|
|
|
637
773
|
**200** | OK | - |
|
|
774
|
+
**400** | Bad Request | - |
|
|
638
775
|
|
|
639
776
|
[[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)
|
|
640
777
|
|
|
@@ -692,6 +829,7 @@ Name | Type | Description | Notes
|
|
|
692
829
|
| Status code | Description | Response headers |
|
|
693
830
|
|-------------|-------------|------------------|
|
|
694
831
|
**200** | OK | - |
|
|
832
|
+
**400** | Bad Request | - |
|
|
695
833
|
|
|
696
834
|
[[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)
|
|
697
835
|
|
|
@@ -817,6 +955,7 @@ Name | Type | Description | Notes
|
|
|
817
955
|
| Status code | Description | Response headers |
|
|
818
956
|
|-------------|-------------|------------------|
|
|
819
957
|
**200** | OK | - |
|
|
958
|
+
**400** | Bad Request | - |
|
|
820
959
|
|
|
821
960
|
[[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)
|
|
822
961
|
|
|
@@ -886,6 +1025,7 @@ Name | Type | Description | Notes
|
|
|
886
1025
|
| Status code | Description | Response headers |
|
|
887
1026
|
|-------------|-------------|------------------|
|
|
888
1027
|
**200** | OK | - |
|
|
1028
|
+
**400** | Bad Request | - |
|
|
889
1029
|
|
|
890
1030
|
[[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)
|
|
891
1031
|
|
|
@@ -946,6 +1086,7 @@ Name | Type | Description | Notes
|
|
|
946
1086
|
| Status code | Description | Response headers |
|
|
947
1087
|
|-------------|-------------|------------------|
|
|
948
1088
|
**200** | OK | - |
|
|
1089
|
+
**400** | Bad Request | - |
|
|
949
1090
|
|
|
950
1091
|
[[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)
|
|
951
1092
|
|
|
@@ -1006,6 +1147,7 @@ Name | Type | Description | Notes
|
|
|
1006
1147
|
| Status code | Description | Response headers |
|
|
1007
1148
|
|-------------|-------------|------------------|
|
|
1008
1149
|
**200** | OK | - |
|
|
1150
|
+
**400** | Bad Request | - |
|
|
1009
1151
|
|
|
1010
1152
|
[[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)
|
|
1011
1153
|
|
|
@@ -1041,6 +1183,10 @@ let body:.DefaultApiUpdateAppRequest = {
|
|
|
1041
1183
|
apns_p12_password: "apns_p12_password_example",
|
|
1042
1184
|
safari_apns_p12: "safari_apns_p12_example",
|
|
1043
1185
|
safari_apns_p12_password: "safari_apns_p12_password_example",
|
|
1186
|
+
apns_key_id: "apns_key_id_example",
|
|
1187
|
+
apns_team_id: "apns_team_id_example",
|
|
1188
|
+
apns_bundle_id: "apns_bundle_id_example",
|
|
1189
|
+
apns_p8: "apns_p8_example",
|
|
1044
1190
|
safari_site_origin: "safari_site_origin_example",
|
|
1045
1191
|
safari_icon_256_256: "safari_icon_256_256_example",
|
|
1046
1192
|
site_name: "site_name_example",
|
|
@@ -1081,6 +1227,73 @@ Name | Type | Description | Notes
|
|
|
1081
1227
|
| Status code | Description | Response headers |
|
|
1082
1228
|
|-------------|-------------|------------------|
|
|
1083
1229
|
**200** | OK | - |
|
|
1230
|
+
**400** | Bad Request | - |
|
|
1231
|
+
|
|
1232
|
+
[[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)
|
|
1233
|
+
|
|
1234
|
+
# **updateLiveActivity**
|
|
1235
|
+
> UpdateLiveActivitySuccessResponse updateLiveActivity(updateLiveActivityRequest)
|
|
1236
|
+
|
|
1237
|
+
Updates a specified live activity.
|
|
1238
|
+
|
|
1239
|
+
### Example
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
```typescript
|
|
1243
|
+
import { } from '';
|
|
1244
|
+
import * as fs from 'fs';
|
|
1245
|
+
|
|
1246
|
+
const configuration = .createConfiguration();
|
|
1247
|
+
const apiInstance = new .DefaultApi(configuration);
|
|
1248
|
+
|
|
1249
|
+
let body:.DefaultApiUpdateLiveActivityRequest = {
|
|
1250
|
+
// string | The OneSignal App ID for your app. Available in Keys & IDs.
|
|
1251
|
+
appId: "app_id_example",
|
|
1252
|
+
// string | Live Activity record ID
|
|
1253
|
+
activityId: "activity_id_example",
|
|
1254
|
+
// UpdateLiveActivityRequest
|
|
1255
|
+
updateLiveActivityRequest: {
|
|
1256
|
+
name: "headings",
|
|
1257
|
+
event: "update",
|
|
1258
|
+
event_updates: {},
|
|
1259
|
+
dismiss_at: 3.14,
|
|
1260
|
+
},
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
apiInstance.updateLiveActivity(body).then((data:any) => {
|
|
1264
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
1265
|
+
}).catch((error:any) => console.error(error));
|
|
1266
|
+
```
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
### Parameters
|
|
1270
|
+
|
|
1271
|
+
Name | Type | Description | Notes
|
|
1272
|
+
------------- | ------------- | ------------- | -------------
|
|
1273
|
+
**updateLiveActivityRequest** | **UpdateLiveActivityRequest**| |
|
|
1274
|
+
**appId** | [**string**] | The OneSignal App ID for your app. Available in Keys & IDs. | defaults to undefined
|
|
1275
|
+
**activityId** | [**string**] | Live Activity record ID | defaults to undefined
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
### Return type
|
|
1279
|
+
|
|
1280
|
+
**UpdateLiveActivitySuccessResponse**
|
|
1281
|
+
|
|
1282
|
+
### Authorization
|
|
1283
|
+
|
|
1284
|
+
[app_key](README.md#app_key)
|
|
1285
|
+
|
|
1286
|
+
### HTTP request headers
|
|
1287
|
+
|
|
1288
|
+
- **Content-Type**: application/json
|
|
1289
|
+
- **Accept**: application/json
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
### HTTP response details
|
|
1293
|
+
| Status code | Description | Response headers |
|
|
1294
|
+
|-------------|-------------|------------------|
|
|
1295
|
+
**200** | OK | - |
|
|
1296
|
+
**400** | Bad Request | - |
|
|
1084
1297
|
|
|
1085
1298
|
[[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)
|
|
1086
1299
|
|
|
@@ -1164,6 +1377,7 @@ Name | Type | Description | Notes
|
|
|
1164
1377
|
| Status code | Description | Response headers |
|
|
1165
1378
|
|-------------|-------------|------------------|
|
|
1166
1379
|
**200** | OK | - |
|
|
1380
|
+
**400** | Bad Request | - |
|
|
1167
1381
|
|
|
1168
1382
|
[[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)
|
|
1169
1383
|
|
|
@@ -1226,6 +1440,7 @@ Name | Type | Description | Notes
|
|
|
1226
1440
|
| Status code | Description | Response headers |
|
|
1227
1441
|
|-------------|-------------|------------------|
|
|
1228
1442
|
**200** | OK | - |
|
|
1443
|
+
**400** | Bad Request | - |
|
|
1229
1444
|
|
|
1230
1445
|
[[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)
|
|
1231
1446
|
|
package/README.md
CHANGED
|
@@ -399,6 +399,47 @@ Outcome data are accessible for 30 days before being deleted from our servers. Y
|
|
|
399
399
|
const outcomes = await client.getOutcomes(app.id, 'os__click.count,os_session_duration.count,my_outcome.sum');
|
|
400
400
|
```
|
|
401
401
|
|
|
402
|
+
### Begin Live Activity
|
|
403
|
+
Starts a Live Activity event
|
|
404
|
+
```js
|
|
405
|
+
// Create a player first
|
|
406
|
+
const player = new OneSignal.Player();
|
|
407
|
+
player.device_type = 0;
|
|
408
|
+
player.app_id = '<app id>';
|
|
409
|
+
const playerResponse = await api.createPlayer(player);
|
|
410
|
+
|
|
411
|
+
// Prepare a request
|
|
412
|
+
const beginLiveActivityRequest: BeginLiveActivityRequest = {
|
|
413
|
+
push_token: '<push_token>',
|
|
414
|
+
subscription_id: playerResponse.id!,
|
|
415
|
+
};
|
|
416
|
+
const activityId = '<activity_id>'; // any string
|
|
417
|
+
|
|
418
|
+
// Begin activity
|
|
419
|
+
await api.beginLiveActivity('<app_id>', activityId, beginLiveActivityRequest);
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Update Live Activity
|
|
423
|
+
Updates a Live Activity event
|
|
424
|
+
```js
|
|
425
|
+
const updateLiveActivityRequest: UpdateLiveActivityRequest = {
|
|
426
|
+
event_updates: {
|
|
427
|
+
data: 'test'
|
|
428
|
+
},
|
|
429
|
+
event: "update",
|
|
430
|
+
name: "contents"
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
await api.updateLiveActivity('<app_id>', '<activity_id>', updateLiveActivityRequest);
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### End Live Activity
|
|
437
|
+
Stops a Live Activity event
|
|
438
|
+
```js
|
|
439
|
+
const subscriptionId = '<subscription_id>'; // player id
|
|
440
|
+
await api.endLiveActivity('<app_id>', '<activity_id>', subscriptionId);
|
|
441
|
+
```
|
|
442
|
+
|
|
402
443
|
## Author
|
|
403
444
|
|
|
404
445
|
* Website: https://onesignal.com
|