MyChat Scripts: mIntegrationTurboSMSSendExt, send SMS message with advanced parameters
Send an SMS message to one or several numbers. As a rule, messages are queued in the service and sent to the recipient instantly or after a couple of minutes.
Check their status on TurboSMS Admin Panel.
Specify flask status and the time for delayed dispatch.
Syntax
function mIntegrationTurboSMSSendExt(const sMsg, sRecipients: string; const dtStart: double; const bFlash: boolean; var sJSONResponse: string): integer;
Parameters and return values
Parameter |
Type |
Value |
sMsg |
string |
message text, maximum 1521 characters in Latin symbols or 661 symbols of Cyrillic text (10 segments); |
sRecipients |
string |
message recipients, phone numbers in international format divided by comma, without leading "+" spaces, for example: "380504451213,380671234587"; |
dtStart |
double |
dispatch date/time (not more than 14 days from the current time), or NoDate, if the message needs to be sent right now; |
bFlash |
boolean |
"true" if you need to send "Flash-SMS" that instantly displayed on the phone and does not save in the phone's memory; |
sJSONResponse |
string |
JSON object, full response from the service. |
Function result
-2 |
integration is off, enable it in the settings; |
-5 |
message is too long; |
-6 |
message is empty; |
-7 |
list of message recipients is empty; |
-8 |
day of the delayed dispatch is more or less 14 days from the current date; |
800, 801, 802, 803 |
message sent successfully, check the details in the full response from the service. |
Example
Sending a test Flash message (modern phones, as a rule, ignore this flag and display messages as regular SMS + save them in the history of received messages) :
var
iResult: integer;
sJSONResponse: string;
begin
iResult := mIntegrationTurboSMSSendExt('Test FLASH message from MyChat Server!', '380504452169', NoDate, true, sJSONResponse);
mLogScript('Result: ' + IntToStr(iResult), '');
mLogScript(sJSONResponse, '');
end.
Script work result
[16:05:44] (Log "TurboSMSSendExt"): Result: 800
[16:05:44] (Log "TurboSMSSendExt"): {"response_code":800,"response_status":"SUCCESS_MESSAGE_ACCEPTED","response_result":[{"phone":"380504452169","message_id":"a7ccfba4-60a1-12f0-1c90-382232dfae71","response_code":0,"response_status":"OK"}]}
[16:05:44] (Run "TurboSMSSendExt"): Script operation time: 766 ms
[16:05:44] (Run "TurboSMSSendExt"): Script done successfully.
See also
Help page for TurboSMS service via HTTP API, commands, answers, possible errors
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool