跳到正文

获取证件照(无水印)

根据制作结果的 pic_id 获取无水印证件照,支持指定换装服装。

接口地址:https://api.zjzapi.com/idcardv5/get

请求方式:POST(application/x-www-form-urlencoded)

返回格式:json

接口费用:获取成功扣除0.6元,重复获取不扣费。

请求参数:

名称 必填 类型 说明
key 是 string 应用的key
pic_id 是 string 制作接口返回的pic_id,有效期50分钟。
clothes_key 否 string 换装接口使用的clothe(即将停用,请使用新字段)
clothe 否 string 换装接口使用的clothe
gift_hd 否 int 1=赠送一张三寸高清照,0或者不传则不会返回(规格width_px<500才会返回;更换底色、自定义制作暂不支持)。
gift_hd_color 否 string 高清照底色,不传默认返回当前制作结果第一个底色。

返回参数:

名称 类型 说明
code int 状态码
msg string 返回说明
data array 数据集

JSON返回示例:


{
    "data": {
        "pic_id": "9244614",
        "list": {
             "white": "http://demo.com/pic/20200511/913191c8906ce81a2107d6ff5157c014/white.jpg"
        },
        "gift_hd": "http://demo.com/pics/20200511/913191c8906ce81a2107d6ff5157c014/gift_hd.jpeg" # 开启赠送高清照才会返回
    },
    "code": 0,
    "msg": "success"
}

请求示例代码:

请替换占位值后在服务端运行;凭据和应用 key 不要放入浏览器代码。HTTP 成功后仍需按接口文档检查业务 code。

# Bash / zsh,cURL 7.76+;Windows 可使用 Git Bash 或 WSL。
curl --fail-with-body --max-time 60 --request POST 'https://api.zjzapi.com/idcardv5/get' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'key=YOUR_APP_KEY' \
  --data-urlencode 'pic_id=YOUR_PIC_ID'