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" : "2513b9e2-edb6-4957-b2d6-368a300ca65b",
"created" : "2023-09-20T10:46:28.192287",
"lastModified" : "2023-09-20T10:46:28.192289",
"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" : "@support+integrationtests+a7o91bel"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "PUT"
},
"channel" : {
"href" : "https://catalog.matatika.com/api/channels/6a99666c-29be-4748-b3e9-2e3480aea138"
}
}
}
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
- View all member subscriptions to a workspace
- View a subscription
- Subscribe to a workspace
- Subscribe to a channel
- Subscribe to a dataset
- Subscribe to a pipeline
- Update a subscription
- Remove a subscription
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" : "2513b9e2-edb6-4957-b2d6-368a300ca65b",
"created" : "2023-09-20T10:46:28.192287",
"lastModified" : "2023-09-20T10:46:28.86226",
"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" : "@support+integrationtests+a7o91bel"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "PUT"
},
"channel" : {
"href" : "https://catalog.matatika.com/api/channels/6a99666c-29be-4748-b3e9-2e3480aea138"
}
}
}, {
"id" : "c73b6445-4448-4632-9f93-4a3776a06e11",
"created" : "2023-09-20T10:46:36.585058",
"lastModified" : "2023-09-20T10:46:36.585059",
"type" : "ALL",
"_embedded" : {
"subscriberProfile" : {
"id" : "auth0|5eb0327cbfd7490bff55feeb",
"name" : "[email protected]",
"handle" : "@support+integrationtests+a7o91bel"
},
"pipeline" : {
"id" : "da017e0e-5660-4291-b824-14c4486b163b",
"name" : "SIT-generated pipeline",
"lastModified" : "2023-09-20T10:46:31.169736"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/c73b6445-4448-4632-9f93-4a3776a06e11"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/c73b6445-4448-4632-9f93-4a3776a06e11",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/c73b6445-4448-4632-9f93-4a3776a06e11",
"type" : "PUT"
},
"pipeline" : {
"href" : "https://catalog.matatika.com/api/pipelines/da017e0e-5660-4291-b824-14c4486b163b"
}
}
}, {
"id" : "519913eb-2c15-4bba-b617-206cbad21916",
"created" : "2023-09-20T10:46:29.994072",
"lastModified" : "2023-09-20T10:46:29.994073",
"type" : "ALL",
"_embedded" : {
"subscriberProfile" : {
"id" : "auth0|5eb0327cbfd7490bff55feeb",
"name" : "[email protected]",
"handle" : "@support+integrationtests+a7o91bel"
},
"dataset" : {
"id" : "f17c2672-5b3d-4a2e-86b5-60e7d9a09e4d",
"published" : "2023-09-20T10:46:26.635167",
"alias" : "simple-bar-chart",
"workspaceId" : "7cc5d7b6-1b68-4fe6-a96e-424399949680",
"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" : "2023-09-20T10:46:26.635167",
"score" : 1.0
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/519913eb-2c15-4bba-b617-206cbad21916"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/519913eb-2c15-4bba-b617-206cbad21916",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/519913eb-2c15-4bba-b617-206cbad21916",
"type" : "PUT"
},
"dataset" : {
"href" : "https://catalog.matatika.com/api/datasets/f17c2672-5b3d-4a2e-86b5-60e7d9a09e4d"
}
}
} ]
},
"_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/7cc5d7b6-1b68-4fe6-a96e-424399949680/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/7cc5d7b6-1b68-4fe6-a96e-424399949680/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" : "613cd63a-24ca-43ff-8b70-a03bf4956221",
"created" : "2023-09-20T10:46:37.146075",
"lastModified" : "2023-09-20T10:46:37.146075",
"type" : "ALL",
"_embedded" : {
"subscriberWorkspace" : {
"id" : "7cc5d7b6-1b68-4fe6-a96e-424399949680",
"name" : "Test Workspace [2023-09-20T10:46:24.809851277]"
},
"workspace" : {
"id" : "7cc5d7b6-1b68-4fe6-a96e-424399949680",
"name" : "Test Workspace [2023-09-20T10:46:24.809851277]"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/613cd63a-24ca-43ff-8b70-a03bf4956221"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/613cd63a-24ca-43ff-8b70-a03bf4956221",
"type" : "PUT"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/613cd63a-24ca-43ff-8b70-a03bf4956221",
"type" : "DELETE"
},
"workspace" : {
"href" : "https://catalog.matatika.com/api/workspaces/7cc5d7b6-1b68-4fe6-a96e-424399949680"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/workspaces/7cc5d7b6-1b68-4fe6-a96e-424399949680/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/2513b9e2-edb6-4957-b2d6-368a300ca65b' -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/2513b9e2-edb6-4957-b2d6-368a300ca65b"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
Subscription with HAL links.
{
"id" : "2513b9e2-edb6-4957-b2d6-368a300ca65b",
"created" : "2023-09-20T10:46:28.192287",
"lastModified" : "2023-09-20T10:46:28.192289",
"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" : "@support+integrationtests+a7o91bel"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "PUT"
},
"channel" : {
"href" : "https://catalog.matatika.com/api/channels/6a99666c-29be-4748-b3e9-2e3480aea138"
}
}
}
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/7cc5d7b6-1b68-4fe6-a96e-424399949680/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/7cc5d7b6-1b68-4fe6-a96e-424399949680/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" : "613cd63a-24ca-43ff-8b70-a03bf4956221",
"created" : "2023-09-20T10:46:37.14607464",
"lastModified" : "2023-09-20T10:46:37.14607494",
"type" : "ALL",
"_embedded" : {
"subscriberWorkspace" : {
"id" : "7cc5d7b6-1b68-4fe6-a96e-424399949680",
"name" : "Test Workspace [2023-09-20T10:46:24.809851277]"
},
"workspace" : {
"id" : "7cc5d7b6-1b68-4fe6-a96e-424399949680",
"name" : "Test Workspace [2023-09-20T10:46:24.809851277]"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/613cd63a-24ca-43ff-8b70-a03bf4956221"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/613cd63a-24ca-43ff-8b70-a03bf4956221",
"type" : "PUT"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/613cd63a-24ca-43ff-8b70-a03bf4956221",
"type" : "DELETE"
},
"workspace" : {
"href" : "https://catalog.matatika.com/api/workspaces/7cc5d7b6-1b68-4fe6-a96e-424399949680"
}
}
}
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/6a99666c-29be-4748-b3e9-2e3480aea138/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/6a99666c-29be-4748-b3e9-2e3480aea138/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" : "2513b9e2-edb6-4957-b2d6-368a300ca65b",
"created" : "2023-09-20T10:46:28.192286872",
"lastModified" : "2023-09-20T10:46:28.192288572",
"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" : "@support+integrationtests+a7o91bel"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "PUT"
},
"channel" : {
"href" : "https://catalog.matatika.com/api/channels/6a99666c-29be-4748-b3e9-2e3480aea138"
}
}
}
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/f17c2672-5b3d-4a2e-86b5-60e7d9a09e4d/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/f17c2672-5b3d-4a2e-86b5-60e7d9a09e4d/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" : "519913eb-2c15-4bba-b617-206cbad21916",
"created" : "2023-09-20T10:46:29.994072221",
"lastModified" : "2023-09-20T10:46:29.994072521",
"type" : "ALL",
"_embedded" : {
"subscriberProfile" : {
"id" : "auth0|5eb0327cbfd7490bff55feeb",
"name" : "[email protected]",
"handle" : "@support+integrationtests+a7o91bel"
},
"dataset" : {
"id" : "f17c2672-5b3d-4a2e-86b5-60e7d9a09e4d",
"published" : "2023-09-20T10:46:26.635167",
"alias" : "simple-bar-chart",
"workspaceId" : "7cc5d7b6-1b68-4fe6-a96e-424399949680",
"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" : "2023-09-20T10:46:26.635167",
"score" : 1.0
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/519913eb-2c15-4bba-b617-206cbad21916"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/519913eb-2c15-4bba-b617-206cbad21916",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/519913eb-2c15-4bba-b617-206cbad21916",
"type" : "PUT"
},
"dataset" : {
"href" : "https://catalog.matatika.com/api/datasets/f17c2672-5b3d-4a2e-86b5-60e7d9a09e4d"
}
}
}
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/da017e0e-5660-4291-b824-14c4486b163b/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/da017e0e-5660-4291-b824-14c4486b163b/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" : "c73b6445-4448-4632-9f93-4a3776a06e11",
"created" : "2023-09-20T10:46:36.585058302",
"lastModified" : "2023-09-20T10:46:36.585058802",
"type" : "ALL",
"_embedded" : {
"subscriberProfile" : {
"id" : "auth0|5eb0327cbfd7490bff55feeb",
"name" : "[email protected]",
"handle" : "@support+integrationtests+a7o91bel"
},
"pipeline" : {
"id" : "da017e0e-5660-4291-b824-14c4486b163b",
"name" : "SIT-generated pipeline",
"lastModified" : "2023-09-20T10:46:31.169736"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/c73b6445-4448-4632-9f93-4a3776a06e11"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/c73b6445-4448-4632-9f93-4a3776a06e11",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/c73b6445-4448-4632-9f93-4a3776a06e11",
"type" : "PUT"
},
"pipeline" : {
"href" : "https://catalog.matatika.com/api/pipelines/da017e0e-5660-4291-b824-14c4486b163b"
}
}
}
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/2513b9e2-edb6-4957-b2d6-368a300ca65b' -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/2513b9e2-edb6-4957-b2d6-368a300ca65b"
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" : "2513b9e2-edb6-4957-b2d6-368a300ca65b",
"created" : "2023-09-20T10:46:28.192287",
"lastModified" : "2023-09-20T10:46:28.86226023",
"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" : "@support+integrationtests+a7o91bel"
}
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b"
},
"delete subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "DELETE"
},
"update subscription" : {
"href" : "https://catalog.matatika.com/api/subscriptions/2513b9e2-edb6-4957-b2d6-368a300ca65b",
"type" : "PUT"
},
"channel" : {
"href" : "https://catalog.matatika.com/api/channels/6a99666c-29be-4748-b3e9-2e3480aea138"
}
}
}
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/2513b9e2-edb6-4957-b2d6-368a300ca65b' -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/2513b9e2-edb6-4957-b2d6-368a300ca65b"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("DELETE", url, headers=headers)
print(response.text.encode('utf8'))
Response
204 No Content
No response body provided.