Snippets

Team Zoom PHP - send using json and curl

Updated by Curtis Sahd

File php-send-using-json-and-curl.php Modified

  • Ignore whitespace
  • Hide word diff
 
 $credentials = "YOUR_EMAIL_ADDRESS:YOUR-API-TOKEN";
 
-$url = "https://www.zoomconnect.com/zoom/api/rest/v1/sms/send.json";
+$url = "https://www.zoomconnect.com/app/api/rest/v1/sms/send.json";
 
 $data = new stdClass();
 $data->message = 'Test message';
-$data->recipientNumber = '27821234567';
+$data->recipientNumber = '+27821234567';
                                                               
 $data_string = json_encode($data);
  
Updated by Terence Foxcroft

File php-send-using-json-and-curl.php Modified

  • Ignore whitespace
  • Hide word diff
 <?php
 
+// note: the PHP cURL library must be installed to send using this method
+
 $credentials = "YOUR_EMAIL_ADDRESS:YOUR-API-TOKEN";
 
 $url = "https://www.zoomconnect.com/zoom/api/rest/v1/sms/send.json";
 );                                                                                                                   
  
 $result = curl_exec($ch);
-echo $result;
+echo 'Reponse ' . $result;
 
 ?>
Updated by Terence Foxcroft

File php-send-using-curl.php Deleted

  • Ignore whitespace
  • Hide word diff
-<?php
-
-$credentials = "YOUR_EMAIL_ADDRESS:YOUR-API-TOKEN";
-
-$url = "https://www.zoomconnect.com/zoom/api/rest/v1/sms/send.json";
-
-$data = new stdClass();
-$data->message = 'Test message';
-$data->recipientNumber = '27821234567';
-                                                              
-$data_string = json_encode($data);
- 
-$ch = curl_init($url);                                                                      
-curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
-curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
-curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
-curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
-    'Content-Type: application/json',     
-    'Authorization: Basic ' . base64_encode($credentials),                                                                           
-    'Content-Length: ' . strlen($data_string))                                                                       
-);                                                                                                                   
- 
-$result = curl_exec($ch);
-echo $result;
-
-?>

File php-send-using-json-and-curl.php Added

  • Ignore whitespace
  • Hide word diff
+<?php
+
+$credentials = "YOUR_EMAIL_ADDRESS:YOUR-API-TOKEN";
+
+$url = "https://www.zoomconnect.com/zoom/api/rest/v1/sms/send.json";
+
+$data = new stdClass();
+$data->message = 'Test message';
+$data->recipientNumber = '27821234567';
+                                                              
+$data_string = json_encode($data);
+ 
+$ch = curl_init($url);                                                                      
+curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
+curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
+curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
+    'Content-Type: application/json',     
+    'Authorization: Basic ' . base64_encode($credentials),                                                                           
+    'Content-Length: ' . strlen($data_string))                                                                       
+);                                                                                                                   
+ 
+$result = curl_exec($ch);
+echo $result;
+
+?>
Updated by Terence Foxcroft

File php-send-using-curl.php Modified

  • Ignore whitespace
  • Hide word diff
 <?php
 
-$credentials = "YOUR-USERNAME:YOUR-API-TOKEN";
+$credentials = "YOUR_EMAIL_ADDRESS:YOUR-API-TOKEN";
 
-$url = "https://zoomconnect.com/zoom/api/rest/v1/sms/send.json";
+$url = "https://www.zoomconnect.com/zoom/api/rest/v1/sms/send.json";
 
 $data = new stdClass();
 $data->message = 'Test message';
Updated by Terence Foxcroft

File PHP - send using curl.php Deleted

  • Ignore whitespace
  • Hide word diff
-<?php
-
-$credentials = "YOUR-USERNAME:YOUR-API-TOKEN";
-
-$url = "https://zoomconnect.com/zoom/api/rest/v1/sms/send.json";
-
-$data = new stdClass();
-$data->message = 'Test message';
-$data->recipientNumber = '27821234567';
-                                                              
-$data_string = json_encode($data);
- 
-$ch = curl_init($url);                                                                      
-curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
-curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
-curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
-curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
-    'Content-Type: application/json',     
-    'Authorization: Basic ' . base64_encode($credentials),                                                                           
-    'Content-Length: ' . strlen($data_string))                                                                       
-);                                                                                                                   
- 
-$result = curl_exec($ch);
-echo $result;
-
-?>

File php-send-using-curl.php Added

  • Ignore whitespace
  • Hide word diff
+<?php
+
+$credentials = "YOUR-USERNAME:YOUR-API-TOKEN";
+
+$url = "https://zoomconnect.com/zoom/api/rest/v1/sms/send.json";
+
+$data = new stdClass();
+$data->message = 'Test message';
+$data->recipientNumber = '27821234567';
+                                                              
+$data_string = json_encode($data);
+ 
+$ch = curl_init($url);                                                                      
+curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
+curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
+curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
+    'Content-Type: application/json',     
+    'Authorization: Basic ' . base64_encode($credentials),                                                                           
+    'Content-Length: ' . strlen($data_string))                                                                       
+);                                                                                                                   
+ 
+$result = curl_exec($ch);
+echo $result;
+
+?>
  1. 1
  2. 2
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.