收藏
回答

直播创建房间接口提示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"} 根据文档看好像参数名称啥的都没错……日期也转成了时间戳的形式。

求解。


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

7 个回答

  • 江东一绝
    江东一绝
    2022-09-29

    貌似开播时间现在要求在3个月内。。。

    2022-09-29
    有用
    回复
  • 剪ー段時光ゝ缓缓流淌
    剪ー段時光ゝ缓缓流淌
    2020-12-10

    传的参数是这样{"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"}这个错

    2020-12-10
    有用
    回复 1
    • 剪ー段時光ゝ缓缓流淌
      剪ー段時光ゝ缓缓流淌
      2020-12-10
      我这个找到原因了   时间戳要以秒为单位,java转换的时间戳是以毫秒为单位的,要除以1000
      2020-12-10
      回复
  • Sherlock
    Sherlock
    2020-06-23

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

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

    楼主解决了吗?

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

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

    2020-06-16
    有用
    回复
  • wu@big 🐶
    wu@big 🐶
    2020-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"} 参数换成这样也是报同样的错误。文档的参数匹配没问题。求解


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