一、期初我是调用这个接口https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?access_token=?获取授权码信息。
1.提交请求获取小程序授权码信息参数:{"authorization_code":"queryauthcode@@@3ahuPjzkGwaCfaLCUJqKMqvinhhyIcmJYLIQL5rB_XgOv1BODeI_QkXIOGKECsLPBkR9sX4qJNSvcOjNo7q-GQ"}
2.获取到小程序授权码信息:{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 64bde57f-6bc352d8-7da67958"}
二、然后根据提示改调用https://api.weixin.qq.com/cgi-bin/stable_token这个接口获取,
获取到小程序授权码信息:{"access_token":"70_U5YRUTAEytb3EPrTc4kGGQ0P46WWG6kY6FABkbcXoEo68xSbSnpG-TR3W8Ya_Uy4qoRI8IalxMyIpXyc1AEz6MXzE18N3ApNkTfrnNndNYxGSeN3vubTiJkQ0DUPHQbAJADVE","expires_in":7200}
紧接着调用客服消息推送接口https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=?
提交发送微信客服消息参数:{"access_token":"70_U5YRUTAEytb3EPrTc4kGGQ0P46WWG6kY6FABkbcXoEo68xSbSnpG-TR3W8Ya_Uy4qoRI8IalxMyIpXyc1AEz6MXzE18N3ApNkTfrnNndNYxGSeN3vubTiJkQ0DUPHQbAJADVE","msgtype":"text","text":{"content":"queryauthcode@@@IXO3bcUTYVarcLr1om6fXg_eDsww5yInIpVpxXqoF334_7isAKNXSL1uGIRIcfxWc-5Nrxl0gg1ZOIJuaOfVeg_from_api"},"touser":"ozy4qt5QUADNXORxCVipKMV9dss0"}
发送微信客服消息反馈:{"errcode":48001,"errmsg":"api unauthorized rid: 64bfab39-365f7caa-59d4a156"}
按照客服消息接口说明:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html#0
是要先新增客服账号吗?我测试的是小程序,接口说明中是新增的公众号客服账号。帮解答下,谢谢!
你好,1、请严格按照文档执行https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/operation/thirdparty/releases_instructions.html,不影响继续操作发布现网。
2、报错 {"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 64bde57f-6bc352d8-7da67958"}--------> 是因为传的token有问题,请仔细检查拼接的请求链接
3、报错 {"errcode":48001,"errmsg":"api unauthorized rid: 64bfab39-365f7caa-59d4a156"} --------->是因为用的token不对(你实际使用的是第三方平台令牌component_access_token),代小程序/公众号调用接口需使用authorizer_access_token,参考文档说明https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/getting_started/how_to_call_api.html
后续遇到此类问题可参考文档 https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/troubleshooting/third_party_authority_instructions_troubleshooting.html 自助排查
"authorization_code",这边还传了appsecret,(appsecret是敏感信息,请注意保护,将appsecret值删除)
不解决,直接通过,完事,不影响任何东西。