Task Submission
Update:
Parameter Specification
- Request URL:
https://isafe.ilivedata.com/api/v2/image/check/async
- Description:
Asynchronous image moderation API. After an image is submitted, it will be moderated and the result will be returned via callback. Callback can be configured in Console - Service Configuration or passed via request parameters.
-
Image requirements:
- Supported types: URL, BASE64
- Supported formats: jpg, png, bmp, gif, webp, tiff, heic
- Supported image size: < 10M
- Description of gif/long image: Automatically cut gif/long image (ratio of length and width greater than 5) into frames and check, up to 5 images. Gif/long images are billed according to the actual number of screenshots.
-
HTTP request Header:
Header
Value
Description
Content-Type
application/json;charset=UTF-8
Request body type
Accept
application/json;charset=UTF-8
Return type accepted
X-AppId
The unique identifier of the project, from Console - Service Configuration
X-TimeStamp
The UTC timestamp of the request, formatted per W3C, e.g. 2010-01-31T23:59:59Z. (http://www.w3.org/TR/xmlschema-2/#dateTime)
Authorization
Signature value
-
Request method: POST
-
Request body JSON object:
Parameter
Required
Type
Description
type
Required
Number
Image content type: 1: image URL; 2: image BASE64 value
image
Required
String
Image content. When type=1 it is the image URL; when type=2 it is the image BASE64 value
strategyId
Optional
String
Strategy ID; uses default strategy DEFAULT when not provided
checkTags
Optional
List<Number>
Restrict detection categories, supports first-level categories enabled in the strategy
referImage
Optional
String
Reference image for face comparison, type must match image. Supported formats: jpg, png; size < 10M
userId
Optional
String
Unique end user ID, no more than 32 characters
extra
Optional
json
Extension fields transparently passed through, multiple key/value pairs. No more than 20 key/value pairs; a single key must not be nested more than 3 levels deep. If exceeded, the audit log will not record the extra value for this task, but extra transparent passthrough in the response is unaffected
callbackUrl
Optional
String
Callback URL (http)
callbackSecretKey
Optional
String
Callback signature key, must match the key used for callback verification
- Example of request body:
{
"type": 1,
"image": "http://abc.com/a.jpg",
"userId": "123",
"callbackUrl": "http://your.callback.url/callback"
}
- Request signature:
This API requires the Authorization signature in the request Header. For the signature calculation rule, see Request Signature. Use /api/v2/image/check/async as HTTPRequestURI.
HTTP Response
Content-Type: application/json;charset=UTF-8
The result is in JSON format.
- Response fields:
Field
Type
Description
errorCode
Number
Error code: 0 means success
errorMessage
String
Error message
taskId
String
Task ID, used to query the result or associate with the callback
- Example of response:
{
"errorCode": 0,
"taskId": "ap_99b2bf004d4a4591bfedbba9574e74d4_1702882338368"
}
Error Codes
See Common Exception Codes in Help Center
Parameter Specification
- Request URL:
https://isafe.ilivedata.com/api/v2/image/check/async
- Description:
Asynchronous image moderation API. After an image is submitted, it will be moderated and the result will be returned via callback. Callback can be configured in Console - Service Configuration or passed via request parameters.
-
Image requirements:
- Supported types: URL, BASE64
- Supported formats: jpg, png, bmp, gif, webp, tiff, heic
- Supported image size: < 10M
- Description of gif/long image: Automatically cut gif/long image (ratio of length and width greater than 5) into frames and check, up to 5 images. Gif/long images are billed according to the actual number of screenshots.
-
HTTP request Header:
| Header | Value | Description |
|---|---|---|
| Content-Type | application/json;charset=UTF-8 | Request body type |
| Accept | application/json;charset=UTF-8 | Return type accepted |
| X-AppId | The unique identifier of the project, from Console - Service Configuration | |
| X-TimeStamp | The UTC timestamp of the request, formatted per W3C, e.g. 2010-01-31T23:59:59Z. (http://www.w3.org/TR/xmlschema-2/#dateTime) | |
| Authorization | Signature value |
-
Request method: POST
-
Request body JSON object:
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Required | Number | Image content type: 1: image URL; 2: image BASE64 value |
| image | Required | String | Image content. When type=1 it is the image URL; when type=2 it is the image BASE64 value |
| strategyId | Optional | String | Strategy ID; uses default strategy DEFAULT when not provided |
| checkTags | Optional | List<Number> | Restrict detection categories, supports first-level categories enabled in the strategy |
| referImage | Optional | String | Reference image for face comparison, type must match image. Supported formats: jpg, png; size < 10M |
| userId | Optional | String | Unique end user ID, no more than 32 characters |
| extra | Optional | json | Extension fields transparently passed through, multiple key/value pairs. No more than 20 key/value pairs; a single key must not be nested more than 3 levels deep. If exceeded, the audit log will not record the extra value for this task, but extra transparent passthrough in the response is unaffected |
| callbackUrl | Optional | String | Callback URL (http) |
| callbackSecretKey | Optional | String | Callback signature key, must match the key used for callback verification |
- Example of request body:
{
"type": 1,
"image": "http://abc.com/a.jpg",
"userId": "123",
"callbackUrl": "http://your.callback.url/callback"
}
- Request signature:
This API requires the Authorization signature in the request Header. For the signature calculation rule, see Request Signature. Use /api/v2/image/check/async as HTTPRequestURI.
HTTP Response
Content-Type: application/json;charset=UTF-8
The result is in JSON format.
- Response fields:
| Field | Type | Description |
|---|---|---|
| errorCode | Number | Error code: 0 means success |
| errorMessage | String | Error message |
| taskId | String | Task ID, used to query the result or associate with the callback |
- Example of response:
{
"errorCode": 0,
"taskId": "ap_99b2bf004d4a4591bfedbba9574e74d4_1702882338368"
}
Error Codes
See Common Exception Codes in Help Center