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

Subscriptions

Subscriptions are a declaration of interest in a particular resource, allowing a user to receive notifications when certain events occur. The events that trigger notifications are controlled by the type of subscription.


Objects

Subscription

Path Type Format Description
id String Version 4 UUID The subscription ID
created String ISO 8601 timestamp The instant the subscription was created at
lastModified String ISO 8601 timestamp The instant the subscription was last modified at
type String Subscription Type The type of subscription
{
  "id" : "192962ec-7b14-47e1-92c6-be304b33e4ba",
  "created" : "2024-04-10T14:08:57.954625",
  "lastModified" : "2024-04-10T14:08:57.954625",
  "type" : "ALL",
  "_embedded" : {
    "channel" : {
      "name" : "matatika-limited",
      "description" : "Matatika Limited",
      "picture" : "https://cdn.auth0.com/avatars/ml.png?ssl=1"
    },
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491"
    }
  }
}

Formats

Subscription Type

String

Value Description
ALL Triggers notifications for all resource events
ALERTS Triggers notifications for resource alert events only
NONE Does not trigger any notifications

Requests


View all subscriptions

GET

/api/subscriptions

Returns all subscriptions for the authenticated user profile.

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/subscriptions' -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/subscriptions"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription collection with HAL links.

{
  "_embedded" : {
    "subscriptions" : [ {
      "id" : "cfe61764-0a22-4070-95e1-6870797e9abf",
      "created" : "2024-04-10T14:09:05.16511",
      "lastModified" : "2024-04-10T14:09:05.16511",
      "type" : "ALL",
      "_embedded" : {
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@sit+prod"
        },
        "pipeline" : {
          "id" : "dd9f7d8e-6e95-4e29-a356-02382dc8275a",
          "name" : "SIT-generated pipeline",
          "lastModified" : "2024-04-10T14:08:59.913302"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/cfe61764-0a22-4070-95e1-6870797e9abf"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/cfe61764-0a22-4070-95e1-6870797e9abf",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/cfe61764-0a22-4070-95e1-6870797e9abf",
          "type" : "PUT"
        },
        "pipeline" : {
          "href" : "https://catalog.matatika.com/api/pipelines/dd9f7d8e-6e95-4e29-a356-02382dc8275a"
        }
      }
    }, {
      "id" : "192962ec-7b14-47e1-92c6-be304b33e4ba",
      "created" : "2024-04-10T14:08:57.954625",
      "lastModified" : "2024-04-10T14:08:58.285756",
      "type" : "ALERTS",
      "_embedded" : {
        "channel" : {
          "name" : "matatika-limited",
          "description" : "Matatika Limited",
          "picture" : "https://cdn.auth0.com/avatars/ml.png?ssl=1"
        },
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@sit+prod"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
          "type" : "PUT"
        },
        "channel" : {
          "href" : "https://catalog.matatika.com/api/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491"
        }
      }
    }, {
      "id" : "8638c02d-9313-4b39-be1a-6bc0e1eec03f",
      "created" : "2024-04-10T14:08:59.061944",
      "lastModified" : "2024-04-10T14:08:59.061944",
      "type" : "ALL",
      "_embedded" : {
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@sit+prod"
        },
        "dataset" : {
          "id" : "e31c9cf7-5d81-4807-b1a5-0407e72d040a",
          "published" : "2024-04-10T14:08:57.213249",
          "alias" : "simple-bar-chart",
          "workspaceId" : "bc81388a-26c9-4491-a732-2b8dff0aa621",
          "source" : "matatika-limited",
          "title" : "How many people have visited our website?",
          "description" : "# Some Markdown\n- point 1\n- point 2\n- point 3\n",
          "questions" : "[''This is my question'', ''this is second question'']",
          "visualisation" : "{\"google-chart\": {\"chartType\": \"BarChart\",\"options\": {\"title\": \"Website visitors\"}}}",
          "query" : "SELECT to_char(date(report_date),'YYYYMM') as year_month, SUM(sessions) \n   FROM\n     \"google_analytics_website_overview\"\n   WHERE\n     \"google_analytics_website_overview\".\"report_date\" >= DATE(NOW()) - INTERVAL '365 DAY'\n   GROUP BY year_month\n   ORDER BY year_month ASC;",
          "likeCount" : 0,
          "likedByProfiles" : [ ],
          "commentCount" : 0,
          "viewCount" : 0,
          "created" : "2024-04-10T14:08:57.213249",
          "score" : 1.0
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/8638c02d-9313-4b39-be1a-6bc0e1eec03f"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/8638c02d-9313-4b39-be1a-6bc0e1eec03f",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/8638c02d-9313-4b39-be1a-6bc0e1eec03f",
          "type" : "PUT"
        },
        "dataset" : {
          "href" : "https://catalog.matatika.com/api/datasets/e31c9cf7-5d81-4807-b1a5-0407e72d040a"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 3,
    "totalPages" : 1,
    "number" : 0
  }
}

View all member subscriptions to a workspace

GET

/api/workspaces/{workspace-id}/members/subscriptions

Returns all member subscriptions to the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621/members/subscriptions' -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/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621/members/subscriptions"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription collection with HAL links.

{
  "_embedded" : {
    "subscriptions" : [ {
      "id" : "70ac50bf-2fce-4e94-87aa-c3085f3b7158",
      "created" : "2024-04-10T14:09:05.485129",
      "lastModified" : "2024-04-10T14:09:05.485129",
      "type" : "ALL",
      "_embedded" : {
        "subscriberWorkspace" : {
          "id" : "bc81388a-26c9-4491-a732-2b8dff0aa621",
          "name" : "Test Workspace [2024-04-10T14:08:56.815894892]"
        },
        "workspace" : {
          "id" : "bc81388a-26c9-4491-a732-2b8dff0aa621",
          "name" : "Test Workspace [2024-04-10T14:08:56.815894892]"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/70ac50bf-2fce-4e94-87aa-c3085f3b7158"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/70ac50bf-2fce-4e94-87aa-c3085f3b7158",
          "type" : "PUT"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/70ac50bf-2fce-4e94-87aa-c3085f3b7158",
          "type" : "DELETE"
        },
        "workspace" : {
          "href" : "https://catalog.matatika.com/api/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621/members/subscriptions?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

View a subscription

GET

/api/subscriptions/{subscription-id}

Returns the subscription {subscription-id}.

Prerequisites

  • Subscription {subscription-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba' -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/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "192962ec-7b14-47e1-92c6-be304b33e4ba",
  "created" : "2024-04-10T14:08:57.954625",
  "lastModified" : "2024-04-10T14:08:57.954625",
  "type" : "ALL",
  "_embedded" : {
    "channel" : {
      "name" : "matatika-limited",
      "description" : "Matatika Limited",
      "picture" : "https://cdn.auth0.com/avatars/ml.png?ssl=1"
    },
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491"
    }
  }
}

Subscribe to a workspace

POST

/api/workspaces/{workspace-id}/subscriptions

Subscribes the authenticated user profile to the workspace {workspace-id}.

By default, the subscription is configured for all workspace events (see Subscription Type for more information).

Prerequisites

  • Workspace {workspace-id} must exist

Request

Query Parameters

Parameter Required Format Default Value Description
allMembers No Boolean false Whether or not to subscribe the workspace to workspace events, in order to enable workspace-wide notifications for all members by default (applicable for the workspace owner only)

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621/subscriptions?allMembers=true' -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/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621/subscriptions?allMembers=true"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "70ac50bf-2fce-4e94-87aa-c3085f3b7158",
  "created" : "2024-04-10T14:09:05.485128539",
  "lastModified" : "2024-04-10T14:09:05.485128839",
  "type" : "ALL",
  "_embedded" : {
    "subscriberWorkspace" : {
      "id" : "bc81388a-26c9-4491-a732-2b8dff0aa621",
      "name" : "Test Workspace [2024-04-10T14:08:56.815894892]"
    },
    "workspace" : {
      "id" : "bc81388a-26c9-4491-a732-2b8dff0aa621",
      "name" : "Test Workspace [2024-04-10T14:08:56.815894892]"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/70ac50bf-2fce-4e94-87aa-c3085f3b7158"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/70ac50bf-2fce-4e94-87aa-c3085f3b7158",
      "type" : "PUT"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/70ac50bf-2fce-4e94-87aa-c3085f3b7158",
      "type" : "DELETE"
    },
    "workspace" : {
      "href" : "https://catalog.matatika.com/api/workspaces/bc81388a-26c9-4491-a732-2b8dff0aa621"
    }
  }
}

Subscribe to a channel

POST

/api/channels/{channel-id}/subscriptions

Subscribes the authenticated user profile to the channel {channel-id}.

By default, the subscription is configured for all channel events (see Subscription Type for more information).

Prerequisites

  • Channel {channel-id} must exist

Request

Query Parameters

Parameter Required Format Default Value Description
allMembers No Boolean false Whether or not to subscribe the workspace to channel events, enabling notifications for all members by default (applicable for the workspace owner only)

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491/subscriptions' -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/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491/subscriptions"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "192962ec-7b14-47e1-92c6-be304b33e4ba",
  "created" : "2024-04-10T14:08:57.954625111",
  "lastModified" : "2024-04-10T14:08:57.954625311",
  "type" : "ALL",
  "_embedded" : {
    "channel" : {
      "name" : "matatika-limited",
      "description" : "Matatika Limited",
      "picture" : "https://cdn.auth0.com/avatars/ml.png?ssl=1"
    },
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491"
    }
  }
}

Subscribe to a dataset

POST

/api/datasets/{dataset-id}/subscriptions

Subscribes the authenticated user profile to the dataset {dataset-id}.

By default, the subscription is configured for all dataset events (see Subscription Type for more information).

Prerequisites

  • Dataset {dataset-id} must exist

Request

Query Parameters

Parameter Required Format Default Value Description
allMembers No Boolean false Whether or not to subscribe the workspace to dataset events, enabling notifications for all members by default (applicable for the workspace owner only)

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/datasets/e31c9cf7-5d81-4807-b1a5-0407e72d040a/subscriptions' -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/e31c9cf7-5d81-4807-b1a5-0407e72d040a/subscriptions"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "8638c02d-9313-4b39-be1a-6bc0e1eec03f",
  "created" : "2024-04-10T14:08:59.061943582",
  "lastModified" : "2024-04-10T14:08:59.061943882",
  "type" : "ALL",
  "_embedded" : {
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    },
    "dataset" : {
      "id" : "e31c9cf7-5d81-4807-b1a5-0407e72d040a",
      "published" : "2024-04-10T14:08:57.213249",
      "alias" : "simple-bar-chart",
      "workspaceId" : "bc81388a-26c9-4491-a732-2b8dff0aa621",
      "source" : "matatika-limited",
      "title" : "How many people have visited our website?",
      "description" : "# Some Markdown\n- point 1\n- point 2\n- point 3\n",
      "questions" : "[''This is my question'', ''this is second question'']",
      "visualisation" : "{\"google-chart\": {\"chartType\": \"BarChart\",\"options\": {\"title\": \"Website visitors\"}}}",
      "query" : "SELECT to_char(date(report_date),'YYYYMM') as year_month, SUM(sessions) \n   FROM\n     \"google_analytics_website_overview\"\n   WHERE\n     \"google_analytics_website_overview\".\"report_date\" >= DATE(NOW()) - INTERVAL '365 DAY'\n   GROUP BY year_month\n   ORDER BY year_month ASC;",
      "likeCount" : 0,
      "likedByProfiles" : [ ],
      "commentCount" : 0,
      "viewCount" : 0,
      "created" : "2024-04-10T14:08:57.213249",
      "score" : 1.0
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/8638c02d-9313-4b39-be1a-6bc0e1eec03f"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/8638c02d-9313-4b39-be1a-6bc0e1eec03f",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/8638c02d-9313-4b39-be1a-6bc0e1eec03f",
      "type" : "PUT"
    },
    "dataset" : {
      "href" : "https://catalog.matatika.com/api/datasets/e31c9cf7-5d81-4807-b1a5-0407e72d040a"
    }
  }
}

Subscribe to a pipeline

POST

/api/pipelines/{pipeline-id}/subscriptions

Subscribes the authenticated user profile to the pipeline {pipeline-id}.

By default, the subscription is configured for all pipeline events (see Subscription Type for more information).

Prerequisites

  • Pipeline {pipeline-id} must exist

Request

Query Parameters

Parameter Required Format Default Value Description
allMembers No Boolean false Whether or not to subscribe the workspace to pipeline events, enabling notifications for all members by default (applicable for the workspace owner only)

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/pipelines/dd9f7d8e-6e95-4e29-a356-02382dc8275a/subscriptions' -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/pipelines/dd9f7d8e-6e95-4e29-a356-02382dc8275a/subscriptions"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "cfe61764-0a22-4070-95e1-6870797e9abf",
  "created" : "2024-04-10T14:09:05.165110177",
  "lastModified" : "2024-04-10T14:09:05.165110377",
  "type" : "ALL",
  "_embedded" : {
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    },
    "pipeline" : {
      "id" : "dd9f7d8e-6e95-4e29-a356-02382dc8275a",
      "name" : "SIT-generated pipeline",
      "lastModified" : "2024-04-10T14:08:59.913302"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/cfe61764-0a22-4070-95e1-6870797e9abf"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/cfe61764-0a22-4070-95e1-6870797e9abf",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/cfe61764-0a22-4070-95e1-6870797e9abf",
      "type" : "PUT"
    },
    "pipeline" : {
      "href" : "https://catalog.matatika.com/api/pipelines/dd9f7d8e-6e95-4e29-a356-02382dc8275a"
    }
  }
}

Update a subscription

PUT

/api/subscriptions/{subscription-id}

Updates the subscription {subscription-id}.

Prerequisites

  • Subscription {subscription-id} must exist

Request

Body

Path Type Format Description
type String Subscription Type The type of subscription
{
  "type" : "ALERTS"
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/hal+json; charset=ISO-8859-1' \
    -d '{
  "type" : "ALERTS"
}'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"

data = {
  "type" : "ALERTS"
}
headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("PUT", url, headers=headers, data=data)

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "192962ec-7b14-47e1-92c6-be304b33e4ba",
  "created" : "2024-04-10T14:08:57.954625",
  "lastModified" : "2024-04-10T14:08:58.285756227",
  "type" : "ALERTS",
  "_embedded" : {
    "channel" : {
      "name" : "matatika-limited",
      "description" : "Matatika Limited",
      "picture" : "https://cdn.auth0.com/avatars/ml.png?ssl=1"
    },
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/ff37c78c-c246-4b50-84a6-c3fb6e1e4491"
    }
  }
}

Remove a subscription

DELETE

/api/subscriptions/{subscription-id}

Removes the subscription {subscription-id}.

Prerequisites

  • Subscription {subscription-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba' -i -X DELETE \
    -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/subscriptions/192962ec-7b14-47e1-92c6-be304b33e4ba"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

204 No Content

No response body provided.