DataFlex / Salesforce Platform APIs / Search Suggested Article Title Matches
Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vQueryParams
Handle hoQueryParams
Variant vResp
Handle hoResp
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
If (Not(IsComObjectCreated(hoQueryParams))) Begin
Send CreateComObject of hoQueryParams
End
Get ComUpdateString Of hoQueryParams "q" "" To iSuccess
Get ComUpdateString Of hoQueryParams "publishStatus" "" To iSuccess
Get ComUpdateString Of hoQueryParams "language" "" To iSuccess
// Adds the "Authorization: Bearer <access_token>" header.
Set ComAuthToken Of hoHttp To "<access_token>"
Send ComSetRequestHeader To hoHttp "Content-Type" "application/json"
Get pvComObject of hoQueryParams to vQueryParams
Get ComQuickRequestParams Of hoHttp "GET" "https://domain.com/services/data/v{{version}}/search/suggestions" vQueryParams To vResp
If (IsComObject(vResp)) Begin
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
Set pvComObject Of hoResp To vResp
End
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComStatusCode Of hoResp To iTemp1
Showln iTemp1
Get ComBodyStr Of hoResp To sTemp1
Showln sTemp1
Send Destroy of hoResp
End_Procedure
Curl Command
curl -G -d "q="
-d "publishStatus="
-d "language="
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
https://domain.com/services/data/v{{version}}/search/suggestions
Postman Collection Item JSON
{
"name": "Search Suggested Article Title Matches",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/search/suggestions?q&publishStatus&language",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"search",
"suggestions"
],
"query": [
{
"key": "articleTypes",
"value": "",
"description": "Optional. Three-character ID prefixes indicating the desired article types. You can specify multiple values for this parameter in a single REST call, by repeating the parameter name for each value. For example, articleTypes=ka0&articleTypes=ka1.",
"disabled": true
},
{
"key": "categories",
"value": "",
"description": "Optional. The name of the data category group and name of the data category for desired articles, expressed as a JSON mapping. You can specify multiple data category group and data category pairs in this parameter. For example, categories={\"Regions\":\"Asia\",\"Products\":\"Laptops\"}. Characters in the URL might need to be encoded. For this example, categories=%7B%22Regions%22%3A%22Asia%22%2C%22Products%22%3A%22Laptops%22%7D.\n",
"disabled": true
},
{
"key": "channel",
"value": "",
"description": "Optional. The channel where the matching articles are visible. Valid values:\nAllChannels–Visible in all channels the user has access to\nApp–Visible in the internal Salesforce Knowledge application\nPkb–Visible in the public knowledge base\nCsp–Visible in the Customer Portal\nPrm–Visible in the Partner Portal\nIf channel isn’t specified, the default value is determined by the type of user.\nPkb for a guest user\nCsp for a Customer Portal user\nPrm for a Partner Portal user\nApp for any other type of user\nIf channel is specified, the specified value may not be the actual value requested, because of certain requirements.\nFor 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 AllChannels is specified, then App replaces the specified value.\nFor all users other than guest, Customer Portal, and Partner Portal users:\nIf Pkb, Csp, Prm, or App are specified, then the specified value is used.\nIf AllChannels is specified, then App replaces the specified value.",
"disabled": true
},
{
"key": "limit",
"value": "",
"description": "Optional. Specifies the maximum number of articles to return. If there are more suggested articles than the limit specified, the response body’s hasMoreResults property is true.",
"disabled": true
},
{
"key": "topics",
"value": "",
"description": "Optional. The topic of the returned articles. For example: topics=outlook&topics=email.",
"disabled": true
},
{
"key": "validationStatus",
"value": "",
"description": "Optional. The validation status of returned articles.",
"disabled": true
},
{
"key": "q",
"value": null
},
{
"key": "publishStatus",
"value": null
},
{
"key": "language",
"value": null
}
]
},
"description": "Returns a list of Salesforce Knowledge article titles that match the user’s search query string. Provides a shortcut to navigate directly to likely relevant articles before the user performs a search.\n\nhttps://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_suggest_title_matches.htm"
},
"response": [
]
}