Docs

Send message

https://api.apifonica.com/v2/accounts/{accountSID}/messages

Overview

This request sends an SMS message to a phone number. Only phone numbers rented from Apifonica can be used as senders’ numbers.

For message status control please refer to the article Message controller

XML command: sendMessage

Input parameters

Parameter
Required
Description
Default value

Request example

The following cURL example demonstrates sending an SMS:

curl –X POST https://api.apifonica.com/v2/accounts/{accountSID}/messages \
-H 'Content-Type: application/json' \
-d '{
      "from": "35315313424",
      "to": "447860041755",
      "text": "Apifonica API provides a really cool SMS messaging service"
    }' \
-u {accountSID}:{authToken}

The following cURL example demonstrates sending a message to Telegram:

curl –X POST https://api.apifonica.com/v2/accounts/{accountSID}/messages \
-H 'Content-Type: application/json' \
-d '{
      "from": "35315313424",
      "to": "447860041755",
      "channel": "telegram",
      "type": "gif",
      "url": "https://media.giphy.com/media/ya4eevXU490Iw/giphy.gif",
      "text": "Apifonica API provides a really cool SMS messaging service"
    }' \
-u {accountSID}:{authToken}

Response example

{
  "status_code": 201,
  "status_message": "CREATED",
  "uri": "/accounts/{accountSID}/messages/{messageSID}"
}

Odwiedzając naszą stronę, zgadzasz się na to, abyśmy wykorzystywali pliki cookies. Zachęcamy do przeczytania naszej Polityki cookies, która znajduje się tutaj.