Gaze Correction

Description

This API is used for ID Photo - Gaze Correction 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/gaze_redirect

Request Method

POST

The request header must include:

Content-Type: application/json

Authorization

Open Platform API Signature

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

ParameterTypeMaximum LengthRequiredDescription
out_request_idstring64YesExternal request ID (unique)
img_urlstring200NoImage URL (full URL; URL encoding is required)
mt_generate_idstring64NoMeitu ID Photo generation ID
custom_watermarkstring200NoCustom portrait watermark identifier (contact Meitu Business for configuration)
custom_watermark_transversestring200NoCustom landscape watermark identifier (contact Meitu Business for configuration)
mt_check_idstring64NoIf 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:

  1. Exactly one of img_url, mt_generate_id, and mt_check_id must be provided. The API will determine which image to process based on the provided parameter.
  2. This API includes basic built-in image detection capabilities. If the partner requires more granular detection, the detection API /idphoto/business/check can be integrated.

Request Example

{
    "out_request_id": "36936",
    "img_url": "https://258817.png"
}

Response Description

Successful Response

FieldTypeExample ValueDescription
codeint100000Response status code
msgstringSuccessMessage
data.img_urlstringURL of the generated image
data.mt_generate_idstringMeitu generation ID
data.sd_photostringURL of the generated image (standard definition)
data.hd_photostringURL of the generated image (high definition)
data.typesetting_photostringURL of the generated image (typeset)

Failed Response

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

Error Codes and Messages

  1. For details on billing rules, error codes, msg, and other information related to this API, see Billing & Status Code Description.