Sept 30, 2023
In this blog post, we will learn about how to send sms through SMS.To API using apex.
SMS.to is a service that helps you send text messages to a lot of people at once. It's like sending a message to a big group of friends. It's a tool for managing and sending lots of text messages.
SMS.to is a service that provides a platform for sending SMS (Short Message Service) messages.
Please note that services and companies can evolve, change, or rebrand over time, so I recommend visiting their official website or conducting a current web search to get the most up-to-date and accurate information about sms.to.
As of my last knowledge update in September 2023, SMS.to is a platform that offers various features related to sending and managing SMS (Short Message Service) messages. Some of the key features may include:
Bulk SMS Sending:
Two-Way Messaging:
Scheduled Messaging:
Global Reach:
Custom Sender IDs:
API Integration:
Analytics and Reporting:
Contact Management:
Delivery Status Tracking:
Message Personalization:
Opt-Out Management:
Easy-to-Use Interface:
Please note that features may have been updated or expanded since my last knowledge update, so I recommend visiting the official SMS.to website for the most current and detailed information regarding their features and offerings.
Yes, you can typically send bulk messages using SMS.to. Sending bulk messages is a common feature offered by SMS service providers like SMS.to. Bulk messaging allows you to send a large number of SMS (Short Message Service) messages to multiple recipients at once. This is particularly useful for businesses, organizations, or individuals who need to reach a wide audience quickly and efficiently.
End Point : https://api.sms.to/sms/send
Method : POST
Body Parameters
Parameter |
Type |
Required |
Description |
message |
string |
Yes |
Your message |
to |
string |
Yes |
Phone number |
bypass_optout |
boolean |
No |
True will bypass optouts |
sender_id |
string |
No |
The displayed value of who sent the message |
callback_url |
string |
No |
A callback URL that will be used to send back information about updates of message status. See here for more details. |
Write Below Code in your Apex Class:
public class SMSToAPICall {
public void sendSMS() {
HttpRequest request = new HttpRequest();
request.setEndpoint('https://api.sms.to/sms/send');
request.setHeader('Authorization', 'Bearer ');
request.setHeader('Content-Type', 'application/json');
request.setMethod('POST');
String requestBody = '{"message": "This is test and this is a new line","to": "Your Mobile Number"}';
request.setBody(requestBody);
Http http = new Http();
HttpResponse response = http.send(request);
if(response.getStatusCode() == 200)
{
System.debug('response.getBody() >> '+response.getBody());
}
else
{
System.debug('Error >> '+response.getBody()+ ' Status Code >> ' +response.getStatusCode());
}
}
}
I hope this blog helped you!