notification_subscriptions
Creates, updates, deletes, gets or lists a notification_subscriptions resource.
Overview
| Name | notification_subscriptions |
| Type | Resource |
| Id | pagerduty.users.notification_subscriptions |
Fields
The following fields are returned by SELECT queries:
- get_user_notification_subscriptions
| Name | Datatype | Description |
|---|---|---|
subscribable_name | string | The name of the subscribable |
subscription | object | An object describing the relationship of a NotificationSubscriber and a NotificationSubscribable. (title: NotificationSubscription) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_user_notification_subscriptions | select | id | Accept | Retrieve a list of Notification Subscriptions the given User has. <!-- theme: warning --> > Users must be added through POST /users/{id}/notification_subscriptions to be returned from this endpoint.Scoped OAuth requires: subscribers.read |
create_user_notification_subscriptions | insert | id, data__subscribables | Accept | Create new Notification Subscriptions for the given User. Scoped OAuth requires: subscribers.write |
_get_user_notification_subscriptions | exec | id | Accept | Retrieve a list of Notification Subscriptions the given User has. <!-- theme: warning --> > Users must be added through POST /users/{id}/notification_subscriptions to be returned from this endpoint.Scoped OAuth requires: subscribers.read |
unsubscribe_user_notification_subscriptions | exec | id, subscribables | Accept | Unsubscribe the given User from Notifications on the matching Subscribable entities. Scoped OAuth requires: subscribers.write |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the resource. |
Accept | string | The Accept header is used as a versioning header. |
SELECT examples
- get_user_notification_subscriptions
Retrieve a list of Notification Subscriptions the given User has.
<!-- theme: warning -->
> Users must be added through POST /users/{id}/notification_subscriptions to be returned from this endpoint.
Scoped OAuth requires: subscribers.read
SELECT
subscribable_name,
subscription
FROM pagerduty.users.notification_subscriptions
WHERE id = '{{ id }}' -- required
AND Accept = '{{ Accept }}'
;
INSERT examples
- create_user_notification_subscriptions
- Manifest
Create new Notification Subscriptions for the given User.
Scoped OAuth requires: subscribers.write
INSERT INTO pagerduty.users.notification_subscriptions (
data__subscribables,
id,
Accept
)
SELECT
'{{ subscribables }}' /* required */,
'{{ id }}',
'{{ Accept }}'
RETURNING
subscriptions
;
# Description fields are for documentation purposes
- name: notification_subscriptions
props:
- name: id
value: string
description: Required parameter for the notification_subscriptions resource.
- name: subscribables
value: array
- name: Accept
value: string
description: The `Accept` header is used as a versioning header.
Lifecycle Methods
- _get_user_notification_subscriptions
- unsubscribe_user_notification_subscriptions
Retrieve a list of Notification Subscriptions the given User has.
<!-- theme: warning -->
> Users must be added through POST /users/{id}/notification_subscriptions to be returned from this endpoint.
Scoped OAuth requires: subscribers.read
EXEC pagerduty.users.notification_subscriptions._get_user_notification_subscriptions
@id='{{ id }}' --required,
@Accept='{{ Accept }}'
;
Unsubscribe the given User from Notifications on the matching Subscribable entities.
Scoped OAuth requires: subscribers.write
EXEC pagerduty.users.notification_subscriptions.unsubscribe_user_notification_subscriptions
@id='{{ id }}' --required,
@Accept='{{ Accept }}'
@@json=
'{
"subscribables": "{{ subscribables }}"
}'
;