都是根据官方提供的接口来的,每次返回的数据都是41028错误,说是formid过期怎么回事呢?
这是php代码:
/**
* 模拟post进行url请求
* @param string param
*/
function http_post(data) {
url;
data;
$ch = curl_init();//初始化curl
curl_setopt(postUrl);//抓取指定网页
curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
curl_setopt(curlPost);
$str = curl_exec($ch);//运行curl
curl_close($ch);
return $str;
}
_GET['token'];
_GET['$formId'];
//openid和模板id都写成固定的了
$openId = 'oa-UZ0SU789io-iFt20c1R-aqRt4';
$template_id = 'mD5R48MuLmedjsY2zLrNMhDOm_nQzRLhefc1bcUwbQk';
$data=<<<END
{
"touser": "{$openId}",
"template_id": "{$template_id}",
"page": "pages/template-message/template-message",
"form_id": "{$formId}",
"data": {
"keyword1": {
"value": "赛格电脑城",
"color": "#173177"
},
"keyword2": {
"value": "2015年01月05日 12:30",
"color": "#173177"
},
"keyword3": {
"value": "笔记本电脑",
"color": "#173177"
} ,
"keyword4": {
"value": "1449523224245",
"color": "#173177"
} ,
"keyword4": {
"value": "521元",
"color": "#173177"
}
},
"emphasis_keyword": "keyword1.DATA"
}
END;
$tempApi='https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token='.$access_token
$str=http_post($tempApi,$data);
echo $str;
你好,有解决吗?我也是新获取的 formid,怎么都无效,{"value":{},"formId":"ae33ca68fd3555e7474defb807487f31","target":{"id":"","dataset":{},"offsetTop":307,"offsetLeft":0}}
formid 到底是什么格式的
坐个沙发,等大神来回答 @管理员