Tag subscriptions

Tag subscriptions allow to subscribe a user to a list of tags. If a new question with one of the subscribed tags is published the users which are subscribed will receive a notification. It is also possible to subscribe a list of users to a tag.


Get subscriptions

Returns no tag ids

GET /users/:ID/subscription-labels

Returns the subscriptions of the user. Includes information about whether the tags are also categories.

Only the own user or a user_admin can execute this operation.

Response

{
  "subscriptions": [
    {
      "label": "Foo",
      "is_category": true
    },
    {
      "label": "Bar",
      "is_category": false
    }
  ]
}

DEPRECATED - Returns tag ids

GET /users/:ID/subscriptions

Returns the subscriptions of the user. Includes information about whether the tags are also categories.

Only the own user or a user_admin can execute this operation.

Response

{
  "subscriptions": [
    {
      "id": 1,
      "label": "Foo",
      "is_category": true
    },
    {
      "id": 15,
      "label": "Bar",
      "is_category": false
    }
  ]
}

Set subscriptions

Returns no tag ids

PUT /users/:ID/subscription-labels

Allows to set the subscriptions of the user.

Only the own user or a user_admin can execute this operation.

Request

{
  "subscriptions": [
    { "name": "Foo" },
    { "name": "Bar" }
  ]
}

Response

{
  "subscriptions": [
    {
      "label": "Foo",
      "is_category": true
    },
    {
      "label": "Bar",
      "is_category": false
    }
  ]
}

DEPRECATED - Returns tag ids

PUT /users/:ID/subscriptions

Allows to set the subscriptions of the user.

Only the own user or a user_admin can execute this operation.

Request

{
  "subscriptions": [
    { "name": "Foo" },
    { "name": "Bar" }
  ]
}

Response

{
  "subscriptions": [
    {
      "id": 1,
      "label": "Foo",
      "is_category": true
    },
    {
      "id": 15,
      "label": "Bar",
      "is_category": false
    }
  ]
}

Add new user subscription

POST /users/:ID/subscription-labels

Adds a new subscription for the user.

Only the own user or a user_admin can execute this operation.

Request

{ "name": "Foo" }

Response

{
  "subscriptions": [
    {
      "label": "Foo",
      "is_category": false
    }
  ]
}

Delete user subscription

DELETE /users/:ID/subscription-labels/:name

Deletes subscription with given name for the user.

Only the own user or a user_admin can execute this operation.

This request does not have a body, and in case of success, a HTTP 200 OK without body will be sent. ```

DEPRECATED - Get subscriptions

Prefer using the endpoint defined above.

GET /users/:ID/tag-subscriptions

Response

[
  "Baskervilles"
]


DEPRECATED - Subscribe

Prefer using the endpoint defined above.

PUT /users/:ID/tag-subscriptions

INFO:Subscribing replaces all existing subscriptions!

Json Payload

[
  "Baskervilles"
]

Response

[
  "Baskervilles"
]