Skip to main content Link Menu Expand (external link) Document Search Copy Copied

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

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/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/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/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/alerts"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

{
  "id" : "01ba892f-a48e-4f0e-a445-c2118be67c1b",
  "created" : "2024-02-07T06:44:14.529213801",
  "lastModified" : "2024-02-07T06:44:14.529214201",
  "_links" : {
    "create alert" : {
      "href" : "https://catalog.matatika.com/api/datasets/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/alerts/01ba892f-a48e-4f0e-a445-c2118be67c1b"
    }
  }
}

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/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/alerts/01ba892f-a48e-4f0e-a445-c2118be67c1b' -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/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/alerts/01ba892f-a48e-4f0e-a445-c2118be67c1b"

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" : "01ba892f-a48e-4f0e-a445-c2118be67c1b",
  "created" : "2024-02-07T06:44:14.684409579",
  "lastModified" : "2024-02-07T06:44:14.684410179",
  "raised" : "2024-02-07T06:44:14.684409579",
  "detail" : "New dataset alert",
  "_links" : {
    "dataset" : {
      "href" : "https://catalog.matatika.com/api/datasets/8a52961d-765d-4b64-9a3e-ee0dfe3bb224"
    }
  }
}

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/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/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/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/alerts"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

{
  "_embedded" : {
    "alerts" : [ {
      "id" : "01ba892f-a48e-4f0e-a445-c2118be67c1b",
      "created" : "2024-02-07T06:44:14.68441",
      "lastModified" : "2024-02-07T06:44:14.68441",
      "raised" : "2024-02-07T06:44:14.68441",
      "detail" : "New dataset alert",
      "_links" : {
        "dataset" : {
          "href" : "https://catalog.matatika.com/api/datasets/8a52961d-765d-4b64-9a3e-ee0dfe3bb224"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/datasets/8a52961d-765d-4b64-9a3e-ee0dfe3bb224/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/01ba892f-a48e-4f0e-a445-c2118be67c1b' -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/01ba892f-a48e-4f0e-a445-c2118be67c1b"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

{
  "id" : "01ba892f-a48e-4f0e-a445-c2118be67c1b",
  "created" : "2024-02-07T06:44:14.68441",
  "lastModified" : "2024-02-07T06:44:14.68441",
  "raised" : "2024-02-07T06:44:14.68441",
  "detail" : "New dataset alert",
  "_links" : {
    "dataset" : {
      "href" : "https://catalog.matatika.com/api/datasets/8a52961d-765d-4b64-9a3e-ee0dfe3bb224"
    }
  }
}