Topics Class

Access information about topics, such as their descriptions, the number of people talking about them, related topics, and information about groups contributing to the topic. Update a topic’s name or description, merge topics, and add and remove topics from records and feed items.

Namespace

ConnectApi

Topics Methods

The following are methods for Topics. All methods are static.

assignTopic(communityId, recordId, topicId)

Assigns the specified topic to the specified record or feed item. Only users with the Assign Topics permission can add existing topics to records or feed items. Administrators must enable topics for objects before users can add topics to records of that object type.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.Topic assignTopic(String communityId, String recordId, String topicId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.
topicId
Type: String
The ID for a topic.

Return Value

Type: ConnectApi.​Topic

assignTopicByName(communityId, recordId, topicName)

Assigns the specified topic to the specified record or feed item. Only users with the Assign Topics permission can add existing topics to records or feed items. Only users with the Create Topics permission can add new topics to records or feed items. Administrators must enable topics for objects before users can add topics to records of that object type.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.Topic assignTopicByName(String communityId, String recordId, String topicName)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID of the record or feed item to which to assign the topic.
topicName
Type: String
The name of a new or existing topic.

Return Value

Type: ConnectApi.​Topic

createTopic(communityId, name, description)

Creates a topic. Only users with the Create Topics permission can create a topic.

API Version

36.0

Requires Chatter

No

Signature

public static ConnectApi.Topic createTopic(String communityId, String name, String description)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
name
Type: String
The name of the topic.
description
Type: String
The description of the topic.

Return Value

Type: ConnectApi.​Topic

createTopicDataCategoryRules(communityId, dataCategoryGroup, dataCategory, topicNames)

Create topic and article assignment rules by data category.

API Version

40.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage createTopicDataCategoryRules(String communityId, String dataCategoryGroup, String dataCategory, ConnectApi.TopicNamesInput topicNames)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
dataCategoryGroup
Type: String
The data category group used by articles.
dataCategory
Type: String
The data category used by articles.
topicNames
Type: ConnectApi.​TopicNamesInput
A ConnectApi.TopicNamesInput object with the names of topics to assign to articles in a data category.

Return Value

Type: ConnectApi.TopicPage

deleteTopic(communityId, topicId)

Deletes the specified topic. Only users with the Delete Topics or Modify All Data permission can delete topics.

API Version

29.0

Requires Chatter

No

Signature

public static Void deleteTopic(String communityId, String topicId)

Parameters

communityId
Type: String,
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.

Return Value

Type: Void

Usage

Topic deletion is asynchronous. If a topic is requested before the deletion completes, the response is 200: Successful and the isBeingDeleted property of ConnectApi.Topic is true in version 33.0 and later. If a topic is requested after the deletion completes, the response is 404: NOT_FOUND.

getGroupsRecentlyTalkingAboutTopic(communityId, topicId)

Returns information about the five groups that most recently contributed to the specified topic.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterGroupSummaryPage getGroupsRecentlyTalkingAboutTopic(String communityId, String topicId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.

Return Value

Type: ConnectApi.​Chatter​Group​SummaryPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getRecentlyTalkingAboutTopicsForGroup(communityId, groupId)

Returns up to five topics most recently used in the specified group.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.TopicPage getRecentlyTalkingAboutTopicsForGroup(String communityId, String groupId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
groupId
Type: String
The ID for a group.

Return Value

Type: ConnectApi.​TopicPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getRecentlyTalkingAboutTopicsForUser(communityId, userId)

Topics recently used by the specified user. Get up to five topics most recently used by the specified user.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.TopicPage getRecentlyTalkingAboutTopicsForUser(String communityId, String userId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
userId
Type: String
The ID for a user.

Return Value

Type: ConnectApi.​TopicPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getRelatedTopics(communityId, topicId)

List of five topics most closely related to the specified topic.

API Version

Two topics that are assigned to the same feed item at least three times are related.

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getRelatedTopics(String communityId, String topicId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.

Return Value

Type: ConnectApi.​TopicPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getTopic(communityId, topicId)

Returns information about the specified topic.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.Topic getTopic(String communityId, String topicId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.

Return Value

Type: ConnectApi.​Topic

getTopicDataCategoryRules(communityId, dataCategoryGroup, dataCategory)

Get topic and article assignment rules by data category.

API Version

40.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopicDataCategoryRules(String communityId, String dataCategoryGroup, String dataCategory)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
dataCategoryGroup
Type: String
The data category group used by articles.
dataCategory
Type: String
The data category used by articles.

Return Value

Type: ConnectApi.TopicPage

getTopics(communityId, recordId)

Returns the first page of topics assigned to the specified record or feed item. Administrators must enable topics for objects before users can add topics to records of that object type.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, String recordId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId)

Returns the first page of topics for the organization.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, sortParam)

Returns the first page of topics for the organization in the specified order.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, ConnectApi.TopicSort sortParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
sortParam
Type: ConnectApi.​TopicSort
Values are:
  • popularDesc—Sorts topics by popularity with the most popular first. This value is the default.
  • alphaAsc—Sorts topics alphabetically.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, pageParam, pageSize)

Returns the topics for the specified page.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, Integer pageParam, Integer pageSize)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
pageParam
Type: Integer
Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, pageParam, pageSize, sortParam)

Returns the topics for the specified page in the specified order.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, Integer pageParam, Integer pageSize, ConnectApi.TopicSort sortParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
pageParam
Type: Integer
Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​TopicSort
Values are:
  • popularDesc—Sorts topics by popularity with the most popular first. This value is the default.
  • alphaAsc—Sorts topics alphabetically.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, q, sortParam)

Returns the topics that match the specified search criteria in the specified order.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, String q, ConnectApi.TopicSort sortParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Specifies the string to search. The string must contain at least two characters, not including wildcards.
sortParam
Type: ConnectApi.​TopicSort
Values are:
  • popularDesc—Sorts topics by popularity with the most popular first. This value is the default.
  • alphaAsc—Sorts topics alphabetically.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, q, pageParam, pageSize)

Returns the topics that match the specified search criteria for the specified page.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, String q, Integer pageParam, Integer pageSize)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Specifies the string to search. The string must contain at least two characters, not including wildcards.
pageParam
Type: Integer
Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, q, pageParam, pageSize, sortParam)

Returns the topics that match the specified search criteria for the specified page in the specified order.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.TopicSort sortParam)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Specifies the string to search. The string must contain at least two characters, not including wildcards.
pageParam
Type: Integer
Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​TopicSort
Values are:
  • popularDesc—Sorts topics by popularity with the most popular first. This value is the default.
  • alphaAsc—Sorts topics alphabetically.

Return Value

Type: ConnectApi.​TopicPage

getTopics(communityId, q, exactMatch)

Returns the topic that matches the exact, case-insensitive name.

API Version

33.0

Available to Guest Users

33.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopics(String communityId, String q, Boolean exactMatch)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Specifies the string to search. The string must contain at least two characters, not including wildcards.
exactMatch
Type: Boolean
Specify true to find a topic by its exact, case-insensitive name.

Return Value

Type: ConnectApi.​TopicPage

getTopicsOrFallBackToRenamedTopics(communityId, q, exactMatch, fallBackToRenamedTopics)

If there isn’t an exact match, returns the most recent renamed topic match.

API Version

35.0

Available to Guest Users

35.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTopicsOrFallBackToRenamedTopics(String communityId, String q, Boolean exactMatch, Boolean fallBackToRenamedTopics)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Specifies the string to search. The string must contain at least two characters, not including wildcards.
exactMatch
Type: Boolean
Specify true to find a topic by its exact, case-insensitive name or to find the most recent renamed topic match if there isn’t an exact match.
fallBackToRenamedTopics
Type: Boolean
Specify true and if there isn’t an exact match, the most recent renamed topic match is returned. If there are multiple renamed topic matches, only the most recent is returned. If there are no renamed topic matches, an empty collection is returned.

Return Value

Type: ConnectApi.​TopicPage

getTopicSuggestions(communityId, recordId, maxResults)

Returns suggested topics for the specified record or feed item. Administrators must enable topics for objects before users can see suggested topics for records of that object type.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.TopicSuggestionPage getTopicSuggestions(String communityId, String recordId, Integer maxResults)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.
maxResults
Type: Integer
Maximum number of topic suggestions that get returned. The default is 5. Value must be greater than 0 and less than or equal to 25.

Return Value

Type: ConnectApi.​TopicSuggestionPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getTopicSuggestions(communityId, recordId)

Returns suggested topics for the specified record or feed item. Administrators must enable topics for objects before users can see suggested topics for records of that object type.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.TopicSuggestionPage getTopicSuggestions(String communityId, String recordId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.

Return Value

Type: ConnectApi.​TopicSuggestionPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getTopicSuggestionsForText(communityId, text, maxResults)

Returns suggested topics for the specified string of text.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.TopicSuggestionPage getTopicSuggestionsForText(String communityId, String text, Integer maxResults)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
text
Type: String
String of text.
maxResults
Type: Integer
Maximum number of topic suggestions that get returned. The default is 5. Value must be greater than 0 and less than or equal to 25.

Return Value

Type: ConnectApi.​TopicSuggestionPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getTopicSuggestionsForText(communityId, text)

Returns suggested topics for the specified string of text.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.TopicSuggestionPage getTopicSuggestionsForText(String communityId, String text)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
text
Type: String
String of text.

Return Value

Type: ConnectApi.​TopicSuggestionPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getTrendingTopics(communityId)

List of the top five trending topics for the organization.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTrendingTopics(String communityId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.

Return Value

Type: ConnectApi.​TopicPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

getTrendingTopics(communityId, maxResults)

List of the top five trending topics for the organization.

API Version

29.0

Available to Guest Users

32.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage getTrendingTopics(String communityId, Integer maxResults)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
maxResults
Type: Integer
Maximum number of topic suggestions that get returned. The default is 5. Value must be greater than 0 and less than or equal to 25.

Return Value

Type: ConnectApi.​TopicPage

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

mergeTopics(communityId, topicId, idsToMerge)

Merges up to five secondary topics with the specified primary topic.

API Version

33.0

Requires Chatter

No

Signature

public static ConnectApi.Topic mergeTopics(String communityId, String topicId, List<String> idsToMerge)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for the primary topic for the merge. If this topic is a managed topic, it retains its topic type, topic images, and children topics.
idsToMerge
Type: List<String>
A list of up to five comma-separated secondary topic IDs to merge with the primary topic. If any of these secondary topics are managed topics, they lose their topic type, topic images, and children topics. Their feed items are reassigned to the primary topic.

Return Value

Type: ConnectApi.​Topic

Usage

Only users with the Delete Topics or Modify All Data permission can merge topics.

reassignTopicDataCategoryRules(communityId, dataCategoryGroup, dataCategory, topicNames)

Reassign topic and article assignment rules by data category by deleting the existing rules and creating new rules.

API Version

40.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage reassignTopicDataCategoryRules(String communityId, String dataCategoryGroup, String dataCategory, ConnectApi.TopicNamesInput topicNames)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
dataCategoryGroup
Type: String
The data category group used by articles.
dataCategory
Type: String
The data category used by articles.
topicNames
Type: ConnectApi.​TopicNamesInput
A ConnectApi.TopicNamesInput object with the names of topics to reassign to articles in a data category.

Return Value

Type: ConnectApi.TopicPage

reassignTopicsByName(communityId, recordId, topicNames)

Reassigns all the topics on a record or feed item, that is, removes all the assigned topics on a record or feed item and adds topics. Optionally, provides a list of suggested topics to assign to a record or feed item to improve future topic suggestions. Only users with the Assign Topics permission can remove topics from records or feed items and add existing topics to records or feed items. Only users with the Create Topics permission can add new topics to records or feed items. Administrators must enable topics for objects before users can add topics to records of that object type.

API Version

35.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage reassignTopicsByName(String communityId, String recordId, ConnectApi.TopicNamesInput topicNames)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID of the record or feed item to which to assign the topic.
topicNames
Type: ConnectApi.​TopicNamesInput
A list of topics to replace the currently assigned topics. Optionally, a list of suggested topics to assign to improve future topic suggestions.

Return Value

Type: ConnectApi.​TopicPage

unassignTopic(communityId, recordId, topicId)

Removes the specified topic from the specified record or feed item. Only users with the Assign Topics permission can remove topics from feed items or records. Administrators must enable topics for objects before users can add topics to records of that object type.

API Version

29.0

Requires Chatter

No

Signature

public static Void unassignTopic(String communityId, String recordId, String topicId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.
topicId
Type: String
The ID for a topic.

Return Value

Type: Void

updateTopic(communityId, topicId, topic)

Updates the description or name of the specified topic or merges up to five secondary topics with the specified primary topic.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.Topic updateTopic(String communityId, String topicId, ConnectApi.TopicInput topic)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.
topic
Type: ConnectApi.TopicInput
A ConnectApi.TopicInput object containing the name and description of the topic or up to five comma-separated secondary topic IDs to merge with the primary topic.

Return Value

Type: ConnectApi.​Topic

Usage

Only users with the Edit Topics or Modify All Data permission can update topic names and descriptions. Only users with the Delete Topics or Modify All Data permission can merge topics.

updateTopicsForArticlesInDataCategory(communityId, dataCategoryGroup, dataCategory, articleTopicAssignmentJob)

Assign topics to articles and unassign topics from articles in a data category.

API Version

40.0

Requires Chatter

No

Signature

public static ConnectApi.TopicPage updateTopicsForArticlesInDataCategory(String communityId, String dataCategoryGroup, String dataCategory, ConnectApi.ArticleTopicAssignmentJobInput articleTopicAssignmentJob)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
dataCategoryGroup
Type: String
The data category group used by articles.
dataCategory
Type: String
The data category used by articles.
articleTopicAssignmentJob
Type: ConnectApi.ArticleTopicAssignmentJobInput
A ConnectApi.ArticleTopicAssignmentJobInput object that indicates the operation to take on which topics.

Return Value

Type: ConnectApi.TopicPage

Topics Test Methods

The following are the test methods for Topics. All methods are static.

For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.

setTestGetGroupsRecentlyTalkingAboutTopic(communityId, topicId, result)

Registers a ConnectApi.ChatterGroupSummaryPage object to be returned when ConnectApi.getGroupsRecentlyTalkingAboutTopic is called in a test context.

API Version

29.0

Signature

public static Void setTestGetGroupsRecentlyTalkingAboutTopic(String communityId, String topicId, ConnectApi.ChatterGroupSummaryPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.
result
Type: ConnectApi.​Chatter​Group​SummaryPage
The object containing test data.

Return Value

Type: Void

setTestGetRecentlyTalkingAboutTopicsForGroup(communityId, groupId, result)

Registers a ConnectApi.​TopicPage object to be returned when the ConnectApi.getRecentlyTalkingAboutTopicsForGroup method is called in a test context.

API Version

29.0

Signature

public static Void setTestGetRecentlyTalkingAboutTopicsForGroup(String communityId, String groupId, ConnectApi.​TopicPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
groupId
Type: String
The ID for a group.
result
Type: ConnectApi.​TopicPage
The object containing test data.

Return Value

Type: Void

setTestGetRecentlyTalkingAboutTopicsForUser(communityId, userId, result)

Creates a topics page to use for testing. After you create the page, use the matching ConnectApi.getRecentlyTalkingAboutTopicsForUser method to access the test page and run your tests. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetRecentlyTalkingAboutTopicsForUser(String communityId, String userId, ConnectApi.TopicPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
userId
Type: String
The ID for a user.
result
Type: ConnectApi.​TopicPage
Specify the test topics page.

Return Value

Type: Void

setTestGetRelatedTopics(communityId, topicId, result)

Registers a ConnectApi.TopicPage object to be returned when the ConnectApi.getRelatedTopics method is called in a test context.

API Version

29.0

Signature

public static Void setTestGetRelatedTopics(String communityId, String topicId, ConnectApi.TopicPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
topicId
Type: String
The ID for a topic.
result
Type: ConnectApi.​TopicPage
The object containing test data.

Return Value

Type: Void

setTestGetTopicSuggestions(communityId, recordId, maxResults, result)

Registers a ConnectApi.TopicSuggestionPage object to be returned when the matching ConnectApi.getTopicSuggestions method is called in a test context. Use the method with the same parameters or you receive an exception. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetTopicSuggestions(String communityId, String recordId, Integer maxResults, ConnectApi.TopicSuggestionPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.
maxResults
Type: Integer
Maximum number of topic suggestions that get returned. The default is 5. Value must be greater than 0 and less than or equal to 25.
result
Type: ConnectApi.​TopicSuggestionPage
Specify the test topic suggestions page.

Return Value

Type: Void

setTestGetTopicSuggestions(communityId, recordId, result)

Registers a ConnectApi.TopicSuggestionPage object to be returned when the matching ConnectApi.getTopicSuggestions method is called in a test context. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetTopicSuggestions(String communityId, String recordId, ConnectApi.​TopicSuggestionPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
recordId
Type: String
The ID for a record or feed item.
result
Type: ConnectApi.​TopicSuggestionPage
The object containing test data.

Return Value

Type: Void

setTestGetTopicSuggestionsForText(communityId, text, maxResults, result)

Registers a ConnectApi.TopicSuggestionPage object to be returned when the matching ConnectApi.getTopicSuggestionsForText method is called in a test context. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetTopicSuggestionsForText(String communityId, String text, Integer maxResults, ConnectApi.TopicSuggestionPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
text
Type: String
String of text.
maxResults
Type: Integer
Maximum number of topic suggestions that get returned. The default is 5. Value must be greater than 0 and less than or equal to 25.
result
Type: ConnectApi.​TopicSuggestionPage
The object containing test data.

Return Value

Type: Void

setTestGetTopicSuggestionsForText(communityId, text, result)

Registers a ConnectApi.TopicSuggestionPage object to be returned when the matching ConnectApi.getTopicSuggestionsForText method is called in a test context. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetTopicSuggestionsForText(String communityId, String text, ConnectApi.TopicSuggestionPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
text
Type: String
String of text.
result
Type: ConnectApi.​TopicSuggestionPage
The object containing test data.

Return Value

Type: Void

setTestGetTrendingTopics(communityId, result)

Registers a ConnectApi.TopicPage object to be returned when the matching ConnectApi.getTrendingTopics method is called in a test context. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetTrendingTopics(String communityId, ConnectApi.TopicPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
result
Type: ConnectApi.​TopicPage
The object containing test data.

Return Value

Type: Void

setTestGetTrendingTopics(communityId, maxResults, result)

Registers a ConnectApi.TopicPage object to be returned when the matching ConnectApi.getTrendingTopics method is called in a test context. Use the method with the same parameters or you receive an exception.

API Version

29.0

Signature

public static Void setTestGetTrendingTopics(String communityId, Integer maxResults, ConnectApi.TopicPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
maxResults
Type: Integer
Maximum number of topic suggestions that get returned. The default is 5. Value must be greater than 0 and less than or equal to 25.
result
Type: ConnectApi.​TopicPage
The object containing test data.

Return Value

Type: Void