ContentSubscriptions
Create, Update, Delete and Query the Content Subscriptions in Zendesk. Users can subscribe 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 本製品.Below queries lists the content subscriptions of a given user. To list your own subscriptions, specify me as the user id.
SELECT * FROM ContentSubscriptions WHERE UserId = '19128124956177' SELECT * FROM ContentSubscriptions WHERE UserId = 'me'
Below queries lists the subscriptions to a given topic.
SELECT * FROM ContentSubscriptions WHERE TopicId = '19209878690449' SELECT * FROM ContentSubscriptions WHERE TopicId = '19209878690449' AND Id = '19209922023185'
Below queries lists the subscriptions to a given post.
SELECT * FROM ContentSubscriptions WHERE PostId = '19206579516945' SELECT * FROM ContentSubscriptions WHERE PostId = '19206579516945' AND Id = '19210209123217'
Below queries lists the subscriptions to a given section. Here along with the SectionId, you need to provide the Locale value.
SELECT * FROM ContentSubscriptions WHERE SectionId = '19206579484689' AND Locale = 'en-us' SELECT * FROM ContentSubscriptions WHERE SectionId = '19206579484689' AND Locale = 'en-us' AND Id = '19210938828817'
Below queries lists the subscriptions to a given article. Here along with the ArticleId, you need to provide the Locale value.
SELECT * FROM ContentSubscriptions WHERE ArticleId = '19206609899793' AND Locale = 'en-us' SELECT * FROM ContentSubscriptions WHERE ArticleId = '19206609899793' AND Locale = 'en-us' AND Id = '19211885836945'
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any other search criteria will be ignored and an unfiltered response will be returned.
Insert
To create a Subscription for a given Topic, TopicId column is required. Allowed for End-users. 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, PostId column is required. Allowed for End-users. 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, SectionId, Locale and SourceLocale columns are required. Allowed for End-users. 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, ArticleId, Locale and SourceLocale columns are required. Allowed for End-users. 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
Update can be perform only on Topic Subscription. The TopicId and Id of the Subscription are required to Update it. Allowed for End-users.
UPDATE ContentSubscriptions SET IncludeComments = false WHERE TopicId = '19209878690449' AND Id = '19209922023185'
Delete
To remove a subscription to a given topic, Id and TopicId columns are required. Allowed for End-users.
DELETE FROM ContentSubscriptions WHERE TopicId = '19209878690449' AND Id = '19209922023185'
To remove a subscription to a given post, Id and PostId columns are required. Allowed for End-users.
DELETE FROM ContentSubscriptions WHERE PostId = '19206579516945' AND Id = '19210420873745'
To remove the specified subscription from the specified section, Id, SectionId and Locale columns are required. Allowed for End-users.
DELETE FROM ContentSubscriptions WHERE SectionId = '19206579516945' AND Id = '19210420873745' AND Locale = 'en-us'
To remove the specified subscription from the specified article, Id, ArticleId and Locale columns are required. Allowed for End-users.
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 | False |
Subscribe also to article comments/post comments. Only for section/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
SELECT ステートメントのWHERE 句では、疑似カラムフィールドを使用して、データソースから返されるタプルを詳細に制御することができます。
Name | Type | Description |
TopicId | Long |
Id of the Topic. |
PostId | Long |
Id of the Post. |
SectionId | Long |
Id of the Section. |
ArticleId | Long |
Id of the Article. |