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.

Namespace

ConnectApi

Zones Methods

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

getZone(communityId, zoneId)

Returns a specific zone based on the zone ID.

API Version

29.0

Requires Chatter

No

Signature

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

Parameters

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

Return Value

Type: ConnectApi.Zone

getZones(communityId)

Returns a paginated list of zones.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.ZonePage getZones(String communityId)

Parameters

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

Return Value

Type: ConnectApi.ZonePage

getZones(communityId, pageParam, pageSize)

Returns a paginated list of zones with the specified page and page size.

API Version

29.0

Requires Chatter

No

Signature

public static ConnectApi.Zone getZones(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 feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

Return Value

Type: ConnectApi.ZonePage

searchInZone(communityId, zoneId, q, filter)

Search a zone by keyword. Specify whether to search articles or questions.

API Version

29.0

Requires Chatter

No

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
zoneId
Type: String
zoneIdThe ID of a zone.
q
Type: String
qSpecifies 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.

Return Value

Type: ConnectApi.ZoneSearchPage

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.

searchInZone(communityId, zoneId, q, filter, pageParam, pageSize)

Search a zone by keyword. Specify whether to search articles or questions and specify the page of information to view and the page size.

API Version

29.0

Requires Chatter

No

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
zoneId
Type: String
zoneIdThe ID of a zone.
q
Type: String
qSpecifies 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 feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

Return Value

Type: ConnectApi.ZoneSearchPage

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.

Zones Test Methods

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

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

setTestSearchInZone(communityId, zoneId, q, filter, result)

Registers a ConnectApi.ZoneSearchPage object to be returned when searchInZone(communityId, zoneId, q, filter) is called in a test context.

API Version

29.0

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
zoneId
Type: String
zoneIdThe ID of a zone.
q
Type: String
qSpecifies 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.

Return Value

Type: Void

setTestSearchInZone(communityId, zoneId, q, filter, pageParam, pageSize, result)

Registers a ConnectApi.ZoneSearchPage object to be returned when searchInZone(communityId, zoneId, q, filter, pageParam, pageSize) is called in a test context.

API Version

29.0

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
zoneId
Type: String
zoneIdThe ID of a zone.
q
Type: String
qSpecifies 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 feed 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.

Return Value

Type: Void