Visual Intelligence API events
Updated at:
This topic describes the event types that Visual Intelligence API, as an event source, publishes to EventBridge using CloudConfig.
Event types
Visual Intelligence API publishes the following event types to EventBridge.
| Event type | type parameter |
| General OCR | viapi:ocr:RecognizeCharacter |
| General OCR for video files | viapi:ocr:RecognizeVideoCharacter |
For more information about the parameters defined in the CloudEvents specification, see Overview.
General OCR
The following is a sample event for general OCR that is received by EventBridge.
{
"id": "25da3c42-0caa-4259-****-50d4c189f12b",
"source": "acs.viapi",
"specversion": "1.0",
"type": "viapi:ocr:RecognizeCharacter",
"datacontenttype": "application/json;charset=utf-8",
"subject": "acs.viapi:cn-shanghai:1056067501*****:Request/6DE1D35C-2ED2-5FDC-*****-D2311A1C6932",
"time": "2021-09-28T02:27:42.089Z",
"aliyunaccountid": "1056067501*****",
"aliyunpublishtime": "2021-09-28T02:27:42.115Z",
"aliyunoriginalaccountid": "1056067501*****",
"aliyuneventbusname": "default",
"aliyunregionid": "cn-shanghai",
"data": {
"httpCode": "200",
"jobId": "6DE1D35C-2ED2-5FDC-12DC-D2311A1C****",
"ossFile": "oss://viapi-test/test/objectdet/DetectIPCObject/test***.jpeg",
"requestId": "6DE1D35C-2ED2-5FDC-12DC-D2311A1C****",
"result": "{\"Results\":[{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":0,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"text content\"},{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":10,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"text content\"}]}",
"status": "PROCESS_SUCCESS"
}
}The following table describes the parameters in the data field.
| Parameter | Type | Example | Description |
| httpCode | String | 200 | The HTTP code of the service. |
| jobId | String | 6DE1D35C-2ED2-5FDC-12DC-D2311A1C**** | The ID of the task. |
| ossFile | String | oss://viapi-test/test/objectdet/DetectIPCObject/test***.jpeg | The path of the OSS file. |
| requestId | String | 6DE1D35C-2ED2-5FDC-12DC-D2311A1C**** | The request ID of the task. |
| result | String | {\"Results\":[{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":0,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"text content\"},{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":10,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"text content\"}]} | The result data. |
| status | String | PROCESS_SUCCESS | The status of the task. |
General OCR for video files
The following is a sample event for general OCR for video files that is received by EventBridge.
{
"id": "25da3c42-0caa-4259-****-50d4c189f12b",
"source": "acs.viapi",
"specversion": "1.0",
"type": "viapi:ocr:RecognizeVideoCharacter",
"datacontenttype": "application/json;charset=utf-8",
"subject": "acs.viapi:cn-shanghai:1056067501*****:Request/6DE1D35C-2ED2-5FDC-*****-D2311A1C6932",
"time": "2021-09-28T02:27:42.089Z",
"aliyunaccountid": "1056067501*****",
"aliyunpublishtime": "2021-09-28T02:27:42.115Z",
"aliyunoriginalaccountid": "1056067501*****",
"aliyuneventbusname": "default",
"aliyunregionid": "cn-shanghai",
"data": {
"httpCode": "200",
"jobId": "6DE1D35C-2ED2-5FDC-****-D2311A1C6932",
"ossFile": "oss://viapi-test/test/objectdet/DetectIPCObject/test***.jpeg",
"requestId": "6DE1D35C-2ED2-5FDC-****-D2311A1C6932",
"result": "{\"Width\":1920,\"height\":1080,\"Frames\":[{\"Timestamp\":1,\"Elements\":[{\"Score\":0.95983,\"TextRectangle\":{\"Angle\":0,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"text content\"},{\"Score\":0.95983,\"TextRectangle\":{\"Angle\":10,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"text content\"}]}]}",
"status": "PROCESS_SUCCESS"
}
}For descriptions of the parameters in the data field, see Parameter descriptions.
Is this page helpful?