我正在使用 facebook Workplace Graph API。我正在寻找两件事:
1) 如何从消息 ID 中获取消息 2) 如何仅获取新消息。
到目前为止我做了什么?1) 我可以通过这个 api https://graph.facebook.com/user_id/conversations?fields=messages {message,attachments,from} 获取每个 convo 的消息,它会将所有 convo 和 messgaes 返回一起。
我想按顺序获取消息,就像他们在文档中提到的那样:https ://developers.facebook.com/docs/workplace/reference/graph-api/community#examples
使用此 API:
https://graph.facebook.com/Thread_id/messages?user=user_id 此 api 以以下格式返回消息 ID:
"data": [
{
"id": "m_mid.$cAAAAAB3Zz_JwhPe3PFqU7JtwhKkY",
"created_time": "2019-04-25T08:52:43+0000"
},
{
"id": "m_mid.$cAAAAAB3Zz_JwhOZDsVqU6D6aTMok",
"created_time": "2019-04-25T08:33:40+0000"
},
{
"id": "m_mid.$cAAAAAB3Zz_JwhOIeqVqU5zVO0W_t",
"created_time": "2019-04-25T08:29:08+0000"
},
{
"id": "m_mid.$cAAAAAB3Zz_JwhOGJq1qU5xAa27DB",
"created_time": "2019-04-25T08:28:30+0000"
},
{
"id": "m_mid.$cAAAAAB3Zz_JwhOF-BlqU5wyRZs39",
"created_time": "2019-04-25T08:28:27+0000"
}
],
"paging": {
"cursors": {
"before": "QVFIUjBadUdDcHV6SWRrQkhpQy1iUURYa3lKZADRGR3ZA1RDRIOEE2LWp3aERiRXZAPbWxORFBKOWRWdXBpOWQySWx3TjdxSHpsQm0tRmpNNTc1dnBfV1JYNDFRWmtLbC1QSW5jVkk4a0NUNUF1RUNuemhxUUYzWkllVE9tWkM0Y2tpY1A4",
"after": "QVFIUnRlc3VPUEdLM2FQdWxob1Y0YWxhdWFrMGQwWUxHSVZAwbmlaZA015RlUwLWRWTHhsdjRnNi03MTl3eWJvMUxiNXBaUFd4bVVBWkhpbmFCYkNLdzR5YlJVZA3YyT1RMVnJIY2JLbXVyTjNaN1pBaWVFeEkta0NLazljUHc5WGhEQlo0"
}
}
}
我不知道如何使用这些消息 ID 来获取实际消息。