# 查询小程序用户隐私保护指引

  • 本接口用于查询第三方代开发小程序的用户隐私保护指引,也可以用来查询有哪些privacy_key可以进行配置

  • 使用过程中如遇到问题,可在开放平台服务商专区发帖交流。

# 请求地址

POST https://api.weixin.qq.com/cgi-bin/component/getprivacysetting?access_token=ACCESS_TOKEN

# 请求参数说明

参数 类型 必填 说明
access_token string 第三方平台接口调用令牌authorizer_access_token
privacy_ver int 1表示现网版本,即,传1则该接口返回的内容是现网版本的;2表示开发版,即,传2则该接口返回的内容是开发版本的。默认是2。

说明:

1、开发版指的是通过setprivacysetting接口已经配置的用户隐私保护指引内容,但是还没发布到现网,还没正式生效的版本。

2、现网版本指的是已经在小程序现网版本已经生效的用户隐私保护指引内容。

请求示例:

  • 如果不传privacy_ver,要传个空的json,否则会报错
{
    "privacy_ver":2
}

# 返回参数说明

参数 类型 说明
errcode Number 返回码
errmsg String 错误信息
code_exist int 代码是否存在, 0 不存在, 1 存在 。如果最近没有通过commit接口上传代码,则会出现 code_exist=0的情况。
privacy_list array 代码检测出来的用户信息类型(privacy_key)
setting_list arrary object 要收集的用户信息配置
update_time timestamp 更新时间
owner_setting object 收集方(开发者)信息配置
privacy_desc arrary object 用户信息类型对应的中英文描述

# setting_list结构体

参数 类型 说明
privacy_key String 用户信息类型的英文名称
privacy_text String 该用户信息类型的用途
privacy_label String 用户信息类型的中文名称

# owner_setting结构体

参数 类型 说明
contact_email string 信息收集方(开发者)的邮箱
contact_phone string 信息收集方(开发者)的手机号
contact_qq String 信息收集方(开发者)的qq
contact_weixin String 信息收集方(开发者)的微信号
notice_method String 通知方式,指的是当开发者收集信息有变动时,通过该方式通知用户
store_expire_timestamp String 存储期限,指的是开发者收集用户信息存储多久
ext_file_media_id String 自定义 用户隐私保护指引文件的media_id

# privacy_desc结构体

参数 类型 说明
privacy_desc_list arrary object 用户信息类型

# privacy_desc_list结构体

参数 类型 说明
privacy_desc string 用户信息类型的中文描述
privacy_key string 用户信息类型的英文key

返回结果示例:


 {
    "errcode": 0,
    "errmsg": "ok",
    "code_exist": 1,
    "privacy_list": [
        "UserInfo",
        "Location",
        "Address",
        "Invoice",
        "RunData",
        "Record",
        "Album",
        "Camera",
        "Contact",
        "AlbumWriteOnly",
        "BlueTooth",
        "CalendarWriteOnly",
        "MessageFile"
    ],
    "setting_list": [
        {
            "privacy_key": "EXIDNumber",
            "privacy_text": "登记会员信息",
            "privacy_label": ""
        },
        {
            "privacy_key": "UserInfo",
            "privacy_text": "展示你的美貌",
            "privacy_label": ""
        },
        {
            "privacy_key": "Location",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "Address",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "Invoice",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "RunData",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "Record",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "Album",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "Camera",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "Contact",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "AlbumWriteOnly",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "BlueTooth",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "CalendarWriteOnly",
            "privacy_text": "",
            "privacy_label": ""
        },
        {
            "privacy_key": "MessageFile",
            "privacy_text": "",
            "privacy_label": ""
        }
    ],
    "update_time": 1635690987,
    "owner_setting": {
        "contact_phone": "",
        "contact_email": "melodytu@qq.com",
        "contact_qq": "",
        "contact_weixin": "",
        "store_expire_timestamp": "",
        "ext_file_media_id": "2115480798219862023",
        "notice_method": ""
    },
    "privacy_desc": {
        "privacy_desc_list": [
            {
                "privacy_key": "UserInfo",
                "privacy_desc": "用户信息(微信昵称、头像)"
            },
            {
                "privacy_key": "Location",
                "privacy_desc": "位置信息"
            },
            {
                "privacy_key": "Address",
                "privacy_desc": "地址"
            },
            {
                "privacy_key": "Invoice",
                "privacy_desc": "发票信息"
            },
            {
                "privacy_key": "RunData",
                "privacy_desc": "微信运动数据"
            },
            {
                "privacy_key": "Record",
                "privacy_desc": "麦克风"
            },
            {
                "privacy_key": "Album",
                "privacy_desc": "选中的照片或视频信息"
            },
            {
                "privacy_key": "Camera",
                "privacy_desc": "摄像头"
            },
            {
                "privacy_key": "PhoneNumber",
                "privacy_desc": "手机号"
            },
            {
                "privacy_key": "Contact",
                "privacy_desc": "通讯录(仅写入)权限"
            },
            {
                "privacy_key": "DeviceInfo",
                "privacy_desc": "设备信息"
            },
            {
                "privacy_key": "EXIDNumber",
                "privacy_desc": "身份证号码"
            },
            {
                "privacy_key": "EXOrderInfo",
                "privacy_desc": "订单信息"
            },
            {
                "privacy_key": "EXUserPublishContent",
                "privacy_desc": "发布内容"
            },
            {
                "privacy_key": "EXUserFollowAcct",
                "privacy_desc": "所关注账号"
            },
            {
                "privacy_key": "EXUserOpLog",
                "privacy_desc": "操作日志"
            },
            {
                "privacy_key": "AlbumWriteOnly",
                "privacy_desc": "相册(仅写入)权限"
            },
            {
                "privacy_key": "LicensePlate",
                "privacy_desc": "车牌号"
            },
            {
                "privacy_key": "BlueTooth",
                "privacy_desc": "蓝牙"
            },
            {
                "privacy_key": "CalendarWriteOnly",
                "privacy_desc": "日历(仅写入)权限"
            },
            {
                "privacy_key": "Email",
                "privacy_desc": "邮箱"
            },
            {
                "privacy_key": "MessageFile",
                "privacy_desc": "选中的文件"
            }
        ]
    }
}


# 返回码说明

返回码 errmsg 说明
0 ok 查询成功
其他错误码 请查看全局错误码