SMS
Methods
SendSmsMessage
Sends an SMS message between two phone numbers. The source phone number should be purchased from Voximplant and support SMS (which is indicated by the is_sms_supported property in the objects returned by the GetPhoneNumbers Management API) and SMS should be enabled for it via the ControlSms Management API. SMS messages can be received via HTTP callbacks, see this article for details.
Parameters
source:
string
The source phone number.
destination:
string
The destination phone number.
sms_body:
string
The 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.
Returns
result:
number
fragments_count:
number
The number of fragments the message was divided into.
A2PSendSms
Sends an SMS message from the application to customers. The source phone number should be purchased from Voximplant and support SMS (which is indicated by the is_sms_supported property in the objects returned by the /GetPhoneNumbers Management API) and SMS should be enabled for it via the /ControlSms Management API.
Parameters
src_number:
string
The source phone number.
dst_numbers:
stringlist
The destination phone numbers separated by the ';' symbol.
text:
string
The message text, up to 1600 characters.
Returns
result:
failed:
fragments_count:
number
The number of fragments the message is divided into.
ControlSms
Enables or disables sending and receiving SMS for the phone number. Can be used only for phone numbers with SMS support, which is indicated by the is_sms_supported property in the objects returned by the GetPhoneNumbers Management API. Each inbound SMS message is billed according to the pricing. If enabled, SMS can be sent from this phone number using the SendSmsMessage Management API and received using the InboundSmsCallback property of the HTTP callback. See this article for HTTP callback details.
Parameters
phone_number:
string
The phone number.
command:
string
The SMS control command. The following values are possible: enable, disable.
Returns
result:
number
GetSmsHistory
Gets the history of sent and/or received SMS.
Parameters
source_number:
string
OptionalThe source phone number.
destination_number:
string
OptionalThe destination phone number.
direction:
string
OptionalSent or received SMS. Possible values: 'IN', 'OUT', 'in, 'out'. Leave blank to get both incoming and outgoing messages.
count:
number
OptionalMaximum number of resulting rows fetched. Must be not more than 1000. If left blank, then the default value of 1000 will be used.
offset:
number
OptionalThe first N records will be skipped in the output.
from_date:
timestamp
OptionalDate from which to perform search. Format is 'yyyy-MM-dd HH:mm:ss'.
to_date:
timestamp
OptionalDate until which to perform search. Format is 'yyyy-MM-dd HH:mm:ss'.
output:
string
OptionalDefaults on: jsonThe output format. The following values available: json, csv.
Returns
result:
total_count:
number
Total number of messages matching the query parameters.
A2PGetSmsHistory
Gets the history of sent/or received A2P SMS.
Parameters
source_number:
string
OptionalThe source phone number.
destination_number:
string
OptionalThe destination phone number.
count:
number
OptionalMaximum number of resulting rows fetched. Must be not more than 1000. If left blank, then the default value of 1000 will be used.
offset:
number
OptionalThe first N records will be skipped in the output.
from_date:
timestamp
OptionalDate from which the search is to start. Format is 'yyyy-MM-dd HH:mm:ss'.
to_date:
timestamp
OptionalDate from which the search is to end. Format is 'yyyy-MM-dd HH:mm:ss'.
output:
string
OptionalDefaults on: jsonThe output format. The possible values are: json, csv.
delivery_status:
number
OptionalThe delivery status ID: QUEUED - 1, DISPATCHED - 2, ABORTED - 3, REJECTED - 4, DELIVERED - 5, FAILED - 6, EXPIRED - 7, UNKNOWN - 8.
Returns
result:
total_count:
number
Total number of messages matching the query parameters.