SIGN UP
Navigation

Managing SMS

Methods

Enable or disable SMS sending and receiving 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 HTTP API. Each inbound SMS message is billed according to the pricing. If enabled, SMS can be sent from this phone number using the /SendSmsMessage HTTP 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

Examples

request:

Enable work with SMS for phone number 447443332211.

https://api.voximplant.com/platform_api/ControlSms/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&phone_number=447443332211&command=enable

Disable work with SMS for phone number 447443332211.

https://api.voximplant.com/platform_api/ControlSms/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&phone_number=447443332211&command=disable

response:

{
    "result": 1
}

Send 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 HTTP API) and SMS should be enabled for it via the /ControlSms HTTP 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.

Returns

  • result:

    number
  • fragments_count:

    number

    The number of fragments to which the message divided.

Examples

request:

Send the SMS message with text "Test message" from the phone number 447443332211 to the phone number 447443332212.

https://api.voximplant.com/platform_api/SendSmsMessage/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&source=447443332211&destination=447443332212&sms_body=Test%20message

response:

{
    "result": 1,
    "fragments_count": 1
}