Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit df66bf9

Browse files
author
Technical Department
committed
Added SMS HTTP API manual & examples of Delphi
1 parent 40ecfce commit df66bf9

8 files changed

+1041
-0
lines changed

DELPHI V3.10/Balance.dpr

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//.---------------------------------------------------------------------------.
2+
//| Software: HTTP API - Get SMS Account Balance Example |
3+
//| Version: 3.10 |
4+
//| Email: [email protected] |
5+
//| Info: http://www.solutions4mobiles.com |
6+
//| Phone: +44 203 318 3618 |
7+
//| ------------------------------------------------------------------------- |
8+
//| Copyright (c) 1999-2014, Mobiweb Ltd. All Rights Reserved. |
9+
//| ------------------------------------------------------------------------- |
10+
//| LICENSE: |
11+
//| Distributed under the General Public License v3 (GPLv3) |
12+
//| http://www.gnu.org/licenses/gpl-3.0.html |
13+
//| This program is distributed AS IS and in the hope that it will be useful |
14+
//| WITHOUT ANY WARRANTY; without even the implied warranty of |
15+
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16+
//| ------------------------------------------------------------------------- |
17+
//| SERVICES: |
18+
//| We offer a number of paid services at http//www.solutions4mobiles.com: |
19+
//| - Bulk SMS / MMS / Premium SMS Services / HLR Lookup Service |
20+
//| ------------------------------------------------------------------------- |
21+
//| HELP: |
22+
//| - This class requires a valid HTTP API Account. Please email to |
23+
//| [email protected] to get one |
24+
//.---------------------------------------------------------------------------.
25+
26+
// Get SMS Account Balance Example
27+
// @copyright 1999 - 2014 Mobiweb Ltd.
28+
29+
program Balance;
30+
31+
{$APPTYPE CONSOLE}
32+
33+
{$R *.res}
34+
35+
uses
36+
SysUtils,
37+
IdHTTP,
38+
Classes;
39+
40+
var
41+
lHTTP: TIdHTTP;
42+
lParamList: TStringList;
43+
lResult: String;
44+
begin
45+
lParamList := TStringList.Create;
46+
lParamList.Add('username=username'); //The HTTP API username of your account.
47+
lParamList.Add('password=password'); //The HTTP API password of your account.
48+
lParamList.Add('provider=solutions4mobiles.com'); //The SMS Provider.
49+
50+
lHTTP := TIdHTTP.Create(nil); //Create object of class required for POST request.
51+
try
52+
lResult := lHTTP.Post('http://IPADDRESS/balance_script', lParamList); //Execute the SMS HTTP API request.
53+
WriteLn(lResult); //Print response
54+
Readln;
55+
finally
56+
FreeAndNil(lHTTP); //Flush and close objects.
57+
FreeAndNil(lParamList);
58+
end;
59+
end.

DELPHI V3.10/MultipleRecipientSMS.dpr

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//.---------------------------------------------------------------------------.
2+
//| Software: HTTP API - SMS Multiple Recipients SMS Example |
3+
//| Version: 3.10 |
4+
//| Email: [email protected] |
5+
//| Info: http://www.solutions4mobiles.com |
6+
//| Phone: +44 203 318 3618 |
7+
//| ------------------------------------------------------------------------- |
8+
//| Copyright (c) 1999-2014, Mobiweb Ltd. All Rights Reserved. |
9+
//| ------------------------------------------------------------------------- |
10+
//| LICENSE: |
11+
//| Distributed under the General Public License v3 (GPLv3) |
12+
//| http://www.gnu.org/licenses/gpl-3.0.html |
13+
//| This program is distributed AS IS and in the hope that it will be useful |
14+
//| WITHOUT ANY WARRANTY; without even the implied warranty of |
15+
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16+
//| ------------------------------------------------------------------------- |
17+
//| SERVICES: |
18+
//| We offer a number of paid services at http//www.solutions4mobiles.com: |
19+
//| - Bulk SMS / MMS / Premium SMS Services / HLR Lookup Service |
20+
//| ------------------------------------------------------------------------- |
21+
//| HELP: |
22+
//| - This class requires a valid HTTP API Account. Please email to |
23+
//| [email protected] to get one |
24+
//.---------------------------------------------------------------------------.
25+
26+
// SMS Multiple Recipients SMS Example
27+
// @copyright 1999 - 2014 Mobiweb Ltd.
28+
29+
program MultipleRecipientSMS;
30+
31+
{$APPTYPE CONSOLE}
32+
33+
{$R *.res}
34+
35+
uses
36+
SysUtils, IdHTTP,Classes;
37+
38+
var
39+
lHTTP: TIdHTTP;
40+
lParamList: TStringList;
41+
lResult: String;
42+
begin
43+
lParamList := TStringList.Create;
44+
lParamList.Add('username=username'); //The HTTP API username of your account.
45+
lParamList.Add('password=password'); //The HTTP API password of your account.
46+
lParamList.Add('msgtext=Hello World'); //The SMS Message text.
47+
lParamList.Add('originator=TestAccount'); //The desired Originator of your message.
48+
lParamList.Add('phone=recipient1,recipient2'); //The full International mobile number of the
49+
//recipient excluding the leeding +.
50+
//multiple recipients, separate each number with a
51+
//comma. Please note that no blanks can be used
52+
lParamList.Add('showDLR=0'); //Set to 1 for requesting delivery report
53+
//of this sms. A unique id is returned to use
54+
//with your delivery report request.
55+
lParamList.Add('charset=0'); //The SMS Message text Charset.
56+
lParamList.Add('msgtype='); //If set to F the sms is sent as Flash.
57+
lParamList.Add('provider=solutions4mobiles.com'); //The SMS Provider.
58+
59+
lHTTP := TIdHTTP.Create(nil); //Create object of class required for POST request.
60+
try
61+
lResult := lHTTP.Post('http://IPADDRESS/send_script', lParamList); //Execute the SMS HTTP API request.
62+
WriteLn(lResult); //Print response
63+
Readln;
64+
finally
65+
FreeAndNil(lHTTP); //Flush and close objects.
66+
FreeAndNil(lParamList);
67+
end;
68+
end.

DELPHI V3.10/SMSWithDLR.dpr

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//.---------------------------------------------------------------------------.
2+
//| Software: HTTP API - SMS with Delivery Report Example |
3+
//| Version: 3.10 |
4+
//| Email: [email protected] |
5+
//| Info: http://www.solutions4mobiles.com |
6+
//| Phone: +44 203 318 3618 |
7+
//| ------------------------------------------------------------------------- |
8+
//| Copyright (c) 1999-2014, Mobiweb Ltd. All Rights Reserved. |
9+
//| ------------------------------------------------------------------------- |
10+
//| LICENSE: |
11+
//| Distributed under the General Public License v3 (GPLv3) |
12+
//| http://www.gnu.org/licenses/gpl-3.0.html |
13+
//| This program is distributed AS IS and in the hope that it will be useful |
14+
//| WITHOUT ANY WARRANTY; without even the implied warranty of |
15+
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16+
//| ------------------------------------------------------------------------- |
17+
//| SERVICES: |
18+
//| We offer a number of paid services at http//www.solutions4mobiles.com: |
19+
//| - Bulk SMS / MMS / Premium SMS Services / HLR Lookup Service |
20+
//| ------------------------------------------------------------------------- |
21+
//| HELP: |
22+
//| - This class requires a valid HTTP API Account. Please email to |
23+
//| [email protected] to get one |
24+
//.---------------------------------------------------------------------------.
25+
26+
// SMS with Delivery Report Example
27+
// @copyright 1999 - 2014 Mobiweb Ltd.
28+
29+
program SMSWithDLR;
30+
31+
{$APPTYPE CONSOLE}
32+
33+
{$R *.res}
34+
35+
uses
36+
SysUtils,
37+
IdHTTP,
38+
Classes;
39+
40+
var
41+
lHTTP: TIdHTTP;
42+
lParamList: TStringList;
43+
lResult: String;
44+
begin
45+
lParamList := TStringList.Create;
46+
lParamList.Add('username=username'); //The HTTP API username of your account.
47+
lParamList.Add('password=password'); //The HTTP API password of your account.
48+
lParamList.Add('msgtext=Hello World'); //The SMS Message text.
49+
lParamList.Add('originator=TestAccount'); //The desired Originator of your message.
50+
lParamList.Add('phone=recipient'); //The full International mobile number of the
51+
//recipient excluding the leeding +.
52+
lParamList.Add('showDLR=1'); //Set to 1 for requesting delivery report
53+
//of this sms. A unique id is returned to use
54+
//with your delivery report request.
55+
lParamList.Add('charset=0'); //The SMS Message text Charset.
56+
lParamList.Add('msgtype='); //If set to F the sms is sent as Flash.
57+
lParamList.Add('provider=solutions4mobiles.com'); //The SMS Provider.
58+
59+
lHTTP := TIdHTTP.Create(nil); //Create object of class required for POST request.
60+
try
61+
lResult := lHTTP.Post('http://IPADDRESS/send_script', lParamList); //Execute the SMS HTTP API request.
62+
WriteLn(lResult); //Print response
63+
//IMPORTANT: Store the unique id and use it with Automatic DLR Forwarding.
64+
Readln;
65+
finally
66+
FreeAndNil(lHTTP); //Flush and close objects.
67+
FreeAndNil(lParamList);
68+
end;
69+
end.

DELPHI V3.10/SimpleSMS.dpr

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//.---------------------------------------------------------------------------.
2+
//| Software: HTTP API - Send SMS Example: Simple Text SMS |
3+
//| Version: 3.10 |
4+
//| Email: [email protected] |
5+
//| Info: http://www.solutions4mobiles.com |
6+
//| Phone: +44 203 318 3618 |
7+
//| ------------------------------------------------------------------------- |
8+
//| Copyright (c) 1999-2014, Mobiweb Ltd. All Rights Reserved. |
9+
//| ------------------------------------------------------------------------- |
10+
//| LICENSE: |
11+
//| Distributed under the General Public License v3 (GPLv3) |
12+
//| http://www.gnu.org/licenses/gpl-3.0.html |
13+
//| This program is distributed AS IS and in the hope that it will be useful |
14+
//| WITHOUT ANY WARRANTY; without even the implied warranty of |
15+
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16+
//| ------------------------------------------------------------------------- |
17+
//| SERVICES: |
18+
//| We offer a number of paid services at http//www.solutions4mobiles.com: |
19+
//| - Bulk SMS / MMS / Premium SMS Services / HLR Lookup Service |
20+
//| ------------------------------------------------------------------------- |
21+
//| HELP: |
22+
//| - This class requires a valid HTTP API Account. Please email to |
23+
//| [email protected] to get one |
24+
//.---------------------------------------------------------------------------.
25+
26+
// Simple Text SMS
27+
// @copyright 1999 - 2014 Mobiweb Ltd.
28+
29+
program SimpleSMS;
30+
31+
{$APPTYPE CONSOLE}
32+
33+
{$R *.res}
34+
35+
uses
36+
SysUtils, IdHTTP,Classes;
37+
38+
var
39+
lHTTP: TIdHTTP;
40+
lParamList: TStringList;
41+
lResult: String;
42+
begin
43+
lParamList := TStringList.Create;
44+
lParamList.Add('username=username'); //The HTTP API username of your account.
45+
lParamList.Add('password=password'); //The HTTP API password of your account.
46+
lParamList.Add('msgtext=Hello World'); //The SMS Message text.
47+
lParamList.Add('originator=TestAccount'); //The desired Originator of your message.
48+
lParamList.Add('phone=recipient'); //The full International mobile number of the
49+
//recipient excluding the leeding +.
50+
lParamList.Add('showDLR=0'); //Set to 1 for requesting delivery report
51+
//of this sms. A unique id is returned to use
52+
//with your delivery report request.
53+
lParamList.Add('charset=0'); //The SMS Message text Charset.
54+
lParamList.Add('msgtype='); //If set to F the sms is sent as Flash.
55+
lParamList.Add('provider=solutions4mobiles.com'); //The SMS Provider.
56+
57+
lHTTP := TIdHTTP.Create(nil); //Create object of class required for POST request.
58+
try
59+
lResult := lHTTP.Post('http://IPADDRESS/send_script', lParamList); //Execute the SMS HTTP API request.
60+
WriteLn(lResult); //Print response
61+
Readln;
62+
finally
63+
FreeAndNil(lHTTP); //Flush and close objects.
64+
FreeAndNil(lParamList);
65+
end;
66+
end.

DELPHI V3.10/UnicodeSMS.dpr

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//.---------------------------------------------------------------------------.
2+
//| Software: HTTP API - Unicode SMS |
3+
//| Version: 3.10 |
4+
//| Email: [email protected] |
5+
//| Info: http://www.solutions4mobiles.com |
6+
//| Phone: +44 203 318 3618 |
7+
//| ------------------------------------------------------------------------- |
8+
//| Copyright (c) 1999-2014, Mobiweb Ltd. All Rights Reserved. |
9+
//| ------------------------------------------------------------------------- |
10+
//| LICENSE: |
11+
//| Distributed under the General Public License v3 (GPLv3) |
12+
//| http://www.gnu.org/licenses/gpl-3.0.html |
13+
//| This program is distributed AS IS and in the hope that it will be useful |
14+
//| WITHOUT ANY WARRANTY; without even the implied warranty of |
15+
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16+
//| ------------------------------------------------------------------------- |
17+
//| SERVICES: |
18+
//| We offer a number of paid services at http//www.solutions4mobiles.com: |
19+
//| - Bulk SMS / MMS / Premium SMS Services / HLR Lookup Service |
20+
//| ------------------------------------------------------------------------- |
21+
//| HELP: |
22+
//| - This class requires a valid HTTP API Account. Please email to |
23+
//| [email protected] to get one |
24+
//.---------------------------------------------------------------------------.
25+
26+
// Unicode SMS
27+
// @copyright 1999 - 2014 Mobiweb Ltd.
28+
29+
program UnicodeSMS;
30+
31+
{$APPTYPE CONSOLE}
32+
33+
{$R *.res}
34+
35+
uses
36+
SysUtils,
37+
IdHTTP,
38+
Classes;
39+
40+
var
41+
lHTTP: TIdHTTP;
42+
lParamList: TStringList;
43+
lResult: String;
44+
begin
45+
lParamList := TStringList.Create;
46+
lParamList.Add('username=username'); //The HTTP API username of your account.
47+
lParamList.Add('password=password'); //The HTTP API password of your account.
48+
lParamList.Add('msgtext=063506280627062D002006270644062E064A0631'); //SMS Message text 'Good Morning' in Arabic.
49+
lParamList.Add('originator=TestAccount'); //The desired Originator of your message.
50+
lParamList.Add('phone=recipient'); //The full International mobile number of the
51+
//recipient excluding the leeding +.
52+
lParamList.Add('showDLR=0'); //Set to 1 for requesting delivery report
53+
//of this sms. A unique id is returned to use
54+
//with your delivery report request.
55+
lParamList.Add('charset=6'); //The SMS Message text Charset.
56+
lParamList.Add('msgtype='); //If set to F the sms is sent as Flash.
57+
lParamList.Add('provider=solutions4mobiles.com'); //The SMS Provider.
58+
59+
lHTTP := TIdHTTP.Create(nil); //Create object of class required for POST request.
60+
try
61+
lResult := lHTTP.Post('http://IPADDRESS/send_script', lParamList); //Execute the SMS HTTP API request.
62+
WriteLn(lResult); //Print response
63+
Readln;
64+
finally
65+
FreeAndNil(lHTTP); //Flush and close objects.
66+
FreeAndNil(lParamList);
67+
end;
68+
end.

0 commit comments

Comments
 (0)