Via the Voice API of sms77 you can issue calls to certain phone numbers. The simplest way is to specify a text which is read to the recipient via our text-to-speech Gateway. For advanced applications, you have the option of sending the text in XML format.
Please use the following URL for your request: https://gateway.sms77.io/api/voice
The following parameters are required in addition to authentication:
Parameter | Description | Possible values |
---|---|---|
to |
The recipient number. Allowed are numbers and address entries (contacts only). Currently just one recipient per call is possible. |
0049171999999999 0171999999999 49171999999999 +49171999999999 Peter |
text |
The text message to be read or XML data. The input length may not exceed 10,000 characters. | Dear customer. Your new glasses have just arrived. Please stop by to pick them up. Sincerely, your optician. |
Parameter | Description | Possible values |
---|---|---|
debug |
If activated, no calls will be made or calculated. Useful to see if the connection to API actually works or not. | 0 1 |
from |
The caller ID. Please use only verified sender IDs, one of your virtual inbound numbers or one of our shared virtual numbers. | 491771783130 |
json |
If activated, the returned response is of JSON format and more detailed. | 0 1 |
xml |
Specifies whether the text parameter is plain text or of XML format. |
0 = text1 = XML |
Example
https://gateway.sms77.io/api/voice?p=api-key&to=49171999999999&text=This+text+is+read.
The phone number +49171999999999 is called and This text is read. is announced on the phone.
Our Voice Gateway can be expanded individually – e.g. with interactive menus, MP3s can be played and much more. Contact us for your specific requirements!
Response Examples
Plain text
The API returns a plain text response by default.
The first row presents the response code.
The second row is the message ID.
The last row is the total price of the call.
100 123456789 0.07
JSON
The API returns a detailed JSON object with the parameter json
set to 1
.
{
"success": "100",
"total_price": 0.07,
"balance": 45.678,
"debug": false,
"messages": [
{
"id": "123456789",
"sender": "491771783130",
"recipient": "491716992343",
"text": "Hi Sam, I am just calling to tell you that I am so in love with you!",
"price": 0.07,
"success": true,
"error": null,
"error_text": null
}
]
}
Webhooks
Setup a webhook of event_type: voice_status to receive real-time status updates of your call.
We will send the following parameters to your callback URL:
Parameter | Description |
---|---|
callerId |
The caller ID which has been sent |
duration |
You will get the duration of the call in seconds when it is completed |
id |
The ID of the Voice Call |
pricePerMinute |
The price per minute in Euro |
recipient |
The recipient number |
status |
The current status of the call Possible values are: completed, no-answer, failed, initiated, ringing, in-progress |