fork download
  1. <?php
  2. // Define the endpoint URL
  3. $url = "https://i...content-available-to-author-only...s.com/iid/v1:batchAdd";
  4.  
  5. // Your Firebase server key (replace with your actual key)
  6. $serverKey = "YOUR_SERVER_KEY";
  7.  
  8. // The payload
  9. $payload = [
  10. "to" => "/topics/session-add",
  11. "registration_tokens" => ["ctE5K9uWQKqjQTouPl2OWa:APA91bEaeg-hxssUqCI86wC64XDkTaJBXdfGrHZPm5JZawk9jS23DjjNbHmD5drwr11JL77PtTzj2z_ssxyMJ9SjibpHR-MchGCS3GMi8LWjHUxX7MRGzz4"],
  12. "op" => "batchAdd"
  13. ];
  14.  
  15. // Initialize cURL
  16. $ch = curl_init();
  17.  
  18. // Set the cURL options
  19. curl_setopt($ch, CURLOPT_URL, $url);
  20. curl_setopt($ch, CURLOPT_POST, true);
  21. curl_setopt($ch, CURLOPT_HTTPHEADER, [
  22. "Authorization: Bearer ya29.c.c0ASRK0Ga6fZg0IaADZFNzbJltjr-xnacUQ5Wd6Yl8xzY0N3TeaJuJY977ZLA6AZMYRuR73HxL5Ko2JqvFSbZH7_ubSy1AFqde18DeQIo9ReOe6TlYb2Mepez6wS6TD55BTUknQoJkSzPiw2EDBfbXrKlYEZRK2lRXOnP_NiGiHnUwaHKN8e2MdAI0EKiXkUOCEnWT7LG0tdSyj8Z7zmKKZpl3OouD_yCymZ5bzheFGHehZdiWkjhYkVilDABC9KW4jjOYNV1URqk_IBDu4td1PdzVuOxMj8QycE3Pyf0DBG0DpetnWYr7mJDtlj2UahP7hk_FoA-AfIC7yXAsl9UNqat0s4k4377wTqOIduBt6ttUgM-pB5Cb8vUr8RAT388PgpqsMF7423ntgrscruZcJpJ74B-gjZO_bztcuOx3hmc7M-RfI3di6jWyXY9skJigjWJkoI13mSFjst78c7ed3sZnuh4t3Qu0Zdmtwnk4Y5h_MwiQsM1erj45Rdgflpn65a2d8p7anQk5UieYJkzltJ98r3QvxF0z_Q1yJ3M65kiIoaeIsIsia9yWb0j5tfm-uJSVo8epj1cW8U86h2svY9Zt0wlpoy18skJIm9Xh5FWSmQ3OnVamx__5iYsau07X78VrqxVpO7yXkUi5a9_YankOyQ8y0tnUaiyo_RciMI4M2pwkFVYhb3-BgQndomXtiaSZkl7hRJOhkqpWY9zbw7jIzsO036X0Q_FgRu4fu_McM86MkqcfnX2SSnqBSjj5dt7no5pjMbY1q4JOXaaM0Wd03drkpZgekiQ3QOepgrIBS2Odb96zkevQ2q5iJYdjyjhOaqIY52zu2Y933aeIfBeYRl_Rg1vMxyqWsg7Fb1iWfV-yOiqbSUxZ7hlsiOSy9n111nl2q-7IxMZSjjx355f7lgmpFkinZOc7R38xxUyO30W9k2F5vb1RZoO6B2_wsUQq99j8sYBOY8YrYJwh01ia8UdU7_oj8gQ3XJnnyWjWusF57lOp1Ql",
  23. "Content-Type: application/json"
  24. ]);
  25. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  26. curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  27.  
  28. // Execute the request and capture the response
  29. $response = curl_exec($ch);
  30.  
  31. // Check for errors
  32. if (curl_errno($ch)) {
  33. echo 'cURL error: ' . curl_error($ch);
  34. } else {
  35. // Print the response
  36. echo "Response: " . $response;
  37. }
  38.  
  39. // Close cURL
  40. ?>
  41.  
Success #stdin #stdout 0.03s 26244KB
stdin
Standard input is empty
stdout
cURL error: Could not resolve host: iid.googleapis.com