fork download
  1. $curl = curl_init();
  2.  
  3. CURLOPT_URL => 'https://t...content-available-to-author-only...s.ru/apiSms/create',
  4. CURLOPT_RETURNTRANSFER => true,
  5. CURLOPT_ENCODING => '',
  6. CURLOPT_MAXREDIRS => 10,
  7. CURLOPT_TIMEOUT => 0,
  8. CURLOPT_FOLLOWLOCATION => true,
  9. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  10. CURLOPT_CUSTOMREQUEST => 'POST',
  11. CURLOPT_POSTFIELDS =>'{
  12. "apiKey": "MFMvyVoa35PhShVfJTw4CxgY15U1bkEKLkX6YRUFl6pvmTVx6J2B21GgfTwj",
  13. "sms": [
  14. {
  15. "channel": "char",
  16. "sender": "VIRTA",
  17. "text": "test1",
  18. "phone": "79523348347"
  19. }
  20. ]
  21. }',
  22. CURLOPT_HTTPHEADER => array(
  23. 'Content-Type: application/json'
  24. ),
  25. ));
  26.  
  27. $response = curl_exec($curl);
  28.  
  29. curl_close($curl);
  30. echo $response;
Success #stdin #stdout 0.03s 25792KB
stdin
Standard input is empty
stdout
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://t...content-available-to-author-only...s.ru/apiSms/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apiKey": "MFMvyVoa35PhShVfJTw4CxgY15U1bkEKLkX6YRUFl6pvmTVx6J2B21GgfTwj",
    "sms": [
        {
            "channel": "char",
            "sender": "VIRTA",
            "text": "test1",
            "phone": "79523348347"
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;