微信第三方平台发布小程序返回47001 data format error错误
发布于 6 年前 作者 jiamin 16706 次浏览 来自 问答

请求方式: POST(请使用https协议)

https://api.weixin.qq.com/wxa/release?access_token=TOKEN


POST数据示例:

{ }


参数说明:

请填写空的数据包,POST的json数据包为空即可。

我的PHP代码如下:

$params=[];
$res = wxSend(self::RELEASE.$this->accessToken,json_encode($params));

返回结果:

array(2) {
  ["errcode"] => int(47001)
  ["errmsg"] => string(40) "data format error hint: [1ezoVa0568e626]"
}

请问是POST参数不对吗?正确的应该是如何的?

1 回复
{
    "extEnable": true,
    "extAppid": "授权小程序",
    "directCommit": false,
    "ext": {},
    "extPages": {},
    "window": {},
    "tabBar": {},
    "networkTimeout": {}
}

要把上方JSON对象1转为JSON字符串,再填入下方JSON对象2

{
    "template_id": 1,
    "ext_json": "JSON字符串填在这里",
    "user_version": "",
    "user_desc": ""
}

最后请求 https://api.weixin.qq.com/wxa/release?access_token=TOKEN 把JSON对象2POST过去就好了。

回到顶部