ContentSubscriptions
Returns content subscriptions, including subscriptions to sections, articles, community posts, and community topics.
Table-Specific Information
Select
The following queries are processed server-side while other filters are processed client-side within the provider.The following queries list the content subscriptions of a given user. To list your own subscriptions, specify me as the UserId.
SELECT * FROM ContentSubscriptions WHERE UserId = '19128124956177'
SELECT * FROM ContentSubscriptions WHERE UserId = 'me'
The following queries list the subscriptions to a given topic.
SELECT * FROM ContentSubscriptions WHERE TopicId = '19209878690449'
SELECT * FROM ContentSubscriptions WHERE TopicId = '19209878690449' AND Id = '19209922023185'
The following queries list the subscriptions to a given post.
SELECT * FROM ContentSubscriptions WHERE PostId = '19206579516945'
SELECT * FROM ContentSubscriptions WHERE PostId = '19206579516945' AND Id = '19210209123217'
The following queries list the subscriptions to a given section. Provide values for the SectionId and Locale columns.
SELECT * FROM ContentSubscriptions WHERE SectionId = '19206579484689' AND Locale = 'en-us'
SELECT * FROM ContentSubscriptions WHERE SectionId = '19206579484689' AND Locale = 'en-us' AND Id = '19210938828817'
The following queries list the subscriptions to a given article. Provide values for the ArticleId and Locale columns.
SELECT * FROM ContentSubscriptions WHERE ArticleId = '19206609899793' AND Locale = 'en-us'
SELECT * FROM ContentSubscriptions WHERE ArticleId = '19206609899793' AND Locale = 'en-us' AND Id = '19211885836945'
Insert
To create a subscription for a given topic, the TopicId column is required. Agents with the "Help Center manager" role can optionally supply a UserId value. If provided, the user associated with UserId will be subscribed to the topic.
INSERT INTO ContentSubscriptions (TopicId, IncludeComments) VALUES ('19209878690449', true)
To create a subscription for a given post, the PostId column is required. Agents with the "Help Center manager" role can optionally supply a UserId value. If provided, the user associated with UserId will be subscribed to the post.
INSERT INTO ContentSubscriptions (PostId, UserId) VALUES ('19206579516945', '19157178632977')
To create a subscription for a given section, the SectionId, Locale, and SourceLocale columns are required. Agents with the "Help Center manager" role can optionally supply a UserId value. If provided, the user associated with UserId will be subscribed to the section.
INSERT INTO ContentSubscriptions (SectionId, Locale, SourceLocale) VALUES ('19206579484689', 'en-us', 'en-us')
To create a subscription for a given article, the ArticleId, Locale, and SourceLocale columns are required. Agents with the "Help Center manager" role can optionally supply a UserId value. If provided, the user associated with UserId will be subscribed to the article.
INSERT INTO ContentSubscriptions (ArticleId, Locale, SourceLocale) VALUES ('19206609899793', 'en-us', 'en-us')
Update
Updates can be performed only on topic subscriptions. The TopicId and Id columns of the subscription are required to update.
UPDATE ContentSubscriptions SET IncludeComments = false WHERE TopicId = '19209878690449' AND Id = '19209922023185'
Delete
To remove a subscription to a given topic, the Id and TopicId columns are required.
DELETE FROM ContentSubscriptions WHERE TopicId = '19209878690449' AND Id = '19209922023185'
To remove a subscription to a given post, the Id and PostId columns are required.
DELETE FROM ContentSubscriptions WHERE PostId = '19206579516945' AND Id = '19210420873745'
To remove the specified subscription from the specified section, the Id, SectionId, and Locale columns are required.
DELETE FROM ContentSubscriptions WHERE SectionId = '19206579516945' AND Id = '19210420873745' AND Locale = 'en-us'
To remove the specified subscription from the specified article, the Id, ArticleId, and Locale columns are required.
DELETE FROM ContentSubscriptions WHERE ArticleId = '19206609899793' AND Id = '19211885836945' AND Locale = 'en-us'
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Long | True |
Automatically assigned when the subscription is created. | |
| UserId | String | False |
Users.Id |
The Id of the user who has this subscription. |
| ContentId | Long | True |
The Id of the subscribed item. | |
| ContentType | String | True |
The type of the subscribed item. | |
| IncludeComments | Boolean | True |
Indicates whether comments are also included in the subscription. Applies only to section and topic subscriptions. | |
| Locale | String | False |
The locale of the subscribed item. | |
| SourceLocale | String | False |
Used only for Create Section Subscription and Create Article Subscription, where it's mandatory. Selects the locale of the content to be subscribed. | |
| Url | String | True |
The API URL of the subscription. | |
| CreatedAt | Datetime | True |
The time at which the subscription was created. | |
| UpdatedAt | Datetime | True |
The time at which the subscription was last updated. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer more granular control over the data returned from the data source.
| Name | Type | Description |
| TopicId | Long |
The Id of the topic to filter subscriptions by. |
| PostId | Long |
The Id of the post to filter subscriptions by. |
| SectionId | Long |
The Id of the section to filter subscriptions by. |
| ArticleId | Long |
The Id of the article to filter subscriptions by. |