Search Suggested Queries
Returns a list of suggested searches based on the user’s query string text matching searches that other users have performed in Salesforce Knowledge. Provides a way to improve search effectiveness, before the user performs a search. This resource is available in REST API version 30.0 and later.
Salesforce Knowledge must be enabled in your organization.
Queries are suggested if they exactly match the query string text. The text string must be a prefix within the query; it’s not considered a match if it appears within a word. For example, the text string app would return suggested queries apple banana and banana apples but not pineapple.
If the number of suggestions returned exceeds the limit specified in the request, the end of the response contains a field called hasMoreResults. Its value is true if the suggestions returned are only a subset of the suggestions available, and false otherwise.
If the user’s search query contains quotation marks or wildcards, those symbols are automatically removed from the query string in the URI.
/services/data/v{XX.X}/search/suggestSearchQueries?q={searchString}&language={languageOfQuery}
JSON, XML
GET
Authorization: Bearer {token}
None required
| Parameter | Description |
|---|---|
| channel | Optional. Specifies the Salesforce Knowledge channel where the article can be viewed. See the channel parameter details below. |
| language | Required. The language of the user’s query. |
| limit | Optional. Specifies the maximum number of suggested searches to return. If there are more suggested queries than the limit specified, the response body’s hasMoreResults property is true. |
| q | Required. The user’s search query string, properly URL-encoded. Suggestions are returned only if the user’s query string meets the minimum length requirements: one character for queries in Chinese, Japanese, and Korean, and three characters for all other languages. Query strings exceeding the maximum length of 250 characters return an error. |
Optional. Specifies the Salesforce Knowledge channel where the article can be viewed. Valid values:
AllChannels–Visible in all channels the user has access toApp–Visible in the internal Salesforce Knowledge applicationPkb–Visible in the public knowledge baseCsp–Visible in the Customer PortalPrm–Visible in the Partner Portal
If channel isn’t specified, the default value is determined by the type of user:
Pkbfor a guest userCspfor a Customer Portal userPrmfor a Partner Portal userAppfor any other type of user
If channel is specified, the specified value may not be the actual value requested, because of certain requirements:
- For guest, Customer Portal, and Partner Portal users, the specified value must match the default value for each user type. If the values don’t match or
AllChannelsis specified, thenAppreplaces the specified value. - For all users other than guest, Customer Portal, and Partner Portal users:
- If
Pkb,Csp,Prm, orAppare specified, then the specified value is used. - If
AllChannelsis specified, thenAppreplaces the specified value.
- If