Skip to content

Commit c34a38d

Browse files
authored
Merge pull request #10 from OneSignal/api
Dependency Update
2 parents e17c745 + f9f7b43 commit c34a38d

File tree

63 files changed

+4272
-1145
lines changed

Some content is hidden

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

63 files changed

+4272
-1145
lines changed

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,52 @@ $outcomesResponse = $apiInstance->getOutcomes(APP_ID, $outcomeNames, null, $outc
263263
print_r($outcomesResponse->getOutcomes());
264264
```
265265

266+
## Live Activities
267+
### Begin Live Activity
268+
```php
269+
$activityId = "activity_id_example";
270+
$beginLiveActivityRequest = new BeginLiveActivityRequest(array(
271+
'push_token' => "push_token_example",
272+
'subscription_id' => "player_id_example"
273+
));
274+
275+
self::$apiInstance->beginLiveActivity(APP_ID, $activityId, $beginLiveActivityRequest);
276+
```
277+
278+
### Update Live Activity
279+
```php
280+
$activityId = "activity_id_example";
281+
$updateLiveActivityRequest = new UpdateLiveActivityRequest(array(
282+
'event' => 'update',
283+
'name' => 'contents',
284+
'event_updates' => array('data' => 'test')
285+
));
286+
287+
self::$apiInstance->updateLiveActivity(APP_ID, $activityId, $updateLiveActivityRequest);
288+
```
289+
290+
### End Live Activity
291+
```php
292+
$activityId = "activity_id_example";
293+
$subscriptionId = "player_id_example";
294+
self::$apiInstance->endLiveActivity(APP_ID, $activityId, $subscriptionId);
295+
```
296+
266297
## API Endpoints
267298

268299
All URIs are relative to *https://onesignal.com/api/v1*
269300

270301
Class | Method | HTTP request | Description
271302
------------ | ------------- | ------------- | -------------
303+
*DefaultApi* | [**beginLiveActivity**](docs/Api/DefaultApi.md#beginliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity
272304
*DefaultApi* | [**cancelNotification**](docs/Api/DefaultApi.md#cancelnotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
273305
*DefaultApi* | [**createApp**](docs/Api/DefaultApi.md#createapp) | **POST** /apps | Create an app
274306
*DefaultApi* | [**createNotification**](docs/Api/DefaultApi.md#createnotification) | **POST** /notifications | Create notification
275307
*DefaultApi* | [**createPlayer**](docs/Api/DefaultApi.md#createplayer) | **POST** /players | Add a device
276308
*DefaultApi* | [**createSegments**](docs/Api/DefaultApi.md#createsegments) | **POST** /apps/{app_id}/segments | Create Segments
277309
*DefaultApi* | [**deletePlayer**](docs/Api/DefaultApi.md#deleteplayer) | **DELETE** /players/{player_id} | Delete a user record
278310
*DefaultApi* | [**deleteSegments**](docs/Api/DefaultApi.md#deletesegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments
311+
*DefaultApi* | [**endLiveActivity**](docs/Api/DefaultApi.md#endliveactivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity
279312
*DefaultApi* | [**exportPlayers**](docs/Api/DefaultApi.md#exportplayers) | **POST** /players/csv_export?app_id={app_id} | CSV export
280313
*DefaultApi* | [**getApp**](docs/Api/DefaultApi.md#getapp) | **GET** /apps/{app_id} | View an app
281314
*DefaultApi* | [**getApps**](docs/Api/DefaultApi.md#getapps) | **GET** /apps | View apps
@@ -286,27 +319,26 @@ Class | Method | HTTP request | Description
286319
*DefaultApi* | [**getPlayer**](docs/Api/DefaultApi.md#getplayer) | **GET** /players/{player_id} | View device
287320
*DefaultApi* | [**getPlayers**](docs/Api/DefaultApi.md#getplayers) | **GET** /players | View devices
288321
*DefaultApi* | [**updateApp**](docs/Api/DefaultApi.md#updateapp) | **PUT** /apps/{app_id} | Update an app
322+
*DefaultApi* | [**updateLiveActivity**](docs/Api/DefaultApi.md#updateliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
289323
*DefaultApi* | [**updatePlayer**](docs/Api/DefaultApi.md#updateplayer) | **PUT** /players/{player_id} | Edit device
290324
*DefaultApi* | [**updatePlayerTags**](docs/Api/DefaultApi.md#updateplayertags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id
291325

292326
## Models
293327

294328
- [App](docs/Model/App.md)
329+
- [BadRequestError](docs/Model/BadRequestError.md)
295330
- [BasicNotification](docs/Model/BasicNotification.md)
296331
- [BasicNotificationAllOf](docs/Model/BasicNotificationAllOf.md)
297332
- [BasicNotificationAllOfAndroidBackgroundLayout](docs/Model/BasicNotificationAllOfAndroidBackgroundLayout.md)
333+
- [BeginLiveActivityRequest](docs/Model/BeginLiveActivityRequest.md)
298334
- [Button](docs/Model/Button.md)
299335
- [CancelNotificationSuccessResponse](docs/Model/CancelNotificationSuccessResponse.md)
300-
- [CreateNotificationBadRequestResponse](docs/Model/CreateNotificationBadRequestResponse.md)
301336
- [CreateNotificationSuccessResponse](docs/Model/CreateNotificationSuccessResponse.md)
302337
- [CreatePlayerSuccessResponse](docs/Model/CreatePlayerSuccessResponse.md)
303-
- [CreateSegmentBadRequestResponse](docs/Model/CreateSegmentBadRequestResponse.md)
304338
- [CreateSegmentConflictResponse](docs/Model/CreateSegmentConflictResponse.md)
305339
- [CreateSegmentSuccessResponse](docs/Model/CreateSegmentSuccessResponse.md)
306-
- [DeletePlayerBadRequestResponse](docs/Model/DeletePlayerBadRequestResponse.md)
307340
- [DeletePlayerNotFoundResponse](docs/Model/DeletePlayerNotFoundResponse.md)
308341
- [DeletePlayerSuccessResponse](docs/Model/DeletePlayerSuccessResponse.md)
309-
- [DeleteSegmentBadRequestResponse](docs/Model/DeleteSegmentBadRequestResponse.md)
310342
- [DeleteSegmentNotFoundResponse](docs/Model/DeleteSegmentNotFoundResponse.md)
311343
- [DeleteSegmentSuccessResponse](docs/Model/DeleteSegmentSuccessResponse.md)
312344
- [DeliveryData](docs/Model/DeliveryData.md)
@@ -319,7 +351,6 @@ Class | Method | HTTP request | Description
319351
- [Notification](docs/Model/Notification.md)
320352
- [Notification200Errors](docs/Model/Notification200Errors.md)
321353
- [NotificationAllOf](docs/Model/NotificationAllOf.md)
322-
- [NotificationHistoryBadRequestResponse](docs/Model/NotificationHistoryBadRequestResponse.md)
323354
- [NotificationHistorySuccessResponse](docs/Model/NotificationHistorySuccessResponse.md)
324355
- [NotificationSlice](docs/Model/NotificationSlice.md)
325356
- [NotificationTarget](docs/Model/NotificationTarget.md)
@@ -338,6 +369,8 @@ Class | Method | HTTP request | Description
338369
- [Segment](docs/Model/Segment.md)
339370
- [SegmentNotificationTarget](docs/Model/SegmentNotificationTarget.md)
340371
- [StringMap](docs/Model/StringMap.md)
372+
- [UpdateLiveActivityRequest](docs/Model/UpdateLiveActivityRequest.md)
373+
- [UpdateLiveActivitySuccessResponse](docs/Model/UpdateLiveActivitySuccessResponse.md)
341374
- [UpdatePlayerSuccessResponse](docs/Model/UpdatePlayerSuccessResponse.md)
342375
- [UpdatePlayerTagsRequestBody](docs/Model/UpdatePlayerTagsRequestBody.md)
343376
- [UpdatePlayerTagsSuccessResponse](docs/Model/UpdatePlayerTagsSuccessResponse.md)
@@ -365,5 +398,5 @@ requires app_key and which user_key. You can get the value of these keys from yo
365398
366399

367400

368-
- API version: `1.0.1`
369-
- Package version: `1.0.0`
401+
- API version: `1.0.2`
402+
- Package version: `1.0.4`

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "onesignal/onesignal-php-api",
3-
"version": "1.0.0",
3+
"version": "1.0.4",
44
"description": "A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com",
55
"keywords": [
66
"onesignal",

docs/Api/DefaultApi.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ All URIs are relative to https://onesignal.com/api/v1.
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7+
[**beginLiveActivity()**](DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity
78
[**cancelNotification()**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
89
[**createApp()**](DefaultApi.md#createApp) | **POST** /apps | Create an app
910
[**createNotification()**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification
1011
[**createPlayer()**](DefaultApi.md#createPlayer) | **POST** /players | Add a device
1112
[**createSegments()**](DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments
1213
[**deletePlayer()**](DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record
1314
[**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
1416
[**exportPlayers()**](DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | CSV export
1517
[**getApp()**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app
1618
[**getApps()**](DefaultApi.md#getApps) | **GET** /apps | View apps
@@ -21,10 +23,77 @@ Method | HTTP request | Description
2123
[**getPlayer()**](DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device
2224
[**getPlayers()**](DefaultApi.md#getPlayers) | **GET** /players | View devices
2325
[**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
2427
[**updatePlayer()**](DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device
2528
[**updatePlayerTags()**](DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id
2629

2730

31+
## `beginLiveActivity()`
32+
33+
```php
34+
beginLiveActivity($app_id, $activity_id, $begin_live_activity_request)
35+
```
36+
37+
Start Live Activity
38+
39+
Starts a Live Activity
40+
41+
### Example
42+
43+
```php
44+
<?php
45+
require_once(__DIR__ . '/vendor/autoload.php');
46+
47+
48+
// Configure Bearer authorization: app_key
49+
$config = onesignal\client\Configuration::getDefaultConfiguration()
50+
->setAppKeyToken('YOUR_APP_KEY_TOKEN')
51+
->setUserKeyToken('YOUR_USER_KEY_TOKEN');
52+
53+
54+
55+
$apiInstance = new onesignal\client\Api\DefaultApi(
56+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
57+
// This is optional, `GuzzleHttp\Client` will be used as default.
58+
new GuzzleHttp\Client(),
59+
$config
60+
);
61+
$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs.
62+
$activity_id = 'activity_id_example'; // string | Live Activity record ID
63+
$begin_live_activity_request = new \onesignal\client\model\BeginLiveActivityRequest(); // \onesignal\client\model\BeginLiveActivityRequest
64+
65+
try {
66+
$apiInstance->beginLiveActivity($app_id, $activity_id, $begin_live_activity_request);
67+
} catch (Exception $e) {
68+
echo 'Exception when calling DefaultApi->beginLiveActivity: ', $e->getMessage(), PHP_EOL;
69+
}
70+
```
71+
72+
### Parameters
73+
74+
Name | Type | Description | Notes
75+
------------- | ------------- | ------------- | -------------
76+
**app_id** | **string**| The OneSignal App ID for your app. Available in Keys &amp; IDs. |
77+
**activity_id** | **string**| Live Activity record ID |
78+
**begin_live_activity_request** | [**\onesignal\client\model\BeginLiveActivityRequest**](../Model/BeginLiveActivityRequest.md)| |
79+
80+
### Return type
81+
82+
void (empty response body)
83+
84+
### Authorization
85+
86+
[app_key](../../README.md#app_key)
87+
88+
### HTTP request headers
89+
90+
- **Content-Type**: `application/json`
91+
- **Accept**: `application/json`
92+
93+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
94+
[[Back to Model list]](../../README.md#models)
95+
[[Back to README]](../../README.md)
96+
2897
## `cancelNotification()`
2998

3099
```php
@@ -474,6 +543,72 @@ Name | Type | Description | Notes
474543
[[Back to Model list]](../../README.md#models)
475544
[[Back to README]](../../README.md)
476545

546+
## `endLiveActivity()`
547+
548+
```php
549+
endLiveActivity($app_id, $activity_id, $subscription_id)
550+
```
551+
552+
Stop Live Activity
553+
554+
Stops a Live Activity
555+
556+
### Example
557+
558+
```php
559+
<?php
560+
require_once(__DIR__ . '/vendor/autoload.php');
561+
562+
563+
// Configure Bearer authorization: app_key
564+
$config = onesignal\client\Configuration::getDefaultConfiguration()
565+
->setAppKeyToken('YOUR_APP_KEY_TOKEN')
566+
->setUserKeyToken('YOUR_USER_KEY_TOKEN');
567+
568+
569+
570+
$apiInstance = new onesignal\client\Api\DefaultApi(
571+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
572+
// This is optional, `GuzzleHttp\Client` will be used as default.
573+
new GuzzleHttp\Client(),
574+
$config
575+
);
576+
$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs.
577+
$activity_id = 'activity_id_example'; // string | Live Activity record ID
578+
$subscription_id = 'subscription_id_example'; // string | Subscription ID
579+
580+
try {
581+
$apiInstance->endLiveActivity($app_id, $activity_id, $subscription_id);
582+
} catch (Exception $e) {
583+
echo 'Exception when calling DefaultApi->endLiveActivity: ', $e->getMessage(), PHP_EOL;
584+
}
585+
```
586+
587+
### Parameters
588+
589+
Name | Type | Description | Notes
590+
------------- | ------------- | ------------- | -------------
591+
**app_id** | **string**| The OneSignal App ID for your app. Available in Keys &amp; IDs. |
592+
**activity_id** | **string**| Live Activity record ID |
593+
**subscription_id** | **string**| Subscription ID |
594+
595+
### Return type
596+
597+
void (empty response body)
598+
599+
### Authorization
600+
601+
[app_key](../../README.md#app_key)
602+
603+
### HTTP request headers
604+
605+
- **Content-Type**: Not defined
606+
- **Accept**: `application/json`
607+
608+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
609+
[[Back to Model list]](../../README.md#models)
610+
[[Back to README]](../../README.md)
611+
477612
## `exportPlayers()`
478613

479614
```php
@@ -1133,6 +1268,73 @@ Name | Type | Description | Notes
11331268
[[Back to Model list]](../../README.md#models)
11341269
[[Back to README]](../../README.md)
11351270

1271+
## `updateLiveActivity()`
1272+
1273+
```php
1274+
updateLiveActivity($app_id, $activity_id, $update_live_activity_request): \onesignal\client\model\UpdateLiveActivitySuccessResponse
1275+
```
1276+
1277+
Update a Live Activity via Push
1278+
1279+
Updates a specified live activity.
1280+
1281+
### Example
1282+
1283+
```php
1284+
<?php
1285+
require_once(__DIR__ . '/vendor/autoload.php');
1286+
1287+
1288+
// Configure Bearer authorization: app_key
1289+
$config = onesignal\client\Configuration::getDefaultConfiguration()
1290+
->setAppKeyToken('YOUR_APP_KEY_TOKEN')
1291+
->setUserKeyToken('YOUR_USER_KEY_TOKEN');
1292+
1293+
1294+
1295+
$apiInstance = new onesignal\client\Api\DefaultApi(
1296+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
1297+
// This is optional, `GuzzleHttp\Client` will be used as default.
1298+
new GuzzleHttp\Client(),
1299+
$config
1300+
);
1301+
$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs.
1302+
$activity_id = 'activity_id_example'; // string | Live Activity record ID
1303+
$update_live_activity_request = new \onesignal\client\model\UpdateLiveActivityRequest(); // \onesignal\client\model\UpdateLiveActivityRequest
1304+
1305+
try {
1306+
$result = $apiInstance->updateLiveActivity($app_id, $activity_id, $update_live_activity_request);
1307+
print_r($result);
1308+
} catch (Exception $e) {
1309+
echo 'Exception when calling DefaultApi->updateLiveActivity: ', $e->getMessage(), PHP_EOL;
1310+
}
1311+
```
1312+
1313+
### Parameters
1314+
1315+
Name | Type | Description | Notes
1316+
------------- | ------------- | ------------- | -------------
1317+
**app_id** | **string**| The OneSignal App ID for your app. Available in Keys &amp; IDs. |
1318+
**activity_id** | **string**| Live Activity record ID |
1319+
**update_live_activity_request** | [**\onesignal\client\model\UpdateLiveActivityRequest**](../Model/UpdateLiveActivityRequest.md)| |
1320+
1321+
### Return type
1322+
1323+
[**\onesignal\client\model\UpdateLiveActivitySuccessResponse**](../Model/UpdateLiveActivitySuccessResponse.md)
1324+
1325+
### Authorization
1326+
1327+
[app_key](../../README.md#app_key)
1328+
1329+
### HTTP request headers
1330+
1331+
- **Content-Type**: `application/json`
1332+
- **Accept**: `application/json`
1333+
1334+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
1335+
[[Back to Model list]](../../README.md#models)
1336+
[[Back to README]](../../README.md)
1337+
11361338
## `updatePlayer()`
11371339

11381340
```php

docs/Model/App.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Name | Type | Description | Notes
2323
**safari_apns_certificates** | **string** | | [optional] [readonly]
2424
**safari_apns_p12** | **string** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional]
2525
**safari_apns_p12_password** | **string** | Safari: Password for safari_apns_p12 file | [optional]
26+
**apns_key_id** | **string** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional]
27+
**apns_team_id** | **string** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional]
28+
**apns_bundle_id** | **string** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional]
29+
**apns_p8** | **string** | iOS: Required if using p8. Base64 encoded p8 key | [optional]
2630
**safari_site_origin** | **string** | Safari (Recommended): The hostname to your website including http(s):// | [optional]
2731
**safari_push_id** | **string** | | [optional] [readonly]
2832
**safari_icon_16_16** | **string** | | [optional] [readonly]

docs/Model/BadRequestError.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# # BadRequestError
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**errors** | **string[]** | | [optional]
8+
9+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # BeginLiveActivityRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**push_token** | **string** | |
8+
**subscription_id** | **string** | |
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

0 commit comments

Comments
 (0)