PHP cURL API integration

Easily integrate SMS Chef API into your web application using the cURL library.

Get started with the following code sample:

<?php

$message = "Message content"; // message here
$to = "+40123456789"; // sms destination mobile here (country code is mandatory)
$token = _YOUR_API_KEY_; // add your smschef.com API KEY here

$post_data = array(
    'phone' => $to,
    'message'   => $message,
    'sim' => 1, // optional
    'device' => 0, // optional
    'priority' => 0, // optional
);

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://smschef.com/system/api/send?key=" . $token,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => http_build_query($post_data),
));

$data = curl_exec($curl);
curl_close($curl);

$result = json_decode($data, true);

var_dump($result);


?>


For detailed informations about how you can integrate your app with SMS Chef please check our

API Documentation

200k SMS

Sent already

6K devices

Registered

Trusted By 5K

Active users

1000+ WebHooks

Running smoothly