Sending messages with Voximplant could be extremely useful to inform customers about price movements, policy changes, etc. And do not forget about the customer verification purposes. Most phone numbers support SMS but you can check How to choose a phone number article to be sure.
Enable SMS functionality
Enable SMS messaging via the ControlSms HTTP API before sending or receiving SMS. If SMS is supported and enabled, you can send SMS from a phone number via the SendSmsMessage HTTP API and receive via the InboundSmsCallback property of the HTTP callback. Each inbound SMS message is billed according to the pricing.
After you bought a number, go to Numbers —> My phone numbers. There is an SMS Enabled checkbox which is not selected by default. To enable it, choose Edit from the phone number's menu. Here, toggle Disable/Enable SMS and click Save.
To perform this action via HTTP API, use the ControlSms method.
To enable SMS, use this command:
To disable SMS, use this command:
If you want to save outbound SMS text in your control panel, please enable the Always save the text of outbound messages setting in your control panel → Settings → SMS configuration.
Send one-way SMS
To send one-way SMS, use the A2PSendSms method with the following parameters:
- src_number – source phone number
- dst_numbers – destination phone numbers separated by the ';' symbol
- text – message text, up to 1600 characters. We split long messages greater than 160 GSM-7 characters or 70 UTF-16 characters into multiple segments. Each segment is billed as one message
Let us see how to send a message with the text "Test one-way messages" 447443332211 to the phone numbers 447443332212 and 447443332213.
Send two-way SMS
To send two-way SMS, use the SendSmsMessage method with the following parameters:
- source – source phone number
- destination – destination phone number
- sms_body – message text, up to 765 characters. We split long messages greater than 160 GSM-7 characters or 70 UTF-16 characters into multiple segments. Each segment is billed as one message
Let us see how to send a message with the text "Test message" from the phone number 447443332211 to the phone number 447443332212:
Frangments_count in the response is the number of fragments into which the message was divided.