Portrait Symmetry
Description
This API is used for ID Photo - Portrait Symmetry requests. For details on the specific effects, please refer to the documentation below.
Version
1.0
Image Requirements
Image formats: JPG, PNG
Changelog
Request URL
Production environment: https://openapi.meitu.com/idphoto/business/v1/mtee
Request Method
POST
The request header must include:
Content-Type: application/json
Authorization
Credits cannot be used to pay for API calls. Please visit the MV console to activate this API and purchase or manage resource packages.
Request Parameters
| Parameter | Type | Maximum Length | Required | Description |
|---|---|---|---|---|
| out_request_id | string | 64 | Yes | External request ID (unique) |
| img_url | string | 200 | No | Image URL (full URL; URL encoding is required) |
| mt_generate_id | string | 64 | No | Meitu ID Photo generation ID |
| custom_watermark | string | 200 | No | Custom portrait watermark identifier (contact Meitu Business for configuration) |
| custom_watermark_transverse | string | 200 | No | Custom landscape watermark identifier (contact Meitu Business for configuration) |
| mt_check_id | string | 64 | No | If the partner integrates the detection API /idphoto/business/check, the detection identifier returned by that API will be obtained. This identifier can be used in other image generation APIs to skip image uploading and detection. |
Note:
- Exactly one of
img_urlandmt_check_idmust be provided. The API will determine which image to process based on the provided parameter.- This API includes basic built-in image detection capabilities. If the partner requires more granular detection, the detection API
/idphoto/business/checkcan be integrated.
Request Example
{
"out_request_id": "36936",
"img_url": "https://b735174-258817.png"
}Response Description
Successful Response
| Field | Type | Example Value | Description |
|---|---|---|---|
| code | int | 100000 | Response status code |
| msg | string | Success | Message |
| data | object | Data | |
| data.img_url | string | URL of the generated image | |
| data.mt_generate_id | string | Meitu generation ID | |
| data.sd_photo | string | URL of the generated image (standard definition) | |
| data.hd_photo | string | URL of the generated image (high definition) | |
| data.typesetting_photo | string | URL of the generated image (typeset) |
Failed Response
| Field | Type | Description |
|---|---|---|
| data | String | Returned content |
| message | String | Error message |
| code | Int | Error code |
Response Examples
Successful Response Example
Response Status: 200
Content-Type: application/json; charset=utf-8
# When mt_generate_id is provided and img_url is empty:
{
"code": 100000,
"data": {
"mt_generate_id": "6917420196238201561",
"img_url": "http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627572213824-781934.jpg",
"sd_photo": "http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627572213824-781934.jpg",
"hd_photo": "http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627572213824-781934.jpg",
"typesetting_photo": "http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627572213824-781934.jpg"
},
"msg": "success"
}
# When mt_generate_id is empty and img_url is provided:
{
"code": 100000,
"data": {
"mt_generate_id": "6917420196238201561",
"img_url": "http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627572213824-781934.jpg",
"sd_photo": "",
"hd_photo": "",
"typesetting_photo": ""
},
"msg": "success"
}Response Status Codes
| Status Code | Description |
|---|---|
| 100000 | Success |
| 100001 | Invalid parameters |
Error Codes and Messages
- For details on billing rules, error codes,
msg, and other information related to this API, see Billing & Status Code Description.