Search Suggested Queries
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.
Syntax
- URI
- /services/data/vXX.X/search/suggestSearchQueries?q=searchString&language=languageOfQuery
- Formats
- JSON, XML
- HTTP methods
- GET
- Authentication
- Authorization: Bearer token
- Request body
- None required
- Request parameters
-
Example
- Example Request
-
curl https://MyDomainName.my.salesforce.com/services/data/v64.0/search/suggestSearchQueries? q=app&language=en_US -H "Authorization: Bearer token"
- Example Response Body
-
{ "autoSuggestResults" : [ { "0" : "apple", "1" : "apple banana", } ], "hasMoreResults" : false }