Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions activitysmith_openapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
from activitysmith_openapi.models.push_interruption_level import PushInterruptionLevel
from activitysmith_openapi.models.push_notification_action import PushNotificationAction
from activitysmith_openapi.models.push_notification_action_type import PushNotificationActionType
from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest
from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse
from activitysmith_openapi.models.push_notification_request import PushNotificationRequest
from activitysmith_openapi.models.push_notification_response import PushNotificationResponse
from activitysmith_openapi.models.push_notification_webhook_method import PushNotificationWebhookMethod
Expand Down
318 changes: 315 additions & 3 deletions activitysmith_openapi/api/push_notifications_api.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions activitysmith_openapi/docs/AppIconBadgeCountUpdateResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Name | Type | Description | Notes
**users_notified** | **int** | Deprecated compatibility alias for users_updated. | [optional]
**effective_channel_slugs** | **List[str]** | |
**timestamp** | **datetime** | |
**devices_targeted** | **int** | Number of device tokens targeted. | [optional]
**devices_deactivated** | **int** | Number of device tokens deactivated because APNs reported them unregistered. | [optional]
**devices_unregistered** | **int** | Number of targeted device tokens APNs reported as unregistered. | [optional]

## Example

Expand Down
6 changes: 6 additions & 0 deletions activitysmith_openapi/docs/LiveActivityEndResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Name | Type | Description | Notes
**devices_queued** | **int** | | [optional]
**devices_notified** | **int** | | [optional]
**timestamp** | **datetime** | |
**ignored** | **bool** | True when the Live Activity had already ended and the request had no effect. | [optional]
**message** | **str** | | [optional]
**end_reason** | **str** | | [optional]
**forced_completion** | **bool** | True when the Live Activity was marked complete without a confirmed APNs end delivery. | [optional]
**warning** | **str** | | [optional]
**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional]

## Example

Expand Down
3 changes: 3 additions & 0 deletions activitysmith_openapi/docs/LiveActivityStartResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Name | Type | Description | Notes
**effective_channel_slugs** | **List[str]** | | [optional]
**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional]
**timestamp** | **datetime** | |
**ended_activity_id** | **str** | Present when starting this Live Activity ended an older one to stay within the device limit. | [optional]
**message** | **str** | | [optional]
**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional]

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Name | Type | Description | Notes
**devices_queued** | **int** | | [optional]
**devices_notified** | **int** | | [optional]
**timestamp** | **datetime** | |
**ignored** | **bool** | True when the stream was already ended and the request had no effect. | [optional]
**message** | **str** | | [optional]
**forced_completion** | **bool** | | [optional]
**warning** | **str** | | [optional]
**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional]

## Example

Expand Down
5 changes: 5 additions & 0 deletions activitysmith_openapi/docs/LiveActivityStreamPutResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ Name | Type | Description | Notes
**users_notified** | **int** | | [optional]
**effective_channel_slugs** | **List[str]** | | [optional]
**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional]
**warning** | **str** | Present on `updated` responses when the current Live Activity has received more than 12 updates and has averaged more than one update every 2 minutes since it started. The update is still sent, but iOS may throttle Live Activities that update this often. | [optional]
**timestamp** | **datetime** | |
**ignored** | **bool** | True when the request had no effect. | [optional]
**remote_push_sent** | **bool** | | [optional]
**message** | **str** | | [optional]
**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional]

## Example

Expand Down
7 changes: 7 additions & 0 deletions activitysmith_openapi/docs/LiveActivityUpdateResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Name | Type | Description | Notes
**devices_queued** | **int** | | [optional]
**devices_notified** | **int** | | [optional]
**timestamp** | **datetime** | |
**users_notified** | **int** | | [optional]
**effective_channel_slugs** | **List[str]** | | [optional]
**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional]
**operation** | **str** | Present when the update started a new Live Activity for a managed stream. | [optional]
**stream_key** | **str** | | [optional]
**previous_activity_id** | **str** | | [optional]
**errors** | **List[str]** | Per-device delivery errors when some devices could not be reached. | [optional]

## Example

Expand Down
40 changes: 40 additions & 0 deletions activitysmith_openapi/docs/PushNotificationReplaceRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# PushNotificationReplaceRequest

Replacement content. title, subtitle, message, redirection, media, icon, actions, and payload fully replace the original values. Omit metadata or tags to keep the stored values; send {} or [] to clear them.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**metadata** | [**Dict[str, MetadataValue]**](MetadataValue.md) | Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. | [optional]
**title** | **str** | |
**message** | **str** | | [optional]
**subtitle** | **str** | | [optional]
**icon** | **str** | Optional HTTPS image URL without credentials for a custom notification icon. If the image cannot be loaded, the app icon is used. iOS may omit subtitle when displaying a custom icon. | [optional]
**media** | **str** | Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`. | [optional]
**redirection** | **str** | Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media. | [optional]
**actions** | [**List[PushNotificationAction]**](PushNotificationAction.md) | Optional interactive actions shown when users expand the notification. Cannot be combined with `media`. | [optional]
**payload** | **object** | | [optional]
**badge** | **int** | | [optional]
**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional]

## Example

```python
from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest

# TODO update the JSON string below
json = "{}"
# create an instance of PushNotificationReplaceRequest from a JSON string
push_notification_replace_request_instance = PushNotificationReplaceRequest.from_json(json)
# print the JSON string representation of the object
print(PushNotificationReplaceRequest.to_json())

# convert the object into a dict
push_notification_replace_request_dict = push_notification_replace_request_instance.to_dict()
# create an instance of PushNotificationReplaceRequest from a dict
push_notification_replace_request_from_dict = PushNotificationReplaceRequest.from_dict(push_notification_replace_request_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


36 changes: 36 additions & 0 deletions activitysmith_openapi/docs/PushNotificationReplaceResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# PushNotificationReplaceResponse

Apple APNs acceptance result for the replacement. Acceptance does not confirm device delivery or presentation.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **bool** | True when APNs accepts the replacement for at least one device. |
**notification_id** | **str** | ID of the replaced Push Notification. It stays the same, so you can replace it again. |
**devices_notified** | **int** | Number of device tokens for which APNs accepted the notification, without confirming on-device delivery. | [optional]
**users_notified** | **int** | | [optional]
**effective_channel_slugs** | **List[str]** | | [optional]
**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional]
**timestamp** | **datetime** | |

## Example

```python
from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse

# TODO update the JSON string below
json = "{}"
# create an instance of PushNotificationReplaceResponse from a JSON string
push_notification_replace_response_instance = PushNotificationReplaceResponse.from_json(json)
# print the JSON string representation of the object
print(PushNotificationReplaceResponse.to_json())

# convert the object into a dict
push_notification_replace_response_dict = push_notification_replace_response_instance.to_dict()
# create an instance of PushNotificationReplaceResponse from a dict
push_notification_replace_response_from_dict = PushNotificationReplaceResponse.from_dict(push_notification_replace_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


6 changes: 6 additions & 0 deletions activitysmith_openapi/docs/PushNotificationResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ Apple APNs acceptance result. Acceptance does not confirm device delivery or pre
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **bool** | True when APNs accepts the notification for at least one targeted device. |
**notification_id** | **str** | ID of this Push Notification. Pass it to `PUT /push-notification/{notification_id}` to replace the notification later. | [optional]
**devices_notified** | **int** | Number of device tokens for which APNs accepted the notification, without confirming on-device delivery. | [optional]
**users_notified** | **int** | | [optional]
**effective_channel_slugs** | **List[str]** | | [optional]
**tags** | **List[str]** | Optional tags to organize and filter notification history. | [optional]
**timestamp** | **datetime** | |
**devices_targeted** | **int** | Number of device tokens targeted. | [optional]
**devices_deactivated** | **int** | Number of device tokens deactivated because APNs reported them unregistered. | [optional]
**devices_unregistered** | **int** | Number of targeted device tokens APNs reported as unregistered. | [optional]
**credential_test** | **bool** | True when the request was an integration connection test and no paired devices were available. | [optional]
**message** | **str** | | [optional]

## Example

Expand Down
91 changes: 90 additions & 1 deletion activitysmith_openapi/docs/PushNotificationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,104 @@ All URIs are relative to *https://activitysmith.com/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**replace_push_notification**](PushNotificationsApi.md#replace_push_notification) | **PUT** /push-notification/{notification_id} | Replace a push notification
[**send_push_notification**](PushNotificationsApi.md#send_push_notification) | **POST** /push-notification | Send a push notification


# **replace_push_notification**
> PushNotificationReplaceResponse replace_push_notification(notification_id, push_notification_replace_request)

Replace a push notification

Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place.

### Example

* Bearer (API Key) Authentication (apiKeyAuth):

```python
import activitysmith_openapi
from activitysmith_openapi.models.push_notification_replace_request import PushNotificationReplaceRequest
from activitysmith_openapi.models.push_notification_replace_response import PushNotificationReplaceResponse
from activitysmith_openapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://activitysmith.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = activitysmith_openapi.Configuration(
host = "https://activitysmith.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (API Key): apiKeyAuth
configuration = activitysmith_openapi.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with activitysmith_openapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = activitysmith_openapi.PushNotificationsApi(api_client)
notification_id = 'notification_id_example' # str | The `notification_id` returned when the Push Notification was sent.
push_notification_replace_request = {"title":"✅ checkout-api recovered","message":"Error rate is back to normal. Incident resolved."} # PushNotificationReplaceRequest |

try:
# Replace a push notification
api_response = api_instance.replace_push_notification(notification_id, push_notification_replace_request)
print("The response of PushNotificationsApi->replace_push_notification:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PushNotificationsApi->replace_push_notification: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**notification_id** | **str**| The `notification_id` returned when the Push Notification was sent. |
**push_notification_replace_request** | [**PushNotificationReplaceRequest**](PushNotificationReplaceRequest.md)| |

### Return type

[**PushNotificationReplaceResponse**](PushNotificationReplaceResponse.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Push notification replaced | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> |
**400** | Bad request (invalid payload or channel targeting input) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> |
**402** | Billing access required | - |
**403** | Forbidden (API key scope or channel assignment violation) | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> |
**404** | Push notification not found | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> |
**409** | Push notification was sent before replacement support | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> |
**422** | No recipients of the original Push Notification are still available | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> |
**429** | Rate limit exceeded | * RateLimit - Current request quotas using IETF draft-8 structured fields. Each named policy includes r (remaining requests) and t (seconds until reset). Multiple policies may apply. <br> * RateLimit-Policy - Each named policy includes q (request quota) and w (window in seconds). Each feature has an independent IP limit of 600 requests per 60 seconds. Independent account limits per 60 seconds are: Push Notifications 60, badges 60, Live Activities 300, and metric updates 300. <br> * Retry-After - Seconds to wait before retrying after a request-rate 429. Live Activity capacity errors are separate and require freeing device capacity; they do not provide a timed retry guarantee. <br> |

[[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)

# **send_push_notification**
> PushNotificationResponse send_push_notification(push_notification_request)

Send a push notification

Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.

### Example

Expand Down
Loading
Loading