проект  

  • 0
  • Опубликовано: 2024-01-17
$access_token = 'your_access_token';
$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
}
}
Комментариев нет
оставить комментарий могут только авторизованные пользователи
Другие работы автора:

проеукт $access_token = 'your_access_token'; $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…

проект $access_token = 'your_access_token'; $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…

проект $access_token = 'your_access_token'; $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…

проект $access_token = 'your_access_token'; $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…

проект $access_token = 'your_access_token'; $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…