tencent cloud

Submitting Tasks
Last updated: 2025-11-19 11:16:58
Submitting Tasks
Last updated: 2025-11-19 11:16:58

Feature Description

Submit a video object detection task.

Authorization Description

When used with a sub-account, the ci:CreateMediaJobs permission must be granted. For details, see Cloud Infinite action.
When a sub-account uses an asynchronous processing interface, the cam:passrole permission must be granted. The asynchronous processing interface performs read and write operations on COS resources through CAM's "role". The PassRole permission is used for role passing. For details, refer to Access Management - Write Operation - PassRole API.

Activating a Service

To use this feature, you need to enable Cloud Infinite in advance and bind a bucket. For details, see Bind Bucket.
Use this feature requires enabling the AI Content Recognition service in advance via the console or API. For details, see Enable AI Content Recognition Service.

Use Limits

When using this API, please confirm the relevant restrictions first. For details, see Usage Limits.

Fee Description

This API is a paid service. The incurred fees will be collected by Cloud Infinite. For detailed billing instructions, see CR Fees.


Request

Request sample

POST /jobs HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml

<body>
Note:
Authorization: Auth String. For details, see Request Signature document.

Request header

This API only uses common request headers. For details, see Common Request Headers documentation.

Request body

The implementation of this request operation requires the following request body:
<Request>
<Tag>VideoTargetRec</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON<CallBackFormat>
</Request>
The data are described as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Request
None.
Container for saving requests
Container
Yes
The specific data description of the Container type Request is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Tag
Request
Tag for creating a task: VideoTargetRec
String
Yes
Operation
Request
Operation Rule
Container
Yes
Input
Request
Media information to be operated
Container
Yes
CallBackFormat
Request
Job callback format, JSON or XML, default XML, priority is higher than the callback format of the queue
String
No
CallBackType
Request
Job callback type, Url or TDMQ, default Url, priority is higher than the callback type of the queue
String
No
CallBack
Request
job callback address, priority is higher than the callback address of the queue. When set to no, it indicates that the callback address of the queue does not generate a callback.
String
No
CallBackMqConfig
Request
Task callback TDMQ configuration, required when CallBackType is TDMQ. For details, see CallBackMqConfig.
Container
No
The specific data description of the Container type Input is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Object
Request.Input
media file name
String
No
The specific data description of the Container type
Operation
is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
TemplateId
Request.Operation
video object detection template ID
String
No
VideoTargetRec
Request.Operation
video object detection parameters, same as Request.VideoTargetRec in the create video object detection template API
Container
No
UserData
Request.Operation
Pass through user information Printable ASCII code Length not exceeding 1024
String
No
JobLevel
Request.Operation
Task priority, level limit: 0, 1, 2. Higher level means higher task priority. Default is 0.
String
No
SnapshotPrefix
Request.Operation
Screenshot output prefix. After configuration, the screenshot output will be saved to the user's bucket at the path "SnapshotPrefix/<jobId>/<random screenshot name>", which may incur additional fees. No screenshot will be saved if the field is empty.
String
No
Note:
The video object detection parameter must be set and can be configured through TemplateId or VideoTargetRec, with TemplateId having higher priority.

Response

Response Headers

This API only returns the public response header. For details, see Common Response Headers documentation.

Response Body

The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId>
<State>Submitted</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>VideoTargetRec</Tag>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<TemplateName>video_target_rec_demo</TemplateName>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>
The data are as follows:
Node Name (Keyword)
Parent Node
Description
Type
Response
None.
Container for saving results
Container
Container node Response content:
Node Name (Keyword)
Parent Node
Description
Type
JobsDetail
Response
Detailed information of the task
Container array
Content of Container node
JobsDetail
:
Node Name (Keyword)
Parent Node
Description
Type
Code
Response.JobsDetail
error code, which is meaningful only when State is Failed
String
Message
Response.JobsDetail
error description, which is meaningful only when State is Failed
String
JobId
Response.JobsDetail
ID of the newly created task
String
Tag
Response.JobsDetail
Tag for the newly created task: VideoTargetRec
String
State
Response.JobsDetail
Task Status
Submitted: submitted, pending execution
Running: executing
Success: execution successful
Failed: execution failed
Pause: Task is paused. When the pause queue is triggered, to-be-executed tasks become paused state.
Cancel: task cancelled
String
CreationTime
Response.JobsDetail
Task Creation Time
String
StartTime
Response.JobsDetail
Task Start Time
String
EndTime
Response.JobsDetail
Task End Time
String
QueueId
Response.JobsDetail
Queue ID that the task belongs to
String
Operation
Response.JobsDetail
Operation rule
Container
Container node Operation content:
Node Name (Keyword)
Parent Node
Description
Type
TemplateId
Response.JobsDetail.Operation
Job template ID
String
TemplateName
Response.JobsDetail.Operation
Template name of the task, return when TemplateId exists
String
VideoTargetRec
Response.JobsDetail.Operation
Request.Operation.VideoTargetRec in progress
Container
VideoTargetRecResult
Response.JobsDetail.Operation
Video object detection result
Container
UserData
Response.JobsDetail.Operation
Pass through user information
String
JobLevel
Response.JobsDetail.Operation
Task Priority
String
Container node VideoTargetRecResult content:
Node Name (Keyword)
Parent Node
Description
Type
BodyRecognition
Response.JobsDetail.Operation.VideoTargetRecResult
Human recognition result
Container array
PetRecognition
Response.JobsDetail.Operation.VideoTargetRecResult
Pet recognition result
Container array
CarRecognition
Response.JobsDetail.Operation.VideoTargetRecResult
Vehicle identification result
Container array
Contents of the Container node BodyRecognition:
Node Name (Keyword)
Parent Node
Description
Type
Time
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition
Screenshot time point, in seconds
String
Url
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition
Screenshot URL
String
BodyInfo
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition
Human recognition result(s)
Container array
Contents of the Container node PetRecognition:
Node Name (Keyword)
Parent Node
Description
Type
Time
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition
Screenshot time point, in seconds
String
Url
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition
Screenshot URL
String
PetInfo
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition
Pet recognition results, possibly multiple
Container array
Contents of the Container node CarRecognition:
Node Name (Keyword)
Parent Node
Description
Type
Time
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition
Screenshot time point, in seconds
String
Url
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition
Screenshot URL
String
CarInfo
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition
Vehicle identification result(s)
Container array
Contents of the Container node BodyInfo node:
Node Name (Keyword)
Parent Node
Description
Type
Name
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo
Recognition type
String
Score
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo
Recognition confidence, value range: [0-100]. Higher value indicates higher probability.
Int
Location
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo
Coordinates of human body detected in figure
Container
Container node Location node content:
Node Name (Keyword)
Parent Node
Description
Type
X
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo.Location
X coordinate
String
Y
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo.Location
Y-axis coordinate
String
Height
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo.Location
(X, Y) coordinate distance height
String
Width
Response.JobsDetail.Operation.VideoTargetRecResult.BodyRecognition.BodyInfo.Location
(X, Y) coordinate distance length
String
Contents of the Container node PetInfo node:
Node Name (Keyword)
Parent Node
Description
Type
Name
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo
Recognition type
String
Score
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo
Recognition confidence, value range: [0-100]. Higher value indicates higher probability.
Int
Location
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo
Coordinates of pet detected in figure
Container
Container node Location node content:
Node Name (Keyword)
Parent Node
Description
Type
X
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo.Location
X coordinate
Int
Y
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo.Location
Y-axis coordinate
Int
Height
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo.Location
(X, Y) coordinate distance height
Int
Width
Response.JobsDetail.Operation.VideoTargetRecResult.PetRecognition.PetInfo.Location
(X, Y) coordinate distance length
Int
Contents of the Container node CarInfo node:
Node Name (Keyword)
Parent Node
Description
Type
Name
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo
Recognition type
String
Score
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo
Recognition confidence, value range: [0-100]. Higher value indicates higher probability.
Int
Location
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo
Coordinates of vehicle detected in figure
Container
Container node Location node content:
Node Name (Keyword)
Parent Node
Description
Type
X
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo.Location
X coordinate
Int
Y
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo.Location
Y-axis coordinate
Int
Height
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo.Location
(X, Y) coordinate distance height
Int
Width
Response.JobsDetail.Operation.VideoTargetRecResult.CarRecognition.CarInfo.Location
(X, Y) coordinate distance length
Int

Error Codes

This request returns common error responses and error codes. For more information, see Error Codes.

Examples

Request 1: Use Video Object Detection Template ID

POST /jobs HTTP/1.1
Authorization:q-sign-algorithm=sha1&q-ak=**********************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=**************************************
Host:test-1234567890.ci.ap-chongqing.myqcloud.com
Content-Length: 166
Content-Type: application/xml

<Request>
<Tag>VideoTargetRec</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON<CallBackFormat>
</Request>

Responding 1

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****

<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId>
<State>Submitted</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>VideoTargetRec</Tag>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<TemplateName>video_target_rec_demo</TemplateName>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

Request 2: Use Video Object Detection Processing Parameters

POST /jobs HTTP/1.1
Authorization:q-sign-algorithm=sha1&q-ak=**********************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=**************************************
Host:test-1234567890.ci.ap-chongqing.myqcloud.com
Content-Length: 166
Content-Type: application/xml

<Request>
<Tag>VideoTargetRec</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<VideoTargetRec>
<Body>true</Body>
<Car>true</Car>
<Pet>true</Pet>
</VideoTargetRec>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON<CallBackFormat>
</Request>

Response 2

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****

<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId>
<State>Submitted</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>VideoTargetRec</Tag>
<Operation>
<VideoTargetRec>
<Body>true</Body>
<Car>true</Car>
<Pet>true</Pet>
</VideoTargetRec>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback