<sendMessage>
This command sends a message to the specified phone number.
Important! For the moment, only SMS messages are supported.
Attribute | Description | Default Value |
---|---|---|
from | Number to be used as a CallerID. This number must be rented from Apifonica. | see description |
to | Recipient’s number — the number where Apifonica sends the message. | see description |
controller_url | URL which will be used to transmit message status and parameters. Apifonica will expect to receive a new Apifonica XML file to which flow control will be transferred. In this case any command after the <sendMessage> command is unreachable. If no controller URL is provided, Apifonica will proceed processing the current XML file and will not send any message parameters. Cannot be used with controller_app simultaneously. | none |
controller_app | Application SID which will be used to make a request for an XML controller file. Apifonica will expect to receive a new Apifonica XML file to which flow control will be transferred. In this case any command after is unreachable. If no controller URL is provided Apifonica will proceed processing the current XML file and will not send any message parameters. Cannot be used with controller_url simultaneously. | none |
method | Method to be used to make a request to the specified controller. | POST |
The following parameters for messages are sent to the controller if specified.
Parameter | Description |
---|---|
message_sid | Number to be used as a CallerID. This number must be rented from Apifonica. |
account_sid | Recipient’s number — the number where Apifonica sends the message. |
from | Sender’s phone number (conventional or virtual). |
to | Recipient’s phone number (conventional or virtual). |
text | Message text. |
Example
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<sendMessage from="358942704951" to="35315313424" text="Hello, this is my first SMS sent via Apifonica!"></sendMessage>
</response>