小程序服务端推送模板消息 总是提示 form-Id 41028错误
发布于 6 年前 作者 vkang 6943 次浏览 来自 问答

业务流程简述:

用户在小程序端点击预约按钮后,生成FormId,存到数据库(根据opneId,keyName(自定义的分类名称),检查是否存在,如果不存在此记录,添加;若存在,更新FormId

服务端检查预约完成后,根据用户OpenId和KeyName查询模板Id和FormId 等参数,请求微信发送模板消息接口

请求日志:

019-04-18 16:37:28.6091 DEBUG “开始发送预约模板消息 {”“access_token”":"“20_1LW0C-jttpvyCEfuKLtAxLX8dxm3eTezCwANe-nTRsqgqeTbGaB7SWnYxidBbjhcF5GBoxvGluTfADdd4L3CGwETTAEJVNqIEvsesCNJw7KlTrW4m6YdUKtzF3SaeOoGSnGdCHtZR_toPoMBPUSfADAEJH”","“touser”":"“otLCH5NCTHz3q0XNJ51zb_6ALDK8"”,"“template_id”":"“Gv5Fit2pnf5QvWGttVjX9GkUAAZEzPMXoYrogAKzfFA”","“formId”":"“22d907226dcd4542afb8829fa5e20768"”,"“data”":{"“keyword1"”:{"“value”":"“2019-04-18T16:37:28.5378809+08:00"”},"“keyword2"”:{"“value”":"“河南省郑州市中原区红松路 文竹街-测试F-222"”},"“keyword3"”:{"“value”":"“空闲”"}}}" 127.0.0.1 Api.Controllers.HomeController.AppointCharge AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d => AsyncControllerActionInvoker.EndInvokeActionMethod => WrappedAsyncResultBase`1.End => WrappedAsyncResult`2.CallEndDelegate => AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39 => ControllerActionInvoker.InvokeActionMethod => ReflectedActionDescriptor.Execute => ActionMethodDispatcher.Execute => <no type>.lambda_method => HomeController.AppointCharge

2019-04-18 16:37:29.0701 DEBUG “发送预约模板消息响应:{”“errcode”":41028,"“errmsg”":"“invalid form id hint: [q39oqA06484105]”"}" 127.0.0.1 Api.Controllers.HomeController.AppointCharge AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d => AsyncControllerActionInvoker.EndInvokeActionMethod => WrappedAsyncResultBase`1.End => WrappedAsyncResult`2.CallEndDelegate => AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39 => ControllerActionInvoker.InvokeActionMethod => ReflectedActionDescriptor.Execute => ActionMethodDispatcher.Execute => <no type>.lambda_method => HomeController.AppointCharge

说明:日志中的Json字符串格式是正确的,第三方日志组件多加了双引号

2 回复

这里应该是form_id,而非formId

参数名称都错了form_id,不是formId

回到顶部