UploadDataSync
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
Test
RAM authorization
|
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:
| Property | Value type | Required | Description |
| tickets | List | Yes | The 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. |
| commonRuleIds | List | No | The 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:
| Property | Value type | Required | Description |
| tid | String | Yes | The ID of this piece of text. You can use the corresponding phone call or ticket data ID. Make sure the ID is unique. |
| dialogue | List | Yes | The detailed content of the conversation in this piece of text. For details, see the dialogue property description below. |
dialogue property description:
| Property | Value type | Required | Description |
| role | String | Yes | The role in the conversation content. Valid values: agent and customer. |
| identity | String | No | The specific identity identifier of the conversation role. |
| words | String | Yes | The sentence spoken by this role. |
| begin | Integer | Yes | The start time of this sentence, which is the start time offset relative to the starting point, in milliseconds. |
| end | Integer | Yes | The end time of this sentence, which is the end time offset relative to the starting point, in milliseconds. |
| beginTime | Date | Yes | The 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 |
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 |
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.