第三方平台调用addtemplate“组合模板并添加到个人模板库”接口提示缺少tid。以下是系统输出的日志,其中包括请求的url和json结构参数。
2019-12-14 19:58:00,881 DEBUG Thread-22 HttpClientUtil.submitPost:87 - url=https://api.weixin.qq.com/wxaapi/newtmpl/addtemplate?access_token=28_dXeyc9yNAHSIU-W0Eh6nZNTGuBsaOxIk3iEeGmAyBwofTu3CLv0eRhMiOUDaduHLcMbDdRrrXOHSGQqW5UmSbHdSWVlwz1-vr3CyN-muH6snf5mU7J5bkh1_LR66PrFi1sRHkcExcTfkUzYPJNDeAMDDHX
2019-12-14 19:58:00,881 DEBUG Thread-22 HttpClientUtil.submitPost:88 - paramContent:{
"tid":"400",
"kidList":[3,1,4,5],
"sceneDesc": "用户成功支付后通知"
}
2019-12-14 19:58:00,881 DEBUG Thread-22 HttpClientUtil.submitPost:89 - ===========post method start=========
2019-12-14 19:58:01,280 DEBUG Thread-22 HttpClientUtil.submitPost:104 - {"errmsg":"missing parameter tid","errcode":200014}
2019-12-14 19:58:01,280 DEBUG Thread-22 HttpClientUtil.submitPost:105 - ===========post method end=========
参数这种方式:tid=181&kidList[0]=2&kidList[1]=3&kidList[2]=4&sceneDesc=报名通知
找到问题了,这个接口需要设置为x-www-form-urlencoded格式,且kidList格式应该为kidList[0]:1,kidList[1]:9等