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" : "2f1bf543-9360-46bf-b42e-ec6a446c926b",
  "created" : "2024-10-24T15:13:08.892253",
  "lastModified" : "2024-10-24T15:13:08.892254",
  "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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628"
    }
  }
}

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://app.matatika.com/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://app.matatika.com/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" : "2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "created" : "2024-10-24T15:13:08.892253",
      "lastModified" : "2024-10-24T15:13:09.252672",
      "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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"
        },
        "delete subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
          "type" : "PUT"
        },
        "channel" : {
          "href" : "https://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628"
        }
      }
    }, {
      "id" : "fa60599a-09b1-46e1-97ed-52544ffd67b0",
      "created" : "2024-10-24T15:13:09.924806",
      "lastModified" : "2024-10-24T15:13:09.924806",
      "type" : "ALL",
      "_embedded" : {
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@sit+prod"
        },
        "dataset" : {
          "id" : "85ec87c6-2655-4e85-8934-7a8c46e4b659",
          "published" : "2024-10-24T15:13:08.170733",
          "alias" : "simple-bar-chart",
          "workspaceId" : "92908f43-1872-4eb5-83a0-08a25224d64f",
          "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-10-24T15:13:08.170733",
          "score" : 1.0
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/subscriptions/fa60599a-09b1-46e1-97ed-52544ffd67b0"
        },
        "delete subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/fa60599a-09b1-46e1-97ed-52544ffd67b0",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/fa60599a-09b1-46e1-97ed-52544ffd67b0",
          "type" : "PUT"
        },
        "dataset" : {
          "href" : "https://app.matatika.com/api/datasets/85ec87c6-2655-4e85-8934-7a8c46e4b659"
        }
      }
    }, {
      "id" : "1c64b207-7df0-4a26-87a0-fe60cf18334d",
      "created" : "2024-10-24T15:13:15.960331",
      "lastModified" : "2024-10-24T15:13:15.960332",
      "type" : "ALL",
      "_embedded" : {
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@sit+prod"
        },
        "pipeline" : {
          "id" : "92ae0d7e-9d13-4357-96ea-874db25f6cb1",
          "name" : "SIT-generated pipeline",
          "lastModified" : "2024-10-24T15:13:10.642527"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/subscriptions/1c64b207-7df0-4a26-87a0-fe60cf18334d"
        },
        "delete subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/1c64b207-7df0-4a26-87a0-fe60cf18334d",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/1c64b207-7df0-4a26-87a0-fe60cf18334d",
          "type" : "PUT"
        },
        "pipeline" : {
          "href" : "https://app.matatika.com/api/pipelines/92ae0d7e-9d13-4357-96ea-874db25f6cb1"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://app.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://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f/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://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f/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" : "feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5",
      "created" : "2024-10-24T15:13:16.301478",
      "lastModified" : "2024-10-24T15:13:16.301478",
      "type" : "ALL",
      "_embedded" : {
        "subscriberWorkspace" : {
          "id" : "92908f43-1872-4eb5-83a0-08a25224d64f",
          "name" : "Test Workspace [2024-10-24T15:13:07.743053022]"
        },
        "workspace" : {
          "id" : "92908f43-1872-4eb5-83a0-08a25224d64f",
          "name" : "Test Workspace [2024-10-24T15:13:07.743053022]"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/subscriptions/feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5"
        },
        "update subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5",
          "type" : "PUT"
        },
        "delete subscription" : {
          "href" : "https://app.matatika.com/api/subscriptions/feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5",
          "type" : "DELETE"
        },
        "workspace" : {
          "href" : "https://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f/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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "2f1bf543-9360-46bf-b42e-ec6a446c926b",
  "created" : "2024-10-24T15:13:08.892253",
  "lastModified" : "2024-10-24T15:13:08.892254",
  "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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628"
    }
  }
}

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://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f/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://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f/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" : "feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5",
  "created" : "2024-10-24T15:13:16.301477822",
  "lastModified" : "2024-10-24T15:13:16.301478122",
  "type" : "ALL",
  "_embedded" : {
    "subscriberWorkspace" : {
      "id" : "92908f43-1872-4eb5-83a0-08a25224d64f",
      "name" : "Test Workspace [2024-10-24T15:13:07.743053022]"
    },
    "workspace" : {
      "id" : "92908f43-1872-4eb5-83a0-08a25224d64f",
      "name" : "Test Workspace [2024-10-24T15:13:07.743053022]"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/subscriptions/feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5",
      "type" : "PUT"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/feaf50ac-fe6c-49f4-86e6-aced9e2a5bb5",
      "type" : "DELETE"
    },
    "workspace" : {
      "href" : "https://app.matatika.com/api/workspaces/92908f43-1872-4eb5-83a0-08a25224d64f"
    }
  }
}

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://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628/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://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628/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" : "2f1bf543-9360-46bf-b42e-ec6a446c926b",
  "created" : "2024-10-24T15:13:08.892253263",
  "lastModified" : "2024-10-24T15:13:08.892253863",
  "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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628"
    }
  }
}

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://app.matatika.com/api/datasets/85ec87c6-2655-4e85-8934-7a8c46e4b659/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://app.matatika.com/api/datasets/85ec87c6-2655-4e85-8934-7a8c46e4b659/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" : "fa60599a-09b1-46e1-97ed-52544ffd67b0",
  "created" : "2024-10-24T15:13:09.924805712",
  "lastModified" : "2024-10-24T15:13:09.924806112",
  "type" : "ALL",
  "_embedded" : {
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    },
    "dataset" : {
      "id" : "85ec87c6-2655-4e85-8934-7a8c46e4b659",
      "published" : "2024-10-24T15:13:08.170733",
      "alias" : "simple-bar-chart",
      "workspaceId" : "92908f43-1872-4eb5-83a0-08a25224d64f",
      "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-10-24T15:13:08.170733",
      "score" : 1.0
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/subscriptions/fa60599a-09b1-46e1-97ed-52544ffd67b0"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/fa60599a-09b1-46e1-97ed-52544ffd67b0",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/fa60599a-09b1-46e1-97ed-52544ffd67b0",
      "type" : "PUT"
    },
    "dataset" : {
      "href" : "https://app.matatika.com/api/datasets/85ec87c6-2655-4e85-8934-7a8c46e4b659"
    }
  }
}

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://app.matatika.com/api/pipelines/92ae0d7e-9d13-4357-96ea-874db25f6cb1/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://app.matatika.com/api/pipelines/92ae0d7e-9d13-4357-96ea-874db25f6cb1/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" : "1c64b207-7df0-4a26-87a0-fe60cf18334d",
  "created" : "2024-10-24T15:13:15.960331164",
  "lastModified" : "2024-10-24T15:13:15.960331564",
  "type" : "ALL",
  "_embedded" : {
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@sit+prod"
    },
    "pipeline" : {
      "id" : "92ae0d7e-9d13-4357-96ea-874db25f6cb1",
      "name" : "SIT-generated pipeline",
      "lastModified" : "2024-10-24T15:13:10.642527"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/subscriptions/1c64b207-7df0-4a26-87a0-fe60cf18334d"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/1c64b207-7df0-4a26-87a0-fe60cf18334d",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/1c64b207-7df0-4a26-87a0-fe60cf18334d",
      "type" : "PUT"
    },
    "pipeline" : {
      "href" : "https://app.matatika.com/api/pipelines/92ae0d7e-9d13-4357-96ea-874db25f6cb1"
    }
  }
}

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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b' -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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"

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" : "2f1bf543-9360-46bf-b42e-ec6a446c926b",
  "created" : "2024-10-24T15:13:08.892253",
  "lastModified" : "2024-10-24T15:13:09.252671682",
  "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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"
    },
    "delete subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://app.matatika.com/api/channels/63bbe16e-8ae3-4444-b7b5-ffd462da7628"
    }
  }
}

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://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b' -i -X DELETE \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://app.matatika.com/api/subscriptions/2f1bf543-9360-46bf-b42e-ec6a446c926b"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

204 No Content

No response body provided.