无法标记为使用WhatsApp Business API阅读我传入的WhatsApp消息
这是我所做的。我正在使用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())
输出:
{'error': {'message': 'Unknown path components: /wamid.HBgMOTE4NzgwNDk1ODA0FQIAEhggQkU2OURGQUYyMzdCNDlBRkQ1QUI4RERBNDdENDBBOEIA', 'type': 'OAuthException', 'code': 2500, 'fbtrace_id': 'A6f8nCvHOSXSZcAGmevCGeJ'}}
Here's what I've done. I'm using Python programming language.
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'}}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 documentation url应该看起来像这样:
您似乎在正确的位置缺少
phone_number_id
WAMID ...
在这里似乎不需要。我还注意到您的请求主体缺少所需的数据:另外,文档在您似乎使用PUT请求时显示了邮政请求。如果您解决了所有这些问题,则应该开始工作。
According to the documentation the url is supposed to look like this:
You seem to be missing
PHONE_NUMBER_ID
in its correct place, and seem to havewamid...
which doesn't seem to be needed here. I also notice that your request body is missing the required data:Also, the docs show a POST request while you seem to be using a PUT request. If you solve all these problems it should start working.