@שואף_גבוה כתב בAPI לניתוק כל הממתינים בתור:
והראיה שדרך הדפדפן הוא עובד
לא ראיתי שהקוד שהרצת בדפדפן הוא הקישור לקוד שלך, חשבתי שזה קישור ישיר לימות...
יצרתי לעצמי api לניתוק כל הממתינים בתור אם אני פונה דרך הדפדפן
http://yemotapi.free.nf/kick.php?token=073xxxx:xxxx&moreData=GOTO:/333&queuePath=1
זה עובד מצוין אבל כשאני מנסה דרך מודול api זה לא עובד מה יכולה להיות הבעיה
type=api api_link=http://yemotapi.free.nf/kick.php api_add_0=token=073xxxx:xxxx api_add_1=moreData=GOTO:/333 api_add_2=queuePath=1
@שמואל-ש
כנראה הבעיה בשרת הוא נותן גישה רק לדפדפנים
בכל אופן העברתי לשרת 000webhost פתוח לציבור הרחב בהנאה
בקישור הזה https://apicall2all.000webhostapp.com/kick.php
הפרמטר moreData הוא אופציונלי
@שואף_גבוה אם לא תראה לנו את הקוד שכתבת איך נוכל לדעת איפה ומהי הטעות?
@שמואל-ש הקוד עובד מצוין והראיה שדרך הדפדפן הוא עובד לכן השאלה היא על השלוחה בכל אופן הנה הקוד
<?php // Get the parameters from the URL $token = $_GET['token']; $queuePath = $_GET['queuePath']; $moreData = isset($_GET['moreData']) ? $_GET['moreData'] : null; // Check if the token is provided if (empty($token)) { die('Error: Token parameter is missing.'); } // API endpoint URL for the first request $apiEndpoint = 'https://private.call2all.co.il/ym/api/GetQueueRealTime'; // Prepare data for the first request $data = array( 'token' => $token, 'queuePath' => $queuePath, ); // Initialize cURL session for the first request $ch = curl_init(); // Set cURL options for the first request curl_setopt($ch, CURLOPT_URL, $apiEndpoint); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); // Execute cURL session and get the response for the first request $response = curl_exec($ch); // Check for cURL errors if (curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); } // Close cURL session for the first request curl_close($ch); // Decode the JSON response from the first request $decodedResponse = json_decode($response, true); // Check if the 'entries' parameter exists in the response if (isset($decodedResponse['entries']) && !empty($decodedResponse['entries'])) { // Extract all CallId values from the 'entries' array $callIds = array_map(function ($entry) { return $entry['CallId']; }, $decodedResponse['entries']); // API endpoint URL for the second request $secondApiEndpoint = 'https://private.call2all.co.il/ym/api/QueueManagement'; // Prepare data for the second request $secondData = array( 'token' => $token, 'callIds' => $callIds, 'action' => 'kick', 'moreData' => $moreData, 'queuePath' => $queuePath ); // Initialize cURL session for the second request $secondCh = curl_init(); // Set cURL options for the second request curl_setopt($secondCh, CURLOPT_URL, $secondApiEndpoint); curl_setopt($secondCh, CURLOPT_RETURNTRANSFER, true); curl_setopt($secondCh, CURLOPT_POST, true); curl_setopt($secondCh, CURLOPT_POSTFIELDS, json_encode($secondData)); curl_setopt($secondCh, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); // Execute cURL session and get the response for the second request $secondResponse = curl_exec($secondCh); // Check for cURL errors in the second request if (curl_errno($secondCh)) { echo 'Curl error: ' . curl_error($secondCh); } // Close cURL session for the second request curl_close($secondCh); // Output the response from the second API echo $secondResponse; } else { echo 'Error: No entries found in the response from the first API.'; }
@שואף_גבוה כתב בAPI לניתוק כל הממתינים בתור:
והראיה שדרך הדפדפן הוא עובד
לא ראיתי שהקוד שהרצת בדפדפן הוא הקישור לקוד שלך, חשבתי שזה קישור ישיר לימות...
@שמואל-ש
כנראה הבעיה בשרת הוא נותן גישה רק לדפדפנים
בכל אופן העברתי לשרת 000webhost פתוח לציבור הרחב בהנאה
בקישור הזה https://apicall2all.000webhostapp.com/kick.php
הפרמטר moreData הוא אופציונלי
@שואף_גבוה רק תחליף את הכתובת של ימות במקום https://private.call2all.co.il/ym/api/ תשים https://www.call2all.co.il/ym/api/ כדי שיעבוד גם במערכות רגילות ולא רק בפרייווט
@קו-כשר-מערכות-טל החלפתי