SMS Print

  • 1

The WaSMS SMS API offers a robust suite of tools to manage SMS messaging, campaigns, and devices. This article provides an overview of key API endpoints and practical examples to help you seamlessly integrate SMS functionality within your WHMCS platform.

1. Deleting a Received SMS

To delete a received SMS message, use the following endpoint:

  • Endpoint: GET https://sys.wasms.net/api/delete/sms.received
  • Required Permission: delete_sms_received

Parameters:

  • secret: Your API secret (found in Tools -> API Keys).
  • id: The ID of the received message to delete.

Sample Request (PHP):

php
$apiSecret = "YOUR_API_SECRET";
$smsId = 1; $cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/delete/sms.received?secret={$apiSecret}&id={$smsId}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);

Success Response:

json
{ "status": 200, "message": "Received SMS has been deleted!", "data": false }

2. Deleting an SMS Campaign

This endpoint removes an SMS campaign:

  • Endpoint: GET https://sys.wasms.net/api/delete/sms.campaign
  • Required Permission: delete_sms_campaign

Parameters:

  • secret: Your API secret.
  • id: The ID of the campaign.

Sample Request (PHP):

php
$apiSecret = "YOUR_API_SECRET";
$campaignId = 1;
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/delete/sms.campaign?secret={$apiSecret}&id={$campaignId}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);

Success Response:

json
{ "status": 200, "message": "SMS campaign has been deleted!", "data": false }

3. Deleting a Sent SMS

Use this endpoint to delete a sent SMS:

  • Endpoint: GET https://sys.wasms.net/api/delete/sms.sent
  • Required Permission: delete_sms_sent

Parameters:

  • secret: Your API secret.
  • id: The ID of the sent message.

Sample Request (PHP):

php
$apiSecret = "YOUR_API_SECRET";
$smsId = 1;
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/delete/sms.sent?secret={$apiSecret}&id={$smsId}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);

Success Response:

json
{ "status": 200, "message": "Sent SMS has been deleted!", "data": false }

4. Retrieving Device Information

This endpoint lists available devices:

  • Endpoint: GET https://sys.wasms.net/api/get/devices
  • Required Permission: get_devices

Parameters:

  • secret: Your API secret.
  • limit: (Optional) Number of results per page, default is 10.
  • page: (Optional) Page number, default is 1.

Sample Request (PHP):

php
$apiSecret = "YOUR_API_SECRET";
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/get/devices?secret={$apiSecret}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);

Success Response:

json
{ "status": 200, "message": "Android Devices", "data": [ { "id": "49", "unique": "00000000-0000-0000-d57d-f30cb6a89289", "name": "F11 Phone", "version": "Android 11", "manufacturer": "OPPO", // Additional device data... } ] }

5. Starting an SMS Campaign

This API call initiates an SMS campaign.

  • Endpoint: GET https://sys.wasms.net/api/remote/start.sms
  • Required Permission: start_sms_campaign

Parameters:

  • secret: Your API secret.
  • campaign: Campaign ID.

Sample Request (PHP):

php
$apiSecret = "YOUR_API_SECRET";
$campaignId = 1;
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://sys.wasms.net/api/remote/start.sms?secret={$apiSecret}&campaign={$campaignId}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
print_r($result);

Success Response:

json
{ "status": 200, "message": "SMS campaign has been resumed!", "data": false }

Error Responses

Each endpoint may return a similar error format for invalid requests:

json
{ "status": 400, "message": "Invalid Parameters!", "data": false }

For more detailed documentation, refer to the WaSMS API documentation available on our system. This article is designed to help WHMCS users get started with WaSMS's API capabilities, making SMS management easier and more efficient.


Was this answer helpful?

« Back