|
8 (800) 700 7672 Free in Russia |
The API allows you to send messages through your projects and services over HTTP/HTTPS, SMTP and SMPP protocols. Ready-made libraries in different programming languages connect to your project and help you send messages from anywhere with a single command. For simplified authorization, instead of a login and password pair, you can use a special API key.
MESSAGES SENDING Sending an SMS message MANAGING MAILING LISTSComments in SMS messages Sending to a group of numbers Sending an HLR request Sending an e-mail message Sending a voice message (call) Sending a viber message Sending a message to Telegram Sending a message to the Telegram chatbot Using prefixes when sending messages Managing message templates Managing operator templates Virtual sending (test mode) Event Notifications MESSAGE STATUSES Checking the status CHECKING THE BALANCE STATUSMessage statuses. Server response and error codes Status codes Error codes in the status Deleting a message MANAGING CONTACTS Actions with contacts and groups CLIENT MANAGEMENTContacts and groups. Server response and error codes Examples of operations with contacts Work with the subclient MANAGING SENDER NAMES (SENDER ID)Creating and uploading invoices and reports List of available operations with sender names GETTING DATAServer response and error codes Examples of actions with sender names Getting the history of sent messages Receiving incoming messages Getting statistics Request for rates Getting information about the operator Getting data about a short link VARIOUS | VariousConnecting dedicated numbers for receiving messagesYou can use special API commands to get a list of available dedicated numbers for receiving SMS messages and connect any number to your username, paying the cost for the remaining days in the current month. When you connect a dedicated number, you automatically agree to the terms of use of such numbers.To get a list of available allocated numbers, call the following address using the GET or POST method:
https://smscentre.com/sys/receive_phones.php?g To connect a dedicated number, you need to call the address using the GET or POST method:
https://smscentre.com/sys/receive_phones.php?b To change the attribute of the extension of the allocated number for the next month, you must call the address by the GET or POST method:
https://smscentre.com/sys/receive_phones.php?c Description of the parameters passed to the Server:
If an error occurs, the Server returns the following string:
If the request is successful, the Server returns a response in the form of a string. To get a list of available numbers:
<phone> – phone number. <type> – number type: 1,4-dedicated virtual number, 2-number on the SIM hosting service. <cost> – the cost of renting a phone number for a full month. <current_cost> – the cost of renting a phone number for the remaining days until the end of the current month. <info> – operator name and supported notification types. To rent a room:
<cost> – the amount debited from the Client's account for the rental of the phone number. To change the extension attribute of the number:
Examples: Getting a list of available phone numbers for rent: https://smscentre.com/sys/receive_phones.php?g Connecting the number " 79999999999": https://smscentre.com/sys/receive_phones.php?b Disabling the ability to extend the allocated number "79999999999" for the next month: https://smscentre.com/sys/receive_phones.php?c
The server does not accept more than two identical requests within a minute to get a list of available numbers for rent or to connect a number, or to change the properties of the allocated number to reduce the load and protect against errors and loops in the Client-side program. Transmitting statuses and messages to the Client handlerIn the Client's personal account in "User settings" it is possible to specify the http (s) address (URL) of the script for processing the delivery statuses of messages, incoming SMS messages, as well as service messages (when using the service "Confirm the number with a call") on the Client side. The specified script will be called by the Server after each receipt of the delivery status of a message previously sent by the Client, after receiving an incoming SMS message from the subscriber or a call from the subscriber (when using the "Number Confirmation by Call" service").In the address of the handler, you can specify the charset parameter to select the encoding of the transmitted parameters:
?charset=utf-8
The default encoding is windows-1251.
Also, in the address of the status handler and incoming messages, you can pass the fmt parameter to specify the format of the returned parameters. Possible values: fmt=2 (for xml format) and fmt=3 (for json format). When transmitting the fmt parameter, the koi8-r encoding is not used. To protect the transmitted data from spoofing , you can additionally specify any of the md5, sha1, or crc32 parameters in the handler address that define the algorithm for calculating the control parameter with the string hash:
"id:phone:status:<секретная строка>" − for the delivery status
in the form of:
?md5=<секретная строка>
You can use Latin letters, numbers, minus signs, and underscores as secret string characters.
The corresponding parameter will be passed to the handler, in which the secret string will be replaced with the hash value of the transmitted data.
All parameters are passed by the POST method (for fmt=2 and fmt=3, the parameters are passed in the request body). If it is necessary to transfer the parameters specified in the handler URL by the GET method, you need to register them in a special way through the "!" symbol (for example, in the URL "https://mysite.ru/!param1¶m2?param3¶m4" parameters param1 and param2 will be transmitted by the GET method, and param3 and param4 by the POST method). Transmitted parameters for the SMS message status:
Transmitted parameters for an incoming SMS message:
Transmitted parameters when using the service " Number confirmation with a call":
Additional parameters transmitted when using the voice menu function in calls:
In addition to the standard parameters described above, the Server will also send all the parameters specified in the http(s) address of the handler after the"? " sign using the POST method". To distinguish between the status of a message, an incoming SMS message, or a service message (when using the "Confirm number by calling" service), you can check for the presence of the mes parameter (for an incoming message) and waitcall in the same handler (for the number confirmation service): if (isset($_POST["mes"])) {
Statuses are forwarded to the Client handler only when sending messages
over the HTTP/HTTPS, SMTP, or SMPP protocols. When sending messages from the personal account, the transfer of statuses to the Client's handler
does not occur. Connecting anti-spam verification (captcha) to the siteSometimes there is a need to send messages from your site at the request of users, and in such cases, to exclude automated spam mailings with the help of robots, you can easily implement anti-spam verification using our service.To do this, it is enough to place a special code for displaying the image (captcha) and fields for entering the code on the form for sending messages: Код с картинки <img src="https://smscentre.com/sys/imgcode.php?1.1" onclick="src+=1" width="50" height="18" border="1">
and pass it with other form data to the corresponding message sending script as the value of the imgcode parameter.Also, with this parameter, you must pass the value of the IP address of the user to whom the image was displayed as the value of the userip parameter. Examples: Example of a script for sending messages using the code from the image (captcha) received from the form: include_once "smsc_api.php"; Confirm your phone number with a callFor various types of operations, such as password recovery, authorization in public Wi-Fi networks, confirmation of money transfers, logging in to your personal account, and so on, you need to send authentication data. Using our API, you can organize the procedure for confirming the phone number by calling the subscriber himself.To create a request to receive a phone number, at which the subscriber will have to make a confirmation call, you need to call the address using the GET or POST method:
https://smscentre.com/sys/wait_call.php?login= The following parameters are passed to the server:
If an error occurs, the Server returns the following string:
If the request is successful, the Server returns a response in the form of a string.
<phone> – the phone number to which the subscriber must make a call within 15 minutes to confirm their phone number. <all_phones> – a list of all possible phone numbers, one of which was assigned by the system to call the subscriber (depending on the country). After the subscriber's call, the Server records the fact of the call in the form of an incoming message with the text "[waitcall] " and sends all the necessary information about this call to the Client's handler. The server does not accept more than fifty identical requests to get a phone number for confirmation within a minute to reduce the load and protect against errors and loops in the Client-side program. Actions with deferred tasksTo reduce the load on the Server when unloading a large package of sent messages, the system implemented a deferred task mechanism. This mechanism periodically selects active tasks for unloading message packets and executes them. This allows not only to reduce the load on the Server, but also to eliminate delays in the formation and unloading of message packets in the Client's browser.To get a list of pending tasks, you must use the GET or POST method to call the address:
https://smscentre.com/sys/downloads.php?login=
To receive the task file with the sent messages, you must use the GET or POST method to call the address:
https://smscentre.com/sys/downloads.php?login=
or
https://smscentre.com/sys/downloads.php?login= The following parameters are passed to the server:
If an error occurs, the Server returns the following string:
If the request is successful, the Server returns a response in the form of a string. When you receive a list of pending tasks:
<id> – iD of the deferred task. <name> – name task. <status> – task status (0 - pending, 1 - in progress, 2 - completed, 3 - canceled, 4 - execution error). <created> – date the task was created. <time> – task start time. <file> – the name of the task file. After assigning the status 2 (completed) to the deferred task, you will be able to download a file with a package of sent messages in csv format. The server does not accept more than three identical requests to receive a list of tasks or to download a file within a minute to reduce the load and protect against errors and loops in the Client-side program. |
© 2003–2024 SMS Center LLC | support@smscentre.com Contacts | Design — Artemy Lebedev Studio Site Information |