MyChat Scripts: mIntegrationTurboSMSGetBalance, TurboSMS balance status
Get the balance status in the service TurboSMS in kopecks.
Syntax
function mIntegrationTurboSMSGetBalance(var sJSONResponse: string): integer;
Parameters and return values
Parameter |
Type |
Value |
sJSONResponse |
string |
JSON object, full response from the service. |
Function result
-1 |
service is off, no access to it, or another error occurred; |
>=0 |
balance in kopecks. |
Example
var
iBalance: integer;
sJSONResponse: string;
begin
iBalance := mIntegrationTurboSMSGetBalance(sJSONResponse);
mLogScript(IntToStr(iBalance), '');
mLogScript(sJSONResponse, '');
end.
Script work result
[14:03:06] (Log "TurboSMSGetBalance"): 62
[14:03:06] (Log "TurboSMSGetBalance"): {"response_code":0,"response_status":"OK","response_result":{"balance":0.62}}
[14:03:06] (Run "TurboSMSGetBalance"): Script operation time: 826 ms
[14:03:06] (Run "TurboSMSGetBalance"): Script done successfully.
See also
Help page for TurboSMS service via HTTP API, commands, answers, possible errors
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help Authoring Tool