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

Open Platform API Signature

Request Parameters

Parameter NameTypeMaximum LengthRequiredRemarks
out_request_idstring64YesExternal request ID (unique)
mt_generate_idstring19YesMeitu ID photo generation ID
clothes_idint-YesClothing ID (contact Meitu Business to obtain)
back_colorstring7YesBackground color value
back_modeint-YesBackground mode: 0 solid color, 1 top to bottom, 2 outside to inside, 3 inside to outside
custom_watermark_verticalstring200NoCustom vertical watermark identifier, applicable to ID photos (contact Meitu Business for configuration)
custom_watermark_transversestring200NoCustom horizontal watermark identifier, applicable to typesetting photos (contact Meitu Business for configuration)
keep_original_hair_typestring2NoAutomatic 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 NameTypeExample ValueDescription
codeint100000Response status code
msgstringOperation successfulPrompt
dataobjectData
data.mt_generate_idstring
data.sd_photostringhttp://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627569878737-460912.jpg?xxxxxxxxxStandard-definition image
data.hd_photostringhttp://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627569878737-460912.jpg?xxxxxxxxxHigh-definition image
data.typesetting_photostringhttp://biz-res-pre.zone1.meitudata.com/idphoto-private/1646220627569878737-460912.jpg?xxxxxxxxxTypesetting photo

Failed Return Value Description

FieldTypeDescription
dataStringReturned content
messageStringError message
codeIntError 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 CodeDescription
100000Success
100001Parameter error

Error Codes and Information

  1. For descriptions of billing rules, error codes, msg, and other content related to this API, please refer to Billing & Status Code Description