Link Search Menu Expand Document

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" : "f6ab6169-9eaa-407b-8f49-44fc1c32245c",
  "created" : "2022-11-04T15:28:35.620212",
  "lastModified" : "2022-11-04T15:28:35.620212",
  "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/f6ab6169-9eaa-407b-8f49-44fc1c32245c"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a"
    }
  }
}

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/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/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" : "a62e5efe-02b9-49ee-92fd-d6aaa59c3e64",
      "created" : "2022-11-04T15:28:36.740468",
      "lastModified" : "2022-11-04T15:28:36.740468",
      "type" : "ALL",
      "_embedded" : {
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@support+integrationtests+a7o91bel"
        },
        "dataset" : {
          "id" : "0fe4c66e-c8d2-4e75-8ab3-8bc26bcae0f6",
          "published" : "2022-11-04T15:28:34.722426",
          "alias" : "simple-bar-chart",
          "workspaceId" : "ea27aea0-c2b4-418e-82ee-570637a14f16",
          "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" : "2022-11-04T15:28:34.722426",
          "score" : 1.0
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/a62e5efe-02b9-49ee-92fd-d6aaa59c3e64"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/a62e5efe-02b9-49ee-92fd-d6aaa59c3e64",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/a62e5efe-02b9-49ee-92fd-d6aaa59c3e64",
          "type" : "PUT"
        },
        "dataset" : {
          "href" : "https://catalog.matatika.com/api/datasets/0fe4c66e-c8d2-4e75-8ab3-8bc26bcae0f6"
        }
      }
    }, {
      "id" : "f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "created" : "2022-11-04T15:28:35.620212",
      "lastModified" : "2022-11-04T15:28:36.091123",
      "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/f6ab6169-9eaa-407b-8f49-44fc1c32245c"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
          "type" : "PUT"
        },
        "channel" : {
          "href" : "https://catalog.matatika.com/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a"
        }
      }
    }, {
      "id" : "c9e45a1b-c744-45b4-82dd-631d8a2717ff",
      "created" : "2022-11-04T15:28:42.463349",
      "lastModified" : "2022-11-04T15:28:42.463349",
      "type" : "ALL",
      "_embedded" : {
        "subscriberProfile" : {
          "id" : "auth0|5eb0327cbfd7490bff55feeb",
          "name" : "[email protected]",
          "handle" : "@support+integrationtests+a7o91bel"
        },
        "pipeline" : {
          "id" : "8f7a8390-4c62-4f33-8d78-5d4d882507f6",
          "name" : "SIT-generated pipeline",
          "lastModified" : "2022-11-04T15:28:37.158621"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/c9e45a1b-c744-45b4-82dd-631d8a2717ff"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/c9e45a1b-c744-45b4-82dd-631d8a2717ff",
          "type" : "DELETE"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/c9e45a1b-c744-45b4-82dd-631d8a2717ff",
          "type" : "PUT"
        },
        "pipeline" : {
          "href" : "https://catalog.matatika.com/api/pipelines/8f7a8390-4c62-4f33-8d78-5d4d882507f6"
        }
      }
    } ]
  },
  "_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/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16/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/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16/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" : "6e8647e4-499c-4c55-8c8a-e7647239b096",
      "created" : "2022-11-04T15:28:42.783767",
      "lastModified" : "2022-11-04T15:28:42.783767",
      "type" : "ALL",
      "_embedded" : {
        "subscriberWorkspace" : {
          "id" : "ea27aea0-c2b4-418e-82ee-570637a14f16",
          "name" : "Test Workspace [2022-11-04T15:28:31.660310258]"
        },
        "workspace" : {
          "id" : "ea27aea0-c2b4-418e-82ee-570637a14f16",
          "name" : "Test Workspace [2022-11-04T15:28:31.660310258]"
        }
      },
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/6e8647e4-499c-4c55-8c8a-e7647239b096"
        },
        "update subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/6e8647e4-499c-4c55-8c8a-e7647239b096",
          "type" : "PUT"
        },
        "delete subscription" : {
          "href" : "https://catalog.matatika.com/api/subscriptions/6e8647e4-499c-4c55-8c8a-e7647239b096",
          "type" : "DELETE"
        },
        "workspace" : {
          "href" : "https://catalog.matatika.com/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16/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/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c' -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/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

200 OK

Subscription with HAL links.

{
  "id" : "f6ab6169-9eaa-407b-8f49-44fc1c32245c",
  "created" : "2022-11-04T15:28:35.620212",
  "lastModified" : "2022-11-04T15:28:35.620212",
  "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/f6ab6169-9eaa-407b-8f49-44fc1c32245c"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a"
    }
  }
}

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/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16/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/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16/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" : "6e8647e4-499c-4c55-8c8a-e7647239b096",
  "created" : "2022-11-04T15:28:42.783766881",
  "lastModified" : "2022-11-04T15:28:42.783767181",
  "type" : "ALL",
  "_embedded" : {
    "subscriberWorkspace" : {
      "id" : "ea27aea0-c2b4-418e-82ee-570637a14f16",
      "name" : "Test Workspace [2022-11-04T15:28:31.660310258]"
    },
    "workspace" : {
      "id" : "ea27aea0-c2b4-418e-82ee-570637a14f16",
      "name" : "Test Workspace [2022-11-04T15:28:31.660310258]"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/6e8647e4-499c-4c55-8c8a-e7647239b096"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/6e8647e4-499c-4c55-8c8a-e7647239b096",
      "type" : "PUT"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/6e8647e4-499c-4c55-8c8a-e7647239b096",
      "type" : "DELETE"
    },
    "workspace" : {
      "href" : "https://catalog.matatika.com/api/workspaces/ea27aea0-c2b4-418e-82ee-570637a14f16"
    }
  }
}

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/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a/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/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a/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" : "f6ab6169-9eaa-407b-8f49-44fc1c32245c",
  "created" : "2022-11-04T15:28:35.620211808",
  "lastModified" : "2022-11-04T15:28:35.620212108",
  "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/f6ab6169-9eaa-407b-8f49-44fc1c32245c"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a"
    }
  }
}

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/api/datasets/0fe4c66e-c8d2-4e75-8ab3-8bc26bcae0f6/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/api/datasets/0fe4c66e-c8d2-4e75-8ab3-8bc26bcae0f6/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" : "a62e5efe-02b9-49ee-92fd-d6aaa59c3e64",
  "created" : "2022-11-04T15:28:36.740468077",
  "lastModified" : "2022-11-04T15:28:36.740468477",
  "type" : "ALL",
  "_embedded" : {
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@support+integrationtests+a7o91bel"
    },
    "dataset" : {
      "id" : "0fe4c66e-c8d2-4e75-8ab3-8bc26bcae0f6",
      "published" : "2022-11-04T15:28:34.722426",
      "alias" : "simple-bar-chart",
      "workspaceId" : "ea27aea0-c2b4-418e-82ee-570637a14f16",
      "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" : "2022-11-04T15:28:34.722426",
      "score" : 1.0
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/a62e5efe-02b9-49ee-92fd-d6aaa59c3e64"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/a62e5efe-02b9-49ee-92fd-d6aaa59c3e64",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/a62e5efe-02b9-49ee-92fd-d6aaa59c3e64",
      "type" : "PUT"
    },
    "dataset" : {
      "href" : "https://catalog.matatika.com/api/datasets/0fe4c66e-c8d2-4e75-8ab3-8bc26bcae0f6"
    }
  }
}

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/api/pipelines/8f7a8390-4c62-4f33-8d78-5d4d882507f6/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/api/pipelines/8f7a8390-4c62-4f33-8d78-5d4d882507f6/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" : "c9e45a1b-c744-45b4-82dd-631d8a2717ff",
  "created" : "2022-11-04T15:28:42.463348791",
  "lastModified" : "2022-11-04T15:28:42.463349191",
  "type" : "ALL",
  "_embedded" : {
    "subscriberProfile" : {
      "id" : "auth0|5eb0327cbfd7490bff55feeb",
      "name" : "[email protected]",
      "handle" : "@support+integrationtests+a7o91bel"
    },
    "pipeline" : {
      "id" : "8f7a8390-4c62-4f33-8d78-5d4d882507f6",
      "name" : "SIT-generated pipeline",
      "lastModified" : "2022-11-04T15:28:37.158621"
    }
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/c9e45a1b-c744-45b4-82dd-631d8a2717ff"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/c9e45a1b-c744-45b4-82dd-631d8a2717ff",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/c9e45a1b-c744-45b4-82dd-631d8a2717ff",
      "type" : "PUT"
    },
    "pipeline" : {
      "href" : "https://catalog.matatika.com/api/pipelines/8f7a8390-4c62-4f33-8d78-5d4d882507f6"
    }
  }
}

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/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c' -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/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c"

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" : "f6ab6169-9eaa-407b-8f49-44fc1c32245c",
  "created" : "2022-11-04T15:28:35.620212",
  "lastModified" : "2022-11-04T15:28:36.091122786",
  "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/f6ab6169-9eaa-407b-8f49-44fc1c32245c"
    },
    "delete subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "DELETE"
    },
    "update subscription" : {
      "href" : "https://catalog.matatika.com/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c",
      "type" : "PUT"
    },
    "channel" : {
      "href" : "https://catalog.matatika.com/api/channels/f764e73c-d9d2-4112-9631-66d4e8d05c8a"
    }
  }
}

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/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c' -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/api/subscriptions/f6ab6169-9eaa-407b-8f49-44fc1c32245c"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

204 No Content

No response body provided.