[英]can not mark as read my incoming whatsapp message using whatsapp business api
Here's what I've done.这就是我所做的。 I'm using Python programming language.
我正在使用 Python 编程语言。
res = requests.put(
url='https://graph.facebook.com/v13.0/messages/wamid.HBgMOTE4NzgwNDk1ODA0FQIAEhggQkU2OURGQUYyMzdCNDlBRkQ1QUI4RERBNDdENDBBOEIA',
header = {
"Authorization": "Bearer my-auth-token",
"Content-Type": "application/json"
},
data=json.dumps({"status": "read"})
)
print(res.json())
Output:输出:
{'error': {'message': 'Unknown path components: /wamid.HBgMOTE4NzgwNDk1ODA0FQIAEhggQkU2OURGQUYyMzdCNDlBRkQ1QUI4RERBNDdENDBBOEIA', 'type': 'OAuthException', 'code': 2500, 'fbtrace_id': 'A6f8nCvHOSXSZcAGmevCGeJ'}}
According to the documentation the url is supposed to look like this:根据文档,网址应该如下所示:
https://graph.facebook.com/v13.0/PHONE_NUMBER_ID/messages
You seem to be missing PHONE_NUMBER_ID
in its correct place, and seem to have wamid...
which doesn't seem to be needed here.您似乎在正确的位置缺少
PHONE_NUMBER_ID
,并且似乎有wamid...
这里似乎不需要。 I also notice that your request body is missing the required data:我还注意到您的请求正文缺少所需的数据:
"messaging_product": "whatsapp",
"status": "read", <- you only seem to have this
"message_id": "MESSAGE_ID"
Also, the docs show a POST request while you seem to be using a PUT request.此外,文档显示 POST 请求,而您似乎正在使用 PUT 请求。 If you solve all these problems it should start working.
如果你解决了所有这些问题,它应该开始工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.