Файловый менеджер - Редактировать - /home/gqdcvggs/vertchasseur.com/automate_message.php
Назад
<?php $app_id = "8dedcd6d-d142-4d94-b3ac-1bac7c437c2b"; $rest_api_key = "os_v2_app_rxw423orijgzjm5mdowhyq34fpl3qhp7glqehvuezocwyfjb4pnmgxicjwispllqow2l62azhysgckiyxgyp5d7ewyndftp43kktfsq"; $template_id = "0e7cfc18-c00f-4d84-990f-213259d455f2"; $fields = array( 'app_id' => $app_id, 'template_id' => $template_id, 'included_segments' => array('All') ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json; charset=utf-8', 'Authorization: Basic ' . $rest_api_key )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); if(isset($result['id'])) { echo "Notification envoyée avec succès"; } else { echo "Erreur: " . $response; } ?>
| ver. 1.6 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка