getResources()
The ZohoSalesIQ.KnowledgeBase.getResources API allows to get a list of resources (articles). To get a specific resource category list, use the below parameters as filters.
Parameters:
- type * - (Article) The type of the resource.
- departmentId (Optional) - Department ID to fetch resource associated with it.
- parentCategoryId (Optional) - Category ID to get the articles.
- searchKey (Optional) - A search keyword to further filter the results.
- page (Optional) - Specify the number of pages. (Default value is 1)
- limit (Optional) - Specify the number of articles to be fetched for a page. (Default & maximum value is 99)
- callback* - The callback to get the resources.
- moreDataAvailable - (callback parameter) A boolean indicating an excess of resources beyond the specified page limit
Note:
- The content in the resource object will be null by default. To get the resource content, use the getSingleResource() API.
- Fields marked * are mandatory
Error code
Code | Message |
---|---|
500 | Mobilisten SDK not initialized |
600 | No network connection |
605 | Mobilisten is disabled |
Syntax
CopiedZohoSalesIQ.KnowledgeBase.getResources(
type: ResourceType,
departmentId: string | null,
parentCategoryId: string | null,
page: number,
limit: number,
searchKey: string | null,
callback: (
error: CallbackError,
resources: object[],
moreAvailable: boolean
) => void
)
Example
CopiedZohoSalesIQ.KnowledgeBase.getResources(ZohoSalesIQ.Resource.ARTICLES, 'department_id', 'parent_category_id', page, limit, 'search_key', (error, resources, moreDataAvailable) => {
});