提交的参数是:
{"coverImg":"WYuKkWB8n0mF-W3bcqZTCrxU-XwcEU8ym1E0sh4AU8LyFwfeLGD2CIAB62fGPmnr","closeGoods":"0","closeLike":"0","name":"测试房间1","screenType":"0","startTime":1591210800000,"endTime":1591221600000,"type":"0","anchorName":"狗子","shareImg":"WYuKkWB8n0mF-W3bcqZTCrxU-XwcEU8ym1E0sh4AU8LyFwfeLGD2CIAB62fGPmnr","closeComment":"0","anchorWechat":"XXXX"}
用的https请求,请求的接口为:
https://api.weixin.qq.com/wxaapi/broadcast/room/create?access_token=
但是总是提示报
{"errcode":200002,"errmsg":"parameter startTime or endTime is invalid"} 根据文档看好像参数名称啥的都没错……日期也转成了时间戳的形式。
求解。
貌似开播时间现在要求在3个月内。。。
传的参数是这样{"anchorName":"小小","anchorWechat":"XXX","closeComment":0,"closeGoods":0,"closeKf":0,"closeLike":0,"closeReplay":0,"closeShare":0,"coverImg":"PVhqKA8xDp4hCSS4vi3CnYSQiNab9TaY3VXFDkPKottOFRJ0zAZL-tI6_w_6lY-P","endTime":1607691606236,"feedsImg":"PVhqKA8xDp4hCSS4vi3CnYSQiNab9TaY3VXFDkPKottOFRJ0zAZL-tI6_w_6lY-P","isFeedsPublic":1,"name":"小小货物","shareImg":"PVhqKA8xDp4hCSS4vi3CnYSQiNab9TaY3VXFDkPKottOFRJ0zAZL-tI6_w_6lY-P","startTime":1607655606236,"type":0}
请求头是这样[Content-Type: application/json;charset=UTF-8, Accept: application/json, Cache-Control: no-cache, Pragma: no-cache]
请问大佬们为什么还是报{"errcode":200002,"errmsg":"parameter startTime or endTime is invalid rid: 5fd18f3b-3fa5f1d1-41799e78"}这个错
除了需要加content-type:application/json外, 开始时间和结束时间只能相差12小时, 文档写的是24小时, 测了好久才发现这个问题, 时间间隔大于12小时的也是报parameter startTime or endTime is invalid
楼主解决了吗?
{"errmsg":"parameter startTime or endTime is invalid","errcode":200002}这个错误始终无法解决 网上生成的时间截没问题啊 解决办法: $headers = array("Content-type: application/json;charset='utf-8'","Accept: application/json","Cache-Control: no-cache", "Pragma: no-cache"); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($curl); curl_close($curl);
请问解决了没?我也是出现这种错误提示,求教!
{"coverImg":"WYuKkWB8n0mF-W3bcqZTCrxU-XwcEU8ym1E0sh4AU8LyFwfeLGD2CIAB62fGPmnr","closeGoods":"0","closeLike":"0","name":"测试房间1","screenType":"0","startTime":1591210800,"endTime":1591221600,"type":"0","anchorName":"狗子","shareImg":"WYuKkWB8n0mF-W3bcqZTCrxU-XwcEU8ym1E0sh4AU8LyFwfeLGD2CIAB62fGPmnr","closeComment":"0","anchorWechat":"XXXX"} 参数换成这样也是报同样的错误。文档的参数匹配没问题。求解
$headers = array("Content-type: application/json;charset='utf-8'","Accept: application/json","Cache-Control: no-cache", "Pragma: no-cache");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);