Notification Channels
Model
- class pytm4srv.models.notifications.NotifyChannel
Endpoints
- GET /api/options/notify_channels/
Get a list of registered notification channels.
- Returns:
a JSON object mapping channel ID to channel data object
- POST /api/options/notify_channels/
Register a new notification channel.
- Request JSON Object:
name (string) – name for the new channel
url (string) – webhook URL for the new channel
- Returns:
the new channel object
- Status Codes:
400 Bad Request – if the name and/or url are missing
201 Created – on success
- PATCH /api/options/notify_channels/(int: channel_id)
Edit an existing notification channel.
- Parameters:
channel_id – The ID of the channel to modify
- Request JSON Object:
name (string) – new name for the channel (unchanged if omitted)
URL (string) – new URL for the channel (unchanged if omitted)
- Returns:
the modified channel object
- Status Codes:
404 Not Found – if the channel does not exist
- DELETE /api/options/notify_channels/(int: channel_id)
Deregister a notification channel.
- Parameters:
channel_id – The ID of the channel to delete
- Status Codes:
204 No Content – on success
404 Not Found – if the channel does not exist
- POST /api/options/notify_channels/(int: channel_id)/test
Send a test message.
- Parameters:
channel_id – ID of the channel to send a test message to
- Status Codes:
204 No Content – on success
404 Not Found – if the channel does not exist
412 Precondition Failed – if the message failed to send for an unknown reason
424 Failed Dependency – if the request was rejected by the channel’s service