Help Center/ Cognitive Engagement Center/ API Reference/ Web Client Access Interface Reference/ Associating Common Phrases Based on the Customer Input (queryPhraseByKeyword)
Updated on 2023-09-27 GMT+08:00

Associating Common Phrases Based on the Customer Input (queryPhraseByKeyword)

Scenario

This interface is invoked to associate common phrases based on keywords entered by the customer. This interface requires that the chatbot be enabled in the channel configuration.

If no content is returned, check whether activated FAQ groups exist in the tenant space.

Method

POST

URI

https://Domain name/apiaccess/ccmessaging/queryPhraseByKeyword (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

ccmessaging-token

String

Yes

  • Value of token returned by the applyToken interface
  • Value of ccmessaging-token returned in the interface response header during a session

2

x-app-key

String

No

App key, which is the user ID and is configured on the API Fabric

3

Authorization

String

No

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameter

No.

Parameter

Type

Mandatory or Not

Description

1

reqBody

ReqBody

Yes

Request body

Table 3 ReqBody parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

strContent

String

Yes

Message content

1.2

locale

String

Yes

Language

The value does not contain the country code. For example, zh indicates Chinese, and en indicates English. For details, see ISO 639 language codes.

1.3

channel

String

Yes

Channel type. Currently, the value is fixed to WEB (web channel access).

Response Description

  • Status code: 200
    Table 4 RspBody parameters

    No.

    Parameter

    Type

    Mandatory or Not

    Description

    1.1

    question

    String

    Yes

    Array of similar questions

    A maximum of five records can be returned, which are the top five records with the highest confidences matched by the OIAP based on keywords.

    1.2

    resultCode

    String

    Yes

    Return code. The value 0 indicates success, and other values indicate failure.

    1.3

    resultDesc

    String

    No

    Return description

    • If resultCode is 0, the operation is successful, and no description is returned.
    • If resultCode is 1, the description is request is no exsit, locale is error, Robot is no exsit, authToken is no exsit, doNMSRequest is error, or Exception appeared!
  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

  • Scenario: example message

    Request header:

    ccmessaging-token: XXXXXXXXX

    Request parameters:

    {
    	"strContent": "Mesh",
    	"locale": "en",
    	"channel": "WEB"
    }

    Response parameters:

    {
    	"question": ["Where can I download the app mesh edition?", "How can I log in to the app mesh edition?", "What phone versions does the app mesh edition support?", "Why do I not have function menu permissions such as street promotion and mesh account book after I log in to the app mesh edition?", "How do I log in to the middle-screen mesh system on a PC?"],
    	"resultCode": "0"
    }