Create your own application and make it smart
Use our API to create awesome results, we are committed to your success.
We are always ready to make things easier for you. We listen to you and your feedback is always welcome.
A developer key (or API key) is used to identify you as a developer or a company developing apps. The developer key is required to generate access tokens.
All requests should be sent to the secure URL: https://smshare.fr/…
We keep the unsecured URL http://smshare.fr/ in case you have difficulties getting started. You should never use this one in production.
Each API call must be accompanied with the access token.
To generate access token, you need the login and password of the user owning the Android device.
Keep this access token secure. Save it and use it for all your requests.
/api/v2/access-token
POST
None
Send a request body containing the following fields:
{"accessToken" : "123abc…"}
Content-Type: application/json
{ "login" : "john", "password": "kerry", "apiKey" : "7d861ea2-ae25-4a38-b6ba-9214df02529b", "appName" : "myapp" }
{ token: "ae889ef6-586e-4e85-987d-462c90e450a5" }
$postData = json_encode(array( 'login' => "james", 'password' => "pass1234", 'apiKey' => "7d861ea2-ae25-4a38-b6ba-9214df02529b", 'appName' => "myapp" )); $ch = curl_init("https://smshare.fr/api/v2/access-token"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $reply = curl_exec($ch); error_log("status code: " . curl_getinfo($ch, CURLINFO_HTTP_CODE)); error_log(curl_error($ch)); //error error_log($reply); //success curl_close($ch);
Send one or multiple SMS?
If you are sending the same text to multiple destinations, your request should contain one SMS with comma separated destionations.
In the other hand, if you are sending bulk SMS where SMS bodies are not the same, then your request should contain SMS list
/api/v2/sms/bulk
POST
None
Send a request body containing the following fields:
String
String
gateway uuidArray
Each smsBean has the following fields:
Example:To send SMS at Sat, 10 Oct 2099 14:55:43 GMT ; use: 4095327343000
Content-Type: application/json
{ "accessToken":"14c00ab9-ff0b-481a-a331-6129fc3b1d7a", "gateway":"999999-ff0b-481a-a331-44444", "smsBeans" :[ { "destination": "12334566", "message" : "Hello world!" } ] }
$sms = array('destination' => '0617841532', 'message' => 'Hello world'); $postData = json_encode(array( 'accessToken' => "9c2c7523-5285-44db-895d-7ce82997af78", 'smsBeans' => array($sms) )); $ch = curl_init("https://smshare.fr/api/v2/sms/bulk"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $reply = curl_exec($ch); error_log("status code: " . curl_getinfo($ch, CURLINFO_HTTP_CODE)); error_log(curl_error($ch)); //error error_log($reply); //success curl_close($ch);