收藏
回答

直播创建房间接口提示parameter startTimeorendTime is invali?

提交的参数是:

{"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"} 根据文档看好像参数名称啥的都没错……日期也转成了时间戳的形式。

求解。


回答关注问题邀请回答
收藏

5 个回答

  • Sherlock
    Sherlock
    06-23

    除了需要加content-type:application/json外, 开始时间和结束时间只能相差12小时, 文档写的是24小时, 测了好久才发现这个问题, 时间间隔大于12小时的也是报parameter startTime or endTime is invalid

    06-23
    有用
    回复
  • 贝小贝
    贝小贝
    06-17

    楼主解决了吗?

    06-17
    有用
    回复
  • 华
    06-16
    {"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);
    
    06-16
    有用
    回复
  • 枫叶
    枫叶
    06-16

    请问解决了没?我也是出现这种错误提示,求教!

    06-16
    有用
    回复
  • wu@big 🐶
    wu@big 🐶
    06-04

    {"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"} 参数换成这样也是报同样的错误。文档的参数匹配没问题。求解


    06-04
    有用
    回复 3
    • _
      _
      06-05
      楼主解决了没有
      06-05
      回复
    • 华
      06-17
      问题已解决,加
      $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);
      06-17
      回复
    • _
      _
      06-25回复
      要不是再看一眼帖子都不知道等到猴年马月 十分感谢
      06-25
      回复
登录 后发表内容
问题标签