微信对话开发平台 给网页H5发送客服消息,返回503?
TOKEN = "k4hqAeOi3pPMnmWURvZJd8jyj8BATR"
EncodingAESKey = "uu06tNJqysIDCpSer1PjXC8nMZAo6fNxDszcBZ8OnaF"
APPID = "8abfUZOvOlQr8Fr"
headers = {
"Content-Type": "application/json",
}
data = '''<xml>
<appid><![CDATA[k4hqAeOi3pPMnmWURvZJd8jyj8BATR]]></appid>
<openid><![CDATA[7hK2MdIzH9Q]]></openid>
<msg><![CDATA[你好]]></msg>
<channel>7</channel>
<kefuname><![CDATA[BobAi]]></kefuname>
</xml>'''
encryp_test = WXBizMsgCrypt(TOKEN, EncodingAESKey, APPID)
nonce = "12345678"
ret, encrypt_xml = encryp_test.EncryptMsg(data, nonce)
url = "https://chatbot.weixin.qq.com/openapi/sendmsg/{TOKEN}".format(TOKEN=TOKEN)
response = requests.post(url, data=json.dumps({"encrypt": encrypt_xml}), headers=headers)
response.status_code
是那里配置错了?