Outfit Change
Description
This API is used for ID Photo - Outfit Change requests. For specific effects, please refer to the details in the following documentation.
Version
1.0
Image Requirements
Image formats: JPG, PNG
Changelog
Request URL
Production environment: https://openapi.meitu.com/idphoto/business/v1/change_clothes
Request Method
POST
The request header type should include: Content-Type:application/json
Permission
Request Parameters
| Parameter Name | Type | Maximum Length | Required | Remarks |
|---|---|---|---|---|
| out_request_id | string | 64 | Yes | External request ID (unique) |
| mt_generate_id | string | 19 | Yes | Meitu ID photo generation ID |
| clothes_id | int | - | Yes | Clothing ID (contact Meitu Business to obtain) |
| back_color | string | 7 | Yes | Background color value |
| back_mode | int | - | Yes | Background mode: 0 solid color, 1 top to bottom, 2 outside to inside, 3 inside to outside |
| custom_watermark_vertical | string | 200 | No | Custom vertical watermark identifier, applicable to ID photos (contact Meitu Business for configuration) |
| custom_watermark_transverse | string | 200 | No | Custom horizontal watermark identifier, applicable to typesetting photos (contact Meitu Business for configuration) |
| keep_original_hair_type | string | 2 | No | Automatic hair completion switch. This parameter takes effect when the plus_version API is v2. Default: 0 - automatically complete hair, 1 - keep the original hair without completion. (When the user's original hairstyle is relatively short and irregular gaps are likely to appear on both sides of the neck or above the shoulders after changing the outfit, hair can be automatically completed.) |
Request Example
{
"back_color": "#00868B",
"back_mode": 3,
"mt_generate_id":"1712652640552366000",
"out_request_id":"36936",
"clothes_id":3,
"keep_original_hair_type":"1"
}Return Value Description
Successful Return Value Description
| Field Name | Type | Example Value | Description |
|---|---|---|---|
| code | int | 100000 | Response status code |
| msg | string | Operation successful | Prompt |
| data | object | Data | |
| data.mt_generate_id | string | ||
| data.sd_photo | string | http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627569878737-460912.jpg?xxxxxxxxx | Standard-definition image |
| data.hd_photo | string | http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627569878737-460912.jpg?xxxxxxxxx | High-definition image |
| data.typesetting_photo | string | http://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627569878737-460912.jpg?xxxxxxxxx | Typesetting photo |
Failed Return Value Description
| Field | Type | Description |
|---|---|---|
| data | String | Returned content |
| message | String | Error message |
| code | Int | Error code |
Return Value Example
Successful Request Return Example
Response Status: 200
content-type is application/json; charset=utf-8
{
"code": 100000,
"data": {
"mt_generate_id": "6917420196238201567",
"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/1646220627569878737-460912.jpg"
},
"msg": "success"
}Return Status Codes
| Status Code | Description |
|---|---|
| 100000 | Success |
| 100001 | Parameter error |
Error Codes and Information
- For descriptions of billing rules, error codes, msg, and other content related to this API, please refer to Billing & Status Code Description