Is it possible to send an ICQ message using PHP?

Yes, it is possible to send an ICQ message using PHP by utilizing the ICQ API. You can send messages to ICQ users by making HTTP requests to the ICQ API endpoints. You will need to obtain an access token and the recipient's ICQ UIN to send a message successfully.

// ICQ API endpoint for sending a message
$url = 'https://api.icq.net/bot/v1/messages/sendText';

// ICQ access token
$accessToken = 'YOUR_ACCESS_TOKEN';

// Recipient's ICQ UIN
$recipientUin = 'RECIPIENT_ICQ_UIN';

// Message content
$message = 'Hello, this is a test message from PHP!';

// Data to be sent in the request
$data = [
    'chatId' => $recipientUin,
    'text' => $message
];

// Initialize cURL session
$ch = curl_init($url);

// Set cURL options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer ' . $accessToken
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL session
$response = curl_exec($ch);

// Close the cURL session
curl_close($ch);

// Output the response
echo $response;