Zones Class

Access information about Chatter Answers zones in your organization. Zones organize questions into logical groups, with each zone having its own focus and unique questions.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

ConnectApi

These methods are for Zones. All methods are static.

All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.

Get a zone.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

Yes

public static ConnectApi.Zone getZone(String communityId, String zoneId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

The ID of a zone.

Type: ConnectApi.Zone

Get a list of zones.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

Yes

public static ConnectApi.ZonePage getZones(String communityId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

Type: ConnectApi.ZonePage

Get a page of zones.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

Yes

public static ConnectApi.Zone getZones(String communityId, Integer pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

pageParam

Type: Integer

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.

Type: ConnectApi.ZonePage

Search articles or questions in a zone.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

37.0

Yes

public static ConnectApi.ZoneSearchPage searchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

ID of a zone.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

filter

Type: ConnectApi.ZoneSearchResultType

A ZoneSearchResultType enum value. One of the following:

  • Article—Search results contain only articles.
  • Question—Search results contain only questions.

Type: ConnectApi.ZoneSearchPage

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.

See Also

Search a page of articles or questions in a zone.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

37.0

Yes

public static ConnectApi.ZoneSearchPage searchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter, String pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

ID of a zone.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

filter

Type: ConnectApi.ZoneSearchResultType

A ZoneSearchResultType enum value. One of the following:

  • Article—Search results contain only articles.
  • Question—Search results contain only questions.

pageParam

Type: String

Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as currentPageToken or nextPageToken. If you pass in null, 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.

Type: ConnectApi.ZoneSearchPage

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.

See Also

Search articles or questions in a zone, and specify the language of the results.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

36.0

37.0

Yes

public static ConnectApi.ZoneSearchPage searchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter, String language)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

ID of a zone.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

filter

Type: ConnectApi.ZoneSearchResultType

  • Article—Search results contain only articles.
  • Question—Search results contain only questions.

language

Type: String

The language of the articles or questions. The value must be a Salesforce supported locale code.

Type: ConnectApi.ZoneSearchPage

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.

See Also

These test methods are for Zones. All methods are static.

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

Register a ConnectApi.ZoneSearchPage object to be returned when searchInZone(communityId, zoneId, q, filter) is called in a test context. Use the method with the same parameters or you receive an exception.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

public static Void setTestSearchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter, ConnectApi.ZoneSearchPage result)

communityId

Type: String

Use either the ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

The ID of a zone.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

filter

Type: ConnectApi.ZoneSearchResultType

A ZoneSearchResultType enum value. One of the following:

  • Article—Search results contain only articles.
  • Question—Search results contain only questions.

result

Type: ConnectApi.ZoneSearchPage

The object containing test data.

Type: Void

See Also

Register a ConnectApi.ZoneSearchPage object to be returned when searchInZone(communityId, zoneId, q, filter, pageParam, pageSize) is called in a test context. Use the method with the same parameters or you receive an exception.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

29.0

public static Void setTestSearchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter, String pageParam, Integer pageSize, ConnectApi.ZoneSearchPage result)

communityId

Type: String

Use either the ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

The ID of a zone.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

filter

Type: ConnectApi.ZoneSearchResultType

A ZoneSearchResultType enum value. One of the following:

  • Article—Search results contain only articles.
  • Question—Search results contain only questions.

pageParam

Type: String

Specifies the page token to be used to view a page of information. Page tokens are returned as part of the response class, such as currentPageToken or nextPageToken. If you pass in null, 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.

result

Type: ConnectApi.ZoneSearchPage

The object containing test data.

Type: Void

See Also

Register a ConnectApi.ZoneSearchPage object to be returned when searchInZone(communityId, zoneId, q, filter, language) is called in a test context. Use the method with the same parameters or you receive an exception.

With the Spring ’18 release, Salesforce no longer supports Chatter Answers. Users of Chatter Answers can post, answer, comment, or view existing Chatter Answers data, but support and updates are scheduled to end. We recommend transitioning to Chatter Questions. For more information, see End of Support for Chatter Answers in Spring ’18.

36.0

public static Void setTestSearchInZone(String communityId, String zoneId, String q, ConnectApi.ZoneSearchResultType filter, String language, ConnectApi.ZoneSearchPage result)

communityId

Type: String

Use either the ID for an Experience Cloud site, internal, or null.

zoneId

Type: String

The ID of a zone.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

filter

Type: ConnectApi.ZoneSearchResultType

A ZoneSearchResultType enum value. One of the following:

  • Article—Search results contain only articles.
  • Question—Search results contain only questions.

language

Type: String

The language of the articles or questions. The value must be a Salesforce supported locale code. In an <apex:page>, the default value is the language of the page. Otherwise, the default value is the user’s locale.

result

Type: ConnectApi.ZoneSearchPage

The object containing test data.

Type: Void

See Also