Creating an Audio Moderation Job
Function
This API is used to create an audio moderation job. After the job is created, the job ID is returned.
URI
POST /v3/{project_id}/moderation/audio/jobs
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
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.) |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
data |
Yes |
AudioInputBody object |
Audio data input |
event_type |
No |
String |
Event type. The options are as follows:
|
categories |
No |
Array of strings |
Types of risks to be detected. The list cannot be empty. The risk types are as follows:
|
callback |
No |
String |
HTTP callback interface. If this field is not null, the callback interface is invoked to notify you of the moderation result. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
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 |
job_id |
String |
Unique job ID |
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
![](https://support.huaweicloud.com/intl/en-us/api-moderation/public_sys-resources/note_3.0-en-us.png)
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. For details about how to obtain the project ID, see Obtaining a Project ID.
Create a default audio moderation job with event_type set to default to detect pornographic content and advertisements.
POST https://{endpoint}/v3/{project_id}/moderation/audio/jobs { "data" : { "url" : "https://xxxxx.wav" }, "event_type" : "default", "categories" : [ "porn", "ad" ], "callback" : "http://xxxx" }
Example Response
Status code: 200
Example of a successful response
{ "job_id" : "01661356800_7c0fe871f80543358917e4faebca4a48", "request_id" : "07490f57ac5e034c077ab25b5f9e1da5" }
Status code: 400
Example of a failed response
{ "error_code": "AIS.0401", "error_msg": "The input parameter event_type is incorrect." }
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