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

Recognition Result Notification

Description

After a third-party business client registers a subscription task with the CTI platform, this interface is used by the CTI platform to report recognition results to the third-party business client. The invoking party is the OpenProxy of the CTI platform, and the receiving party is the CC-AI of the AICC.

Interface Method

This interface supports only the POST method.

URI

The format of the URI for the CTI platform of the call center to invoke the recognition result notification interface is as follows:

{servicecallbackuri}/v100/subscribe/asrevent/asrresult (In the format, servicecallbackuri indicates the event notification callback address during registration.)

Example: https://10.21.117.9:8043/agentgateway/resource/asrresult/v100/subscribe/asrevent/asrresult

A third-party business client needs to enable the function of receiving messages from this address.

Request Message

  • Message header
    Table 1 Parameters in the message header

    No.

    Parameter

    Value Type

    Mandatory

    Description

    1

    Content-Type

    String

    Yes

    Coding mode of the message body. The default value is application/json; charset=UTF-8.

    2

    service_token

    String

    Yes

    Authentication token, which is generated in Subscription, for example, 3320EA1E5E**********************7112A68E336ED638.

    The value contains a maximum of 256 characters.

  • Message body
    Table 2 Parameters for sending the recognition result notification

    No.

    Parameter

    Value Type

    Mandatory

    Description

    1

    serverid

    String

    Yes

    Subscription task ID reported by the CTI platform to a third-party business client.

    2

    subscribetype

    String

    Yes

    Type of the reported subscription event.
    • 1: recognition
    • Others: reserved

    Currently, only the value 1 is supported.

    3

    initialagentid

    String

    Yes

    Agent ID of the control party, that is, ID of the agent to whom an inbound call is made or ID the agent who initiates an outbound call.

    4

    ccid

    String

    Yes

    ID of the CTI platform of the call center to which the current agent belongs.

    5

    vdnid

    String

    Yes

    ID of the VDN to which the current agent belongs.

    6

    curcallid

    String

    Yes

    ID of the current call.

    7

    curuserdn

    String

    Yes

    Phone number of the subscriber who is talking with the current agent. If the call is made between agents, leave this parameter empty.

    8

    talkertype

    String

    Yes

    Current speaker type.
    • 1: agent
    • 2: subscriber

    9

    talkerid

    String

    Yes

    Current speaker ID.

    • When talkertype is set to 1, this parameter indicates the agent ID.
    • When talkertype is set to 2, this parameter indicates the subscriber number.

    10

    nlpResult

    Object

    No

    Analysis results. For details about the parameters of this object, see Table 3.

    11

    result

    Array

    Yes

    Recognition result content. The value is an array. The parameters of this array are described as follows:

    • confidence: credibility of a valid recognition result.
    • content: content of a recognition result.
    • iscontentenc: indicates whether to encrypt a recognition result.
      • 0: no
      • 1: yes

    12

    asrusercase

    String

    Yes

    Reason code of the recognition result. The options are as follows:

    • 0: The recognition result is normal and the recognition ends (discontinuous recognition).
    • 61: A talk starts and no recognition content is carried.
    • 62: The recognition result is normal and the recognition continues.
    • 63: The recognition ends.
    • Others: A recognition error occurs.

    13

    calldata

    String

    No

    Call-associated data, which contains a maximum of 1024 bytes.

    The content stored in calldata is as follows:

    {

    "nlpFlag": true or false

    "flowAccessCode": flow access code

    "callBackUrl": actual callback URL

    }

    Table 3 Parameter description of nlpResult

    No.

    Parameter

    Value Type

    Description

    10.1

    call_script

    Array

    Script progress. For details about the parameters of this object, see Table 4.

    10.2

    call_script_matchedstep

    String

    Current script.

    10.3

    Intend

    String

    Intention.

    10.4

    sensitive_word

    Object

    Sensitive word.

    10.5

    recomand_KP

    Object

    Recommended knowledge. For details about the parameters of this object, see Table 5.

    Table 4 Parameter description of call_script

    No.

    Parameter

    Value Type

    Description

    10.1.1

    intentcode

    String

    Intention code.

    10.1.2

    intentDsp

    String

    Intention.

    10.1.3

    status

    String

    Intention status. The options are as follows:

    • finished
    • Left blank: unsent

    10.1.4

    childintent

    Array

    Script. The options are as follows:

    • intentcode
    • intentDsp
    • status
      • finished
      • Left blank: unsent
    Table 5 Parameter description of recomand_KP

    No.

    Parameter

    Value Type

    Description

    10.5.1

    similarFaqs

    Array

    Recommended similar FAQs (knowledge). For details about the parameters of this object, see Table 6.

    10.5.2

    answer

    Array

    Recommended FAQs (knowledge).

    Table 6 Parameter description of similarFaqs

    No.

    Parameter

    Value Type

    Description

    10.5.1.1

    faqGroupName

    Array

    Q&A team and knowledge team.

    10.5.1.2

    prob

    String

    Recommended probability value.

    10.5.1.3

    question

    String

    Question and knowledge title.

    10.5.1.4

    answers

    Array

    Answer and knowledge content. For details about the parameters of this object, see Table 7.

    10.5.1.5

    faqId

    String

    FAQ ID or knowledge ID.

    10.5.1.6

    faqGroupId

    String

    FAQ group ID.

    Table 7 Parameter description of answer

    No.

    Parameter

    Value Type

    Description

    10.5.1.4.1

    faqGroupName

    Array

    Q&A team and knowledge team.

    10.5.1.4.2

    prob

    String

    Recommended probability value.

    10.5.1.4.3

    question

    String

    Question and knowledge title.

    10.5.1.4.4

    answers

    String

    Answer and knowledge content.

    10.5.1.4.5

    faqId

    String

    FAQ ID or knowledge ID.

    10.5.1.4.6

    faqGroupId

    String

    FAQ group ID.

Response Message

Table 8 Parameters in the response message body

Parameter

Data Type

Description

message

String

Returned message.

retcode

String

Result cause code.

The value is an integer.

Example

  • Message header
    Content-Type:application/json; charset=UTF-8
    Guid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.AgentGateway1
  • Request parameter
    {
        "subscribetype": "1",
        "curuserdn": "88880313",
        "serverid": "20200723164539-001-00625",
        "initialagentid": "184",
        "result": {
            "iscontentenc": "0",
            "confidence": "100",
    "content": "{<nlresult" missing claiming; time=9460 9850>"
        },
        "ccid": "1",
        "createTime": 1595493968513,
        "vdnid": "14",
        "talkertype": "2",
        "talkerid": "88880313",
        "asrusercase": "62",
        "curcallid": "1595493961-913",
        "nlpResult": {
            "call_script": [
                {
                    "intentcode": "guashi",
    "intentDsp": "Claim missing",
                    "status": "finished",
                    "childintent": [
                        {
                            "intentcode": "shoujihaoma",
    "intentDsp": "Your mobile number",
                            "status": ""
                        },
                        {
                            "intentcode": "shenfenzheng",
    "intentDsp": "Your ID card number-Copy1",
                            "status": ""
                        }
                    ]
                }
            ],
            "call_script_matchedstep": "guashi",
    "Intend": "Claim missing",
            "sensitive_word": "",
            "recomand_KP": {
                "similarFaqs": [
                    {
                        "faqGroupName": "Claim missing",
                        "prob": "1E-08",
    "question": "Process for handling claim missing",
                        "answers": [
    "To claim missing, you need to fill in the information on the counter. To claim missing, you need to fill in the information on the counter. To claim missing, you need to fill in the information on the counter. To claim missing, you need to fill in the information on the counter."
                        ],
                        "faqId": 10002,
                        "faqGroupId": 10000
                    }
                ],
                "answer": {
    "faqGroupName": "Claim missing",
                    "prob": 4.05465109108164,
    "question": "Handling mode of the missing claiming business",
                    "answers": [
    "To handle the missing claiming business, you need to fill in the information at the counter."
                    ],
                    "faqId": 10001,
                    "faqGroupId": 10000
                }
            }
        }
    }
  • Response parameter
    {
        "message": "success",
        "retcode": "0"
    }