Updated on 2025-03-31 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 robot 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

    Description

    1.1

    question

    String

    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

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

    1.3

    resultDesc

    String

    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: Associate common phrases based on the customer input.

    Request header:

    ccmessaging-token: XXXXXXXXX

    Request parameters:

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

    Response parameters:

    {
        "question": [
            "Where can I download the app?",
            "How do I log in to the app?",
            "What phone versions does the app support?",
            "What do I do if I do not have the permission on the order placement menu after logging in to the app?",
            "How do I log in to the system on a PC?"
        ],
        "resultCode": "0"
    }