GetSmartHandleJob

更新时间:
复制 MD 格式

Retrieves the information and execution result for a smart task by task ID. This API only supports querying editing tasks from the past year.

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

ice:GetSmartHandleJob

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

JobId

string

No

The job ID.

****20b48fb04483915d4f2cd8ac****

Response elements

Element

Type

Description

Example

object

The schema of the response.

RequestId

string

The request ID.

******11-DB8D-4A9A-875B-275798******

JobId

string

The job ID.

****20b48fb04483915d4f2cd8ac****

Output

string

The output of the job.

{}

JobResult

object

The job result.

MediaId

string

The media ID.

****20b48fb04483915d4f2cd8ac****

AiResult

string

The AI result.

拆条或智能标签信息

Usage

string

The token usage. This parameter is returned only for keyword expansion jobs.

{"total_tokens":100}

MediaUrl

string

The URL of the output media file generated by the smart job.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4

State

string

The state of the job.

Valid values:

  • Finished :

    The job is complete.

  • Failed :

    The job failed.

  • Executing :

    The job is running.

  • Created :

    The job is created.

Finished

UserData

string

The user data.

{"user":"data"}

SmartJobInfo

object

The smart job information.

Title

string

The job title.

Test title

Description

string

The job description.

Test description

UserId

string

The user ID.

1974526429******

InputConfig

object

The input configuration.

InputFile

string

The Object Storage Service (OSS) URL of the input file or the media ID.

oss://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 or ******11-DB8D-4A9A-875B-275798******

OutputConfig

object

The output configuration.

Bucket

string

The OSS bucket.

test-bucket

Object

string

The OSS object.

test-object

CreateTime

string

The creation time.

2020-12-26T04:11:10Z

ModifiedTime

string

The modification time.

2020-12-26T04:11:10Z

JobType

string

The job type.

ASR

ErrorCode

string

The error code. This parameter is returned only if the job fails.

SpeechTranslationNoValidVocal

ErrorMessage

string

The error message. This parameter is returned only if the job fails.

The speech translation job failed due to lack of valid vocal voice data.

The result format varies depending on the type of smart job. The following examples show the response bodies for different smart jobs.

ASR smart captioning

{
  "RequestId": "******2D-443C-5043-B0E4-867070******",
  "JobId": "******042d5e4db6866f6289d1******",
  "State": "Finished",
  "SmartJobInfo": {
    "JobType": "ASR",
    "ModifiedTime": "2022-01-21T06:15:08Z",
    "CreateTime": "2022-01-21T06:15:02Z",
    "Title": "default_title_2022-01-21T06:15:02Z",
    "InputConfig": {
      "JobParameters": "{\"duration\":\"00:30:00\",\"start_time\":\"00:00:00\",\"request_params\":\"&enable_word_level_result=true\"}",
      "InputFile": "oss://your-bucket.oss-cn-shanghai.aliyuncs.com/your-video.mp4"
    }
  },
  "JobResult": {
    "AiResult": "[{\"content\":\"Speaking of which, he\",\"from\":0.0,\"to\":0.846},{\"content\":\"is now incredibly popular.\",\"from\":0.846,\"to\":3.386},{\"content\":\"Tickets are often very expensive,\",\"from\":3.386,\"to\":4.402},{\"content\":\"but they sell out instantly upon release.\",\"from\":4.402,\"to\":6.265},{\"content\":\"He also participates in various crosstalk variety shows to comment on new performers and has already...\",\"from\":6.265,\"to\":10.33}]"
  }
}

Text-to-speech

{
  "RequestId": "******2D-443C-5043-B0E4-867070******",
  "JobId": "******042d5e4db6866f6289d1******",
  "State": "Finished",
  "SmartJobInfo": {
    "Title": "default_title_2022-01-21T06:15:07Z",
    "JobType": "TextToSpeech",
    "CreateTime": "2022-01-21T06:15:07Z",
    "ModifiedTime": "2022-01-21T06:15:07Z",
    "InputConfig": {
      "InputFile": "Speaking of which, he is now incredibly popular. Tickets are often very expensive, but they sell out instantly upon release. He also participates in various crosstalk variety shows to comment on new performers and has already..."
    },
    "EditingConfig": "{\"format\":\"MP3\",\"pitch_rate\":0,\"sample_rate\":16000,\"speech_rate\":0,\"voice\":\"Siqi\",\"volume\":50}",
    "OutputConfig": {
      "Bucket": "your-bucket",
      "Object": "your-audio"
    }
  },
  "JobResult": {
    "MediaId": "******bf47c94e82b3b2014361******",
    "AiResult": "[{\"content\":\"Speaking of which, he\",\"from\":0.0,\"to\":0.846},{\"content\":\"is now incredibly popular.\",\"from\":0.846,\"to\":3.386},{\"content\":\"Tickets are often very expensive,\",\"from\":3.386,\"to\":4.402},{\"content\":\"but they sell out instantly upon release.\",\"from\":4.402,\"to\":6.265},{\"content\":\"He also participates in various crosstalk variety shows to comment on new performers and has already...\",\"from\":6.265,\"to\":10.33}]"
  }
}

Text generation

{
	"RequestId":"******AC-5A01-1116-87A4-BF86F2******",
	"UserData":"{\"NotifyAddress\":\"https://****\"}",
	"JobResult":{
		"AiResult":"[\"Try the cakes from our new store, made with pure, real cream for a rich, silky-smooth texture. Every bite is a sweet surprise that lets your taste buds dance with freshness and purity!\",\"Explore a new world of desserts. Our new store's cakes feature premium real cream, offering a low-sugar, non-cloying flavor with rich layers. Each cake tells a sweet story of craftsmanship, waiting for you to discover.\",\"For those who appreciate the finer things in life: our new cake shop uses carefully selected real cream with no artificial additives. Enjoy the pure, fragrant aroma and a light, fluffy texture. Every bite is a celebration of the good life.\"]",
    "Usage": "{\"total_tokens\":200}"
	},
	"State":"Finished",
	"JobId":"******8c784f461db57c99c9d9******",
	"SmartJobInfo":{
		"JobType":"TextGenerate",
		"ModifiedTime":"2024-01-17T08:46:17Z",
		"CreateTime":"2024-01-17T08:46:17Z",
		"Title":"default_title_2024-01-17T08:46:17Z",
		"EditingConfig":"{\"Type\":\"MarketingCopy\",\"GenerateConfig\":\"{\\\"keywords\\\":\\\"new cake shop, real cream\\\",\\\"textLength\\\":100,\\\"targetCount\\\":3}\"}"
	}
}

Examples

Success response

JSON format

{
  "RequestId": "******11-DB8D-4A9A-875B-275798******",
  "JobId": "****20b48fb04483915d4f2cd8ac****",
  "Output": "{}",
  "JobResult": {
    "MediaId": "****20b48fb04483915d4f2cd8ac****",
    "AiResult": "拆条或智能标签信息",
    "Usage": "{\"total_tokens\":100}",
    "MediaUrl": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4"
  },
  "State": "Finished",
  "UserData": "{\"user\":\"data\"}",
  "SmartJobInfo": {
    "Title": "Test title",
    "Description": "Test description",
    "UserId": "1974526429******",
    "InputConfig": {
      "InputFile": "oss://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 or ******11-DB8D-4A9A-875B-275798******"
    },
    "OutputConfig": {
      "Bucket": "test-bucket",
      "Object": "test-object"
    },
    "CreateTime": "2020-12-26T04:11:10Z",
    "ModifiedTime": "2020-12-26T04:11:10Z",
    "JobType": "ASR"
  },
  "ErrorCode": "SpeechTranslationNoValidVocal",
  "ErrorMessage": "The speech translation job failed due to lack of valid vocal voice data."
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.