{"errcode":40003,"errmsg":"invalid openid rid: 5f70354c-2d5f3f07-6aa065ff"}
服务端收到的消息
{
"ToUserName": "gh_133c63812338",
"FromUserName": "og0J95dchUtYlv2XACOaMGOCNYC8",
"CreateTime": 1601189196,
"MsgType": "text",
"Content": "的",
"MsgId": 22923519871373703
}
服务端发送的消息
{
"touser":"og0J95dchUtYlv2XACOaMGOCNYC8",
"msgtype":"text",
"text":{
"content":"输入 `大礼包`, `真题` 领取大礼"
}
}
你弄混了API发送消息和被动回复两件事情。
API发送,是开发者主动调用微信API来发送消息
被动回复,是在收到事件推送(一次http post)时,回复一段xml/json。
你目前是调用了API,但是请求的json内容是:
{"Encrypt":"TOa7****JBU=","MsgSignature":"b1****d1","TimeStamp":"1601189196","Nonce":"1****5"}
{"Encrypt":"TOa79KBzURVq4In7U\/mbeKVD9JqPjtGHekEzUxG98iU3CanVYe4n69P57IJ1+Q5TQtlJuuCrYQi\/zsNZyx0gpXgp31d228pn9THcU2LPg5j+Ui2we3itrx1pczCpeyDLC2NuQMZC4VgbU7WQMRDHj1u5FZT5KfcXtt\/pHvjvFxM1nmXdnEBm5l03UjHi2dgNyR1vA3st6sO1dARYoJWA75EaUy66v1pnXkbiXpiGsy191EFiWKj3ls\/cGIpMqtCDjp3ABXDZ5ocF8Uko6BOFX6GdcVR9R7S+ZVl7uVavJBU=","MsgSignature":"b1e8be6f1d0be0e286aab1c0c89471e8572df4d1","TimeStamp":"1601189196","Nonce":"116847805"}
openid错了 检查下
$data['touser'] = $msg["FromUserName"];
{
"ToUserName": "gh_133c63812338",
"FromUserName": "og0J95dchUtYlv2XACOaMGOCNYC8",
"CreateTime": 1601189196,
"MsgType": "text",
"Content": "的",
"MsgId": 22923519871373703
}
openid和appid不匹配