list_notifications¶
- UsersApi.list_notifications(role_id=None, resource_type=None, resource_id=None, notification_enabled_only=None, limit=None, offset=None, sortorder=None, sortby=None, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
List notification preferences
Lists the caller’s preferences for one resource type, or custom alert emails when resource_type is custom-alert-emails (requires system-settings.view).
- Parameters:
role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Required for custom-alert-emails. Also recorded in audit logs.
resource_type (str) – Resource kind to list. Defaults to Datasets. Allowed: Datasets, Jobs, Dashboards, Schedules, DataPipelines, Datasources, DatasourceFlows, Datalabs, CodeRepositories, Agents, Glossaries. Use custom-alert-emails for the paginated custom-email list. Unknown values return IPV-1005 except custom-alert-emails.
resource_id (str) – Limit to one resource. Ignored for custom-alert-emails. Unknown or inaccessible id returns IPV-1002.
notification_enabled_only (str) – true (any case) returns only resources with saved preferences. Any other value, or omit, is false. Ignored for custom-alert-emails.
limit (str) – Page size as a string. Default list slices Resources (no default, no max). custom-alert-emails defaults to 100 and rejects values above 1000 (GE-1028).
offset (str) – Item offset as a string. Default list is 0-based (default 0) and slices Resources; last page is fewer items than limit. custom-alert-emails is 1-based (default 1) and uses next_available yes/no.
sortorder (str) – Sort direction for custom-alert-emails only. Default desc. Any other value sorts ascending. Ignored for the default list.
sortby (str) – Sort field for custom-alert-emails only. Default EmailId. Ignored for the default list.
projection_expression (str) – Read for custom-alert-emails but not applied to the response. Ignored for the default list.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /notifications
Success (HTTP 200)¶
Default list returns notifications (ResourceType groups). custom-alert-emails returns CustomAlertEmails with next_available, count, and total_count.
Dataset preferences
{
"notifications": [
{
"ResourceType": "Datasets",
"ResourceSortKey": "ResourceDomain",
"Resources": [
{
"ResourceId": "dataset-a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a",
"ResourceName": "sales_data",
"ResourceDomain": "finance",
"Email": {
"Update": true,
"Delete": false,
"AuthUpdate": false
},
"Push": {
"Update": false,
"Delete": false,
"AuthUpdate": false
}
}
]
}
]
}
Custom alert emails
{
"CustomAlertEmails": [
{
"EmailId": "alerts@example.com",
"Resources": [
{
"ResourceId": "dataset-a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a",
"ResourceType": "Datasets",
"ResourceName": "sales_data"
}
]
}
],
"next_available": "no",
"count": 1,
"total_count": 1
}
Errors¶
Documented error codes: IPV-1005, IPV-1002, DTSC-1024, GE-1028, AUTH-1001, AUTH-1003, AUTH-1030, GE-1008.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1005 (unknown resource_type), IPV-1002 (unknown or inaccessible resource_id), DTSC-1024 (unsupported datasource type), GE-1028 (custom-alert-emails limit over 1000), AUTH-1001, AUTH-1003, AUTH-1030, IPV-1002 (role_id) for custom-alert-emails.
resource_type is not supported
{
"Message": "IPV-1005 - Invalid ResourceType - Widgets, must be one of ['Datasets', 'Jobs', 'Dashboards', 'Schedules', 'DataPipelines', 'Datasources', 'DatasourceFlows', 'Datalabs', 'CodeRepositories', 'Agents', 'Glossaries']."
}
resource_id missing or no access
{
"Message": "IPV-1002 - Invalid dataset - dataset-missing, resource not found."
}
custom-alert-emails limit over 1000
{
"Message": "GE-1028 - Out of range for items per page, Limit is 1000"
}
Caller lacks system-settings.view
{
"Message": "AUTH-1030 - User is not authorized to retrieve custom emails added in application due to the following missing permission(s) - {'System Settings': ['view']}"
}
HTTP 500
Uncaught errors return {“Message”: “<str(ex)>”} with no GE-1008 wrap. Non-integer limit or offset is a ValueError.
Uncaught handler failure
{
"Message": "invalid literal for int() with base 10: 'abc'"
}