SMS
Methods
A2PGetSmsHistory
Gets the history of sent/or received A2P SMS.
To call this method, make sure your service account has one of the following roles:
Parameters
count:
number
OptionalMaximum number of resulting rows fetched. Must be not bigger than 1000. If left blank, then the default value of 1000 is used
delivery_status:
number
OptionalThe delivery status ID: QUEUED - 1, DISPATCHED - 2, ABORTED - 3, REJECTED - 4, DELIVERED - 5, FAILED - 6, EXPIRED - 7, UNKNOWN - 8
destination_number:
string
OptionalThe destination phone number
from_date:
timestamp
OptionalDate from which the search is to start. Format is 'yyyy-MM-dd HH:mm:ss', time zone is UTC
offset:
number
OptionalThe first N records are skipped in the output
output:
string
OptionalDefaults on:Â Â jsonThe output format. The possible values are json, csv
source_number:
string
OptionalThe source phone number
to_date:
timestamp
OptionalDate from which the search is to end. Format is 'yyyy-MM-dd HH:mm:ss', time zone is UTC
Returns
result:
total_count:
number
Total number of messages matching the query parameters
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.
To call this method, make sure your service account has one of the following roles:
Parameters
dst_numbers:
stringlist
The destination phone numbers separated by semicolons (;). The maximum number of these phone numbers is 100
src_number:
string
The SenderID for outgoing SMS. Please contact support for installing a SenderID
store_body:
boolean
OptionalWhether to store outgoing message texts. Default value is false
text:
string
The 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 charged as one message
Returns
failed:
fragments_count:
number
The number of fragments the message is divided into
result:
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 incoming SMS message is charged according to the pricing. If enabled, SMS can be sent from this phone number via the SendSmsMessage Management API and received via the InboundSmsCallback property of the HTTP callback. See this article for HTTP callback details.
To call this method, make sure your service account has one of the following roles:
Parameters
command:
string
The SMS control command. The following values are possible: enable, disable
phone_number:
string
The phone number
Returns
result:
number
GetSmsHistory
Gets the history of sent and/or received SMS.
To call this method, make sure your service account has one of the following roles:
Parameters
count:
number
OptionalMaximum number of resulting rows fetched. Must be not bigger than 1000. If left blank, then the default value of 1000 is used
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
from_date:
timestamp
OptionalDate from which to perform search. Format is 'yyyy-MM-dd HH:mm:ss', time zone is UTC
offset:
number
OptionalThe first N records are skipped in the output
output:
string
OptionalDefaults on:Â Â jsonThe output format. The following values available: json, csv
source_number:
string
OptionalThe source phone number
to_date:
timestamp
OptionalDate until which to perform search. Format is 'yyyy-MM-dd HH:mm:ss', time zone is UTC
Returns
result:
total_count:
number
Total number of messages matching the query parameters
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.
To call this method, make sure your service account has one of the following roles:
Parameters
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 charged as one message
source:
string
The source phone number
store_body:
boolean
OptionalWhether to store outgoing message texts. Default value is false
Returns
fragments_count:
number
The number of fragments the message is divided into
message_id:
number
Message ID
result:
number