Alerts
Alerts can be created by users on datasets. These alerts can then be used to inform users of information related to that dataset.
Requests
- Initialise an alert on a dataset
- Create an alert on a dataset
- View alerts on a dataset
- View an alert
Initialise an alert on a dataset
POST
datasets/{dataset-id}/alerts
Initialises a new alert on a dataset.
Prerequisites
- The authenticated user must own a Matatika account
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://catalog.matatika.com:443/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("POST", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
{
"id" : "e3590d23-9d3a-4d58-b9d6-e5898f60bbe9",
"created" : "2024-05-11T08:49:23.098232807",
"lastModified" : "2024-05-11T08:49:23.098235007",
"_links" : {
"create alert" : {
"href" : "https://catalog.matatika.com/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts/e3590d23-9d3a-4d58-b9d6-e5898f60bbe9"
}
}
}
Create an alert on a dataset
PUT
datasets/{dataset-id}/alerts/{alert-id}
Create a new alert on a dataset.
Prerequisites
- The authenticated user must own a Matatika account
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts/e3590d23-9d3a-4d58-b9d6-e5898f60bbe9' -i -X PUT \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json' \
-d '{
"detail" : "New dataset alert"
}'
Python (requests
)
import requests
url = "https://catalog.matatika.com:443/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts/e3590d23-9d3a-4d58-b9d6-e5898f60bbe9"
data = {
"detail" : "New dataset alert"
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
201 Created
{
"id" : "e3590d23-9d3a-4d58-b9d6-e5898f60bbe9",
"created" : "2024-05-11T08:49:23.274723064",
"lastModified" : "2024-05-11T08:49:23.274723464",
"raised" : "2024-05-11T08:49:23.274723064",
"detail" : "New dataset alert",
"_links" : {
"dataset" : {
"href" : "https://catalog.matatika.com/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f"
}
}
}
View alerts on a dataset
GET
datasets/{dataset-id}/alerts
View alerts on a dataset.
Prerequisites
- The authenticated user must own a Matatika account
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts' -i -X GET \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://catalog.matatika.com:443/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
{
"_embedded" : {
"alerts" : [ {
"id" : "e3590d23-9d3a-4d58-b9d6-e5898f60bbe9",
"created" : "2024-05-11T08:49:23.274723",
"lastModified" : "2024-05-11T08:49:23.274723",
"raised" : "2024-05-11T08:49:23.274723",
"detail" : "New dataset alert",
"_links" : {
"dataset" : {
"href" : "https://catalog.matatika.com/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f/alerts?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}
View an alert
GET
alerts/{alert-id}
View an alert.
Prerequisites
- The authenticated user must own a Matatika account
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/alerts/e3590d23-9d3a-4d58-b9d6-e5898f60bbe9' -i -X GET \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://catalog.matatika.com:443/api/alerts/e3590d23-9d3a-4d58-b9d6-e5898f60bbe9"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
{
"id" : "e3590d23-9d3a-4d58-b9d6-e5898f60bbe9",
"created" : "2024-05-11T08:49:23.274723",
"lastModified" : "2024-05-11T08:49:23.274723",
"raised" : "2024-05-11T08:49:23.274723",
"detail" : "New dataset alert",
"_links" : {
"dataset" : {
"href" : "https://catalog.matatika.com/api/datasets/c0d08903-bf83-47e7-9f3e-15e6cfab498f"
}
}
}