UploadDataSync

Updated at:

Performs real-time quality inspection on text.

Operation description

Pushes text data to be inspected in a specific format to SCA, performs real-time quality inspection and analysis on the text data based on user-specified rules, and synchronously returns the analysis results. Compared with uploaded text quality inspection, which usually uploads the complete conversation text after a conversation ends, real-time text quality inspection can push the text to SCA for analysis after a role finishes speaking one or more sentences, providing higher real-time performance. Special notes:

  • If the pushed text is a single sentence from a role, some operators in the rules, such as context repetition check, interruption check, and call silence check, will become invalid due to the lack of conversation context.

  • Real-time quality inspection synchronously returns analysis results. SCA does not save call records, so you cannot query the quality inspection results through the API.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sca:UploadDataSync

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

JsonStr

string

Yes

The jsonStr parameter is a JSON string that contains all custom parameters for this API operation. For details, see the jsonStr property description below.

{"tickets":xxx}

BaseMeAgentId

integer

No

The ID of the business workspace.

123456

jsonStr property description:

PropertyValue typeRequiredDescription
ticketsListYesThe information about the text data to be inspected. You can upload multiple pieces of text data in a single call. For details, see the tickets property description below.
commonRuleIdsListNoThe specified rule IDs. If not specified, all rules are used for analysis. If the total number of rules exceeds 100, only the first 100 rules in the rule list are used for analysis. We strongly recommend that you specify quality inspection rules. Otherwise, using a large number of rules for analysis each time will increase the API response latency. Only offline quality inspection rules can be used. Real-time quality inspection rules are not supported.

tickets property description:

PropertyValue typeRequiredDescription
tidStringYesThe ID of this piece of text. You can use the corresponding phone call or ticket data ID. Make sure the ID is unique.
dialogueListYesThe detailed content of the conversation in this piece of text. For details, see the dialogue property description below.

dialogue property description:

PropertyValue typeRequiredDescription
roleStringYesThe role in the conversation content. Valid values: agent and customer.
identityStringNoThe specific identity identifier of the conversation role.
wordsStringYesThe sentence spoken by this role.
beginIntegerYesThe start time of this sentence, which is the start time offset relative to the starting point, in milliseconds.
endIntegerYesThe end time of this sentence, which is the end time offset relative to the starting point, in milliseconds.
beginTimeDateYesThe start time of this sentence. Example: 2019-11-25 15:37:16.

Response elements

Element

Type

Description

Example

object

Code

string

The result code. A value of 200 indicates success. Any other value indicates failure. The caller can determine the cause of failure based on this field.

200

Message

string

The error details when an error occurs, or successful when the request succeeds.

successful

RequestId

string

The request ID.

4987D326-83D9-4A42-B9A5-0B27F9B***

Success

boolean

Indicates whether the request is successful. The caller can determine whether the request is successful based on this field. A value of true indicates success. A value of false or null indicates failure.

true

Data

object

ResultInfo

array<object>

The real-time quality inspection results.

array<object>

Score

integer

The quality inspection score. The default score is 100. Points are added or deducted based on the scoring items associated with the rules.

100

Rules

object

RuleHitInfo

array<object>

The hit details.

array<object>

The list of rules.

Tid

string

The text ID, which corresponds to the tid parameter in the tickets request parameter.

88888888

Rid

string

The ID of the hit rule.

801

Name

string

The name of the rule.

Default

Hit

object

ConditionHitInfo

array<object>

The specific hit location information. At the sentence level, it returns which condition in which rule is hit in the hit sentence, and which specific characters are hit.

array<object>

HitKeyWords

object

HitKeyWord

array<object>

The specific characters in the current sentence that hit the rule, which are the keywords to be highlighted.

object

The keywords that hit the condition.

To

integer

The end index of the keywords to be highlighted. The maximum value is the total number of characters in the current sentence minus 1. The highlighted text does not include the character at the to index. For example, if the sentence is "Refunds are impossible", from=0, and to=3, the highlighted keywords are the first three characters.

1

From

integer

The start index of the keywords to be highlighted. The value starts from 0, and the maximum value is the total number of characters in the current sentence minus 1. The highlighted text includes the character at the from index.

1

Val

string

The specific content of the keywords.

Yes

Tid

string

The text ID, which corresponds to the tid parameter in the tickets request parameter.

1

Pid

integer

The index of the current sentence among all sentences, which indicates the position of the current sentence in the dialogue array of the request parameters. The value starts from 0.

1

CustomizeCode

string

不文明用语

IsMatch

string

true

HitCids

object

CidItem

array

The list of IDs of the conditions hit by the current sentence.

string

The list of IDs of the conditions hit by the current sentence.

["3265"]

Phrase

object

The details of the sentence for the current rule hits.

Words

string

The sentence spoken by the participant.

Hello

Identity

string

The specific identity identifier of the conversation participant.

1

Begin

integer

The start time of the sentence, which is the offset from the start point. Unit: milliseconds.

0

BeginTime

string

The start time of the sentence. Example: 2019-11-25 15:37:16.

1564574

End

integer

The end time of the sentence, which is the offset from the start point. Unit: milliseconds.

2090

Role

string

The role of the conversation participant. Valid values: customer service representative, customer, and system.

Customer service representative

ConditionInfo

object

ConditionBasicInfo

array<object>

[Deprecated] Ignore this field.

object

[Deprecated] Ignore this field.

ConditionInfoCid

string

[Deprecated] Ignore this field.

xxx

LlmResponse

string

[Deprecated] This field is deprecated.

Deprecated field

HandScoreIdList

object

HandScoreIdList

array

[Deprecated] Ignore this field.

string

[Deprecated] Ignore this field.

[]

TyxmTurboCount

string

The number of times the turbo model is used.

1

TyxmPlusCount

string

The number of times the plus model is used.

1

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "successful",
  "RequestId": "4987D326-83D9-4A42-B9A5-0B27F9B***",
  "Success": true,
  "Data": {
    "ResultInfo": [
      {
        "Score": 100,
        "Rules": {
          "RuleHitInfo": [
            {
              "Tid": "88888888",
              "Rid": "801",
              "Name": "Default",
              "Hit": {
                "ConditionHitInfo": [
                  {
                    "HitKeyWords": {
                      "HitKeyWord": [
                        {
                          "To": 1,
                          "From": 1,
                          "Val": "Yes",
                          "Tid": "1",
                          "Pid": 1,
                          "CustomizeCode": "不文明用语",
                          "IsMatch": "true"
                        }
                      ]
                    },
                    "HitCids": {
                      "CidItem": [
                        "[\"3265\"]"
                      ]
                    },
                    "Phrase": {
                      "Words": "Hello",
                      "Identity": "1",
                      "Begin": 0,
                      "BeginTime": "1564574",
                      "End": 2090,
                      "Role": "Customer service representative"
                    }
                  }
                ]
              },
              "ConditionInfo": {
                "ConditionBasicInfo": [
                  {
                    "ConditionInfoCid": "xxx"
                  }
                ]
              },
              "LlmResponse": "废弃字段"
            }
          ]
        },
        "HandScoreIdList": {
          "HandScoreIdList": [
            "[]"
          ]
        },
        "TyxmTurboCount": "1",
        "TyxmPlusCount": "1"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.