The S05GK API is an SMS sending interface based on the HTTP protocol, which enables sending SMS messages to mobile phones via HTTP requests. This article explains how to use PHP code to send SMS through the S05GK API.
Before using the S05GK API, you need to apply for access. The application process is as follows:
Once your application is approved, S05GK will provide the API documentation, which includes the API endpoint, required parameters, and example code, helping you quickly understand how to use the API.
Below is an example of using PHP code to send SMS via the S05GK API:
$url = 'http://api.s05gk.com:8888/sms/send';
$post_data = array(
'user_id' => 'User ID',
'password' => 'User Password',
'mobile' => 'Mobile Number',
'content' => 'SMS Content',
'send_time' => 'Send Time',
'extno' => 'Extension Code',
'sign' => 'Signature',
'format' => 'json',
);
$post_data = http_build_query($post_data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode($result, true);
In the above code, you need to replace the corresponding parameters such as User ID, User Password, Mobile Number, SMS Content, etc. Please fill in these based on your actual needs.
The parameters in the code represent the following:
By following the above steps, you can easily integrate the S05GK SMS sending API using PHP code. The S05GK API is simple to use and convenient for developers, making it one of the most commonly used SMS APIs in web development.