проеукт
- 1
- 0
- Опубликовано: 2024-01-17
$user_id = 'user_id';
$url = "https://graph.facebook.com/v12.0/{$user_id}/conversations?access_token={$access_token}";
$response = file_get_contents($url);
$data = json_decode($response, true);
foreach ($data['data'] as $conversation) {
$conversation_id = $conversation['id'];
$url = "https://graph.facebook.com/v12.0/{$conversation_id}/messages?access_token={$access_token}";
$response = file_get_contents($url);
$messages = json_decode($response, true);
foreach ($messages['data'] as $message) {
$message_text = $message['message'];
// do something with the message text
}
}
Предыдущая работа | Все работы автора | проект |