很明显 参数 开始时间 格式不对 我找一下 我以前写的 //转换为时间戳 string sTime = Utils.getTimestamp(Utils.ObjectToDateTime(model.startTime)); string eTime = Utils.getTimestamp(Utils.ObjectToDateTime(model.endTime)); 另外传参数的时候,加上“”
C#建直播间parameter startTime or endTime is invalid?C#.net代码如下: return await Senparc.Weixin.MP.ApiHandlerWapper.TryCommonApiAsync(async accessToken => { var urlFormat = string.Format("https://api.weixin.qq.com/wxaapi/broadcast/room/create?access_token={0}", accessToken.AsUrlData()); var result = await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, urlFormat, data, CommonJsonSendType.POST, timeOut: timeOut); return result; }, accessTokenOrAppId); 这个创建直播间接口,不能用微信组件post过去吗??? 当前时间是2020-08-13 13:03:00 直播开始时间 2020-08-13 15:00:00 直播结束时间 2020-08-13 16:00:00 调试情况(图片不清晰请放大看): [图片] 错误日志如下: 微信 POST 请求发生错误!错误代码:200002,说明:parameter startTime or endTime is invalid rid: 5f34c975-207cd6f4-0a61eec7 Senparc.Weixin.Exceptions.ErrorJsonResultException: 微信 POST 请求发生错误!错误代码:200002,说明:parameter startTime or endTime is invalid rid: 5f34c975-207cd6f4-0a61eec7 在 Senparc.Weixin.CommonAPIs.CommonJsonSend.<>c.<.cctor>b__6_1(String apiUrl, String returnText) 在 Senparc.CO2NET.HttpUtility.Post.d__5`1.MoveNext() --- End of stack trace from previous location where exception was thrown ---
2020-10-14报什么错呢?我调用的几个api都是可以的!
C#创建直播间 parameter startTime or endTime is invalid?// 参数 DateTime dtNow = DateTime.Now; int startTime = WXHelper.ConvertToTimeStamp(dtNow.AddHours(1)); int endTime = WXHelper.ConvertToTimeStamp(dtNow.AddHours(2)); var o = new { name = "测试直播房间1", coverImg = "mIZ6J141w3OWw5sOBwG3NRM06YzG_hD7O4vsKVi85Y3vSvcKEy7C_i6Rd_Q8y4YD", startTime = WXHelper.ConvertToTimeStamp(dtNow.AddMinutes(15)), endTime = WXHelper.ConvertToTimeStamp(dtNow.AddHours(1)), anchorName = "测试直播Name", anchorWechat = "JnnJinn", subAnchorWechat = "", shareImg = "", feedsImg = "", isFeedsPublic = "1", type = "1", screenType = "1", closeLike = "1", closeGoods = "1", closeComment = "1", closeReplay = "1", closeShare = "1", closeKf = "1", }; var token = Wechat.GetAccessToken(WechatAppType.MP, false); var url = string.Format("https://api.weixin.qq.com/wxaapi/broadcast/room/create?access_token={0}", token); public static string PostTest(string url, object data) { Encoding encoding = Encoding.UTF8; var reqJson = JsonConvert.SerializeObject(data, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DateFormatString = "yyyy-MM-dd HH:mm:ss" }); byte[] buffer = encoding.GetBytes(reqJson); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "Post"; request.ContentType = "application/json; charset=UTF-8"; request.ContentLength = buffer.Length; request.Timeout = 60000; HttpWebResponse response = null; request.GetRequestStream().Write(buffer, 0, buffer.Length); response = (HttpWebResponse) request.GetResponse(); using (StreamReader reader=new StreamReader(response.GetResponseStream(), encoding)) { var reaponseString = reader.ReadToEnd(); response.Close(); return reaponseString; } } { "Result": true, "Info": "{\"errmsg\":\"parameter startTime or endTime is invalid rid: 5f7e9943-69731824-18832adc\",\"errcode\":200002}", "CreateDt": "2020-10-08 12:44:53", "Data": { "name": "测试直播房间1", "coverImg": "mIZ6J141w3OWw5sOBwG3NRM06YzG_hD7O4vsKVi85Y3vSvcKEy7C_i6Rd_Q8y4YD", "startTime": 1602104393, "endTime": 1602107093, "anchorName": "测试直播Name", "anchorWechat": "JnnJinn", "subAnchorWechat": "", "shareImg": "", "feedsImg": "", "isFeedsPublic": "1", "type": "1", "screenType": "1", "closeLike": "1", "closeGoods": "1", "closeComment": "1", "closeReplay": "1", "closeShare": "1", "closeKf": "1" } }
2020-10-14现在api参数里没有,默认不生成回放,估计再升级了 才可以。 创建房间后,登录小程序管理-直播管理-房间-设置里面有 生成回放-把它开启就有回放了。
微信小程序直播回放的生成时间?我们的小程序开通了直播功能,但是有1场直播结束后,一整天都没有生成回放,这是什么原因呢?有什么办法可以加速回放生成进度呢 小程序id:wxcedba7ebcbdd066e [图片]
2020-08-04在 mp.weixin.qq.com 后台的 设置 -- 第三方设置 --插件--直播插件详情可以看到
直播组件appid 在哪里查看?[图片]
2020-06-15