This topic describes the common response parameters and HTTP status codes for calling the Content Moderation API operations.
Common response parameters
Responses to all requests are JSON-formatted data. The following table describes the common response parameters.
Parameter | Type | Required | Description |
---|---|---|---|
code | Integer | Yes | The HTTP status code returned for the moderation task. Some extended error codes are supported.
For more information, see Common error codes. |
msg | String | Yes | The details of the error. |
requestId | String | Yes | The unique ID of the request, which can be used to locate issues. |
data | Integer, String, or JSON object | No | The service-related response data. This parameter may be left empty when an error occurs. Generally, the value is a JSON structure or array. |
Common error codes
Error code | HTTP status code | Description |
---|---|---|
OK | 200 | The message returned because the request was successful. |
PROCESSING | 280 | The error message returned because the task is running. We recommend that you wait for a while and start the query again. For example, you wait for 5 seconds before you start the query again. |
BAD_REQUEST | 400 | The error message returned because the request is invalid. This error is typically caused by invalid request parameters. Check whether the request parameters are valid. |
NOT_ALLOWED | 401 | The error message returned because the URL contained in the request redirects to an insecure image or video. |
FORBIDDEN | 403 | The error message returned because the URL is inaccessible. Check whether the URL can be accessed from the Internet and whether hotlink protection is configured. |
NOT_FOUND | 404 | The error message returned because the content to be moderated cannot be found. This is usually because your image or video content cannot be downloaded. Make sure that the content is accessible from the Internet. |
DOWNLOAD_FAILED | 480 | The error message returned because the download fails. If the size and resolution of the content can be obtained, make sure that the size and resolution are allowed by the API. |
GENERAL_ERROR | 500 | The error message returned because a temporary server error occurs. We recommend that you try again. If the error persists, submit a ticket on Support and Services. |
ServiceUnavailable | 503 | The error message returned because a system error occurs. We recommend that you check whether the domain name in the request is normal. If you confirm that the domain name is normal, submit a ticket on Support and Services. |
DB_FAILED | 580 | The error message returned because an error occurs on database operations. We recommend that you try again. If the error persists, submit a ticket on Support and Services. |
TIMEOUT | 581 | The error message returned because the operation times out. We recommend that you try again. If the error persists, submit a ticket on Support and Services. |
CACHE_FAILED | 585 | The error message returned because a cache error occurs. We recommend that you try again. If the error persists, submit a ticket on Support and Services. |
ALGO_FAILED | 586 | The error message returned because an algorithm error occurs. Submit a ticket on Support and Services. |
MQ_FAILED | 587 | The error message returned because a middleware error occurs. Submit a ticket on Support and Services. |
EXCEED_QUOTA | 588 | The error message returned because the number of requests exceeds the quota. The default quota for moderation is 50 images per second, 20 channels of videos per second, 20 channels of audio per second, or 100 entries of text per second. The default quota for OCR is 10 images per second. If you want to adjust the quota, submit a ticket on Support and Services. |
TOO_LARGE | 589 | The error message returned because the content to be moderated is too large in size. Make sure that the content size is allowed by the API. We recommend that you try again. If the error persists, submit a ticket on Support and Services. |
BAD_FORMAT | 590 | The error message returned because the content to be moderated is in an invalid format. Make sure that the format of the content is allowed by the API. |
CONNECTION_POOL_FULL | 591 | The error message returned because the connection pool is full. Submit a ticket on Support and Services. |
DOWNLOAD_TIMEOUT | 592 | The error message returned because the download times out. The download duration is limited to 3 seconds. Make sure that the size of the moderated content is allowed by the API. |
EXPIRED | 594 | The error message returned because the task expires. For example, the task ID expires. |
CATCH_FRAME_FAILED | 595 | The error message returned because video snapshot fails to be captured. Submit a ticket on Support and Services. |
PERMISSION_DENY | 596 | The error message returned because the account is not activated, unauthorized, disabled, or has overdue payments. For more information, see the returned message. |