Updated on 2023-09-27 GMT+08:00

POST /CCSQM/rest/ccisqm/v1/conversation-rules/getOneRule

Scenario

This interface is invoked to query a dialog rule by ID. The query criterion is rule_id, which indicates the unique ID of a dialog rule and is mandatory.

Method

POST

URI

https://Domain name/apiaccess/CCSQM/rest/ccisqm/v1/conversation-rules/getOneRule (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

Content-Type

String

No

The value is fixed to application/json; charset=UTF-8.

2

x-app-key

String

No

App key

3

Authorization

String

Yes

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

4

x-UserId

String

Yes

Operator ID

You can sign in to the system and go to the employee management page to view the value of userId returned by an interface.

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1

rule_id

String

Yes

Rule ID

Response Description

  • Status code: 200
Table 3 Response body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

severity

String

No

Rule level. The options are normal and critical.

1.2

rule_id

String

No

Rule ID

1.3

score

String

No

Rule score

1.4

other

Object

No

Additional conditions

1.4.1

call_end

Number

No

Call start timestamp, in seconds

1.4.2

call_from

Number

No

Call end timestamp, in seconds

1.5

min

String

No

Minimum number of dialog logics

1.6

method

String

No

The options are as follows:

  • positive
  • negative

1.7

rule_name

String

No

Rule name

1.8

flows

Array [Object]

No

Dialog logics used by a rule

1.8.1

flow_id

String

No

Dialog logic ID

1.8.2

flow_name

String

No

Dialog logic name

1.9

resultCode

String

No

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

1.10

description

String

No

Rule description

1.11

completeness

Object

No

Rule integrity

1.11.1

hasConversationFlow

Boolean

No

Whether dialog logics exist

1.11.2

sentenceComplete

Boolean

No

Whether the sentences in a rule are complete

1.11.3

ruleComplete

Boolean

No

Whether a rule is complete. When the values of the other three items are true, the value of this parameter is true.

1.11.4

hasDescription

Boolean

No

Whether the rule description exists

1.12

resultDesc

String

No

Return description

  • 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: Query a dialog rule by ID. The query criterion is rule_id, which indicates the unique ID of a dialog rule and is mandatory.

    Request header:

    x-app-key:************************************  
    X-UserID:1611917095665261978  
    Authorization:Bearer ********************************

    Request parameters:

    {
    	"rule_id": "922202599711576064"
    }

    Response parameters:

    {
    	"severity": "normal",
    	"rule_id": "922202599711576064",
    	"score": "1",
    	"other": {
    		"call_end": 1625020693,
    		"call_from": 1622515089
    	},
    	"min": "1",
    	"method": "positive",
    	"rule_name": "Dialog rule"
    	"flows": [{
    		"flow_id": "923000489761574912",
    		"flow_name": "cs"
    	}],
    	"resultCode": "0405000",
    	"description": "Dialog rule",
    	"completeness": {
    		"hasConversationFlow": true,
    		"sentenceComplete": true,
    		"ruleComplete": true,
    		"hasDescription": true
    	},
    	"resultDesc": "Operation successful."
    }