Querying an Audio Moderation Job
Function
This API is used to query the processing status and result of an audio review job and return the recognition result to you.
URI
GET /v3/{project_id}/moderation/audio/jobs/{job_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
job_id |
Yes |
String |
Job ID returned when a job is created |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token, which can be obtained by calling the IAM API (The token is the value of X-Subject-Token in the response header.) |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Job ID |
status |
String |
Job status. The options are as follows:
|
result |
result object |
Job review result. This parameter is available when the job status is succeeded. |
request_params |
request_params object |
Parameters for creating the job |
create_time |
String |
Time when the job was created |
update_time |
String |
Time when the job was updated |
request_id |
String |
Unique ID of the request, which is used for troubleshooting. You are advised to save the ID. Minimum length: 2 Maximum length: 64 |
Parameter |
Type |
Description |
---|---|---|
suggestion |
String |
Whether the audio clip passes the check
|
details |
Array of details objects |
Review details |
audio_text |
String |
Audio text |
Parameter |
Type |
Description |
---|---|---|
start_time |
Float |
Start time of the audio clip |
suggestion |
String |
Suggestion for moderating the audio clip
|
end_time |
Float |
End time of the audio clip |
label |
String |
Audio clip label. The options are as follows:
|
audio_text |
String |
Text of the audio clip |
segments |
Array of segments objects |
List of hit risk segments. This field is unavailable if semantic algorithm models are hit. |
Parameter |
Type |
Description |
---|---|---|
event_type |
String |
Parameter event_type for creating the job |
data |
data object |
Parameter data for creating the job |
callback |
String |
Parameter callback for creating the job |
categories |
Array of strings |
Parameter categories for creating the job |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code of a failed API call. For details, see Error Codes. This parameter is not included when the API is successfully called. |
error_msg |
String |
Error message of a failed API call. This parameter is not included when the API is successfully called. |
Example Request
endpoint is the request URL for calling an API. Endpoints vary depending on services and regions. For details, see Endpoints.
For example, if the service is deployed in the CN North-Beijing4 region, the endpoint is moderation.cn-north-4.myhuaweicloud.com and the request URL is https://moderation.cn-north-4.myhuaweicloud.com/v3/{project_id}/moderation/audio/jobs/{job_id}. For details about how to obtain the project ID, see Obtaining a Project ID. job_id is the job ID returned when the job is created successfully.
GET https://{endpoint}/v3/{project_id}/moderation/audio/jobs/{job_id}
Example Response
Status code: 200
Job status and result returned when the query is successful
{ "job_id" : "01655654400_ad96b30f58cc40e8968e53f1f1e80021", "status" : "succeeded", "result" : { "suggestion" : "block", "details" : [ { "start_time" : 0, "suggestion" : "block", "end_time" : 10, "label" : "porn", "audio_text" : "xxxx", "segments" : [ { "segment" : "xxx" }, { "segment" : "xxx" }, { "segment" : "xxx" } ] }, { "start_time" : 30, "suggestion" : "block", "end_time" : 40, "label" : "porn", "audio_text" : "xxx", "segments" : [ { "segment" : "xx" } ] } ], "audio_text" : "xxxxxx" }, "request_params" : { "event_type" : "default", "data" : { "url" : "https://xxxx.wav" }, "callback" : "http://xxx", "categories" : [ "porn", "ad" ] }, "create_time" : "2022-06-20 11:05:29", "update_time" : "2022-06-20 11:07:08", "request_id" : "2419446b1fe14203f64e4018d12db3dd" }
Status code: 400
Error cause returned when the query fails
{ "error_code" : "AIS.0030", "error_msg" : "Job not found" }
Status Codes
Status Code |
Description |
---|---|
200 |
Example of a successful response |
400 |
Example of a failed response |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot