-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.pl
executable file
·100 lines (81 loc) · 2.97 KB
/
sample.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/perl
use strict;
use Data::Dumper;
use BSGAPI;
my $apikey = 'test_8zWaPwOaHDPRFmgIldhl';
my $api = new BSGAPI($apikey);
print Dumper($api->balance());
print Dumper($api->HLRCreate('msisdn'=>'380972920000', 'reference'=>'extid1'));
print Dumper($api->HLRCreate(
[
{
"msisdn"=>"380972920000",
"reference"=>"extid1",
"tariff"=>"0",
"callback_url"=>"http://someurl.com/callback/?id=12345"
},
{
"msisdn"=>"380972920000",
"reference"=>"extid2",
"tariff"=>"0",
"callback_url"=>"http://someurl.com/callback/?id=12346"
}
]
));
print Dumper($api->HLR(2));
print Dumper($api->HLR('reference'=>'380972920000'));
print Dumper($api->price('hlr'));
print Dumper($api->price('sms'));
print Dumper($api->price('viber'=>1));
print Dumper($api->sms(174044));
print Dumper($api->sms("task"=>17));
print Dumper($api->sms("reference"=>"ext_id_17"));
print Dumper($api->smsSend("destination"=>"phone",
"originator"=>"alpha name",
"body"=>"message text",
"msisdn"=>"380972000000",
"reference"=>"ext_id_16",
"validity"=>"1",
"tariff"=>"0"
));
print Dumper($api->smsSend("destination"=>"phones",
"originator"=>"alpha name",
"body"=>"message text",
"reference"=>"ext_id_16",
"validity"=>"1",
"tariff"=>"0",
"phones"=>[
{
"msisdn"=>"380972000000",
"reference"=>"ext_id_17"
},
{
"msisdn"=>"380972000001",
"reference"=>"ext_id_18"
}
]
));
print Dumper($api->viber(174044));
print Dumper($api->viberSend("tariff"=>"0",
"validity"=>"1",
"messages"=>[
{
"to"=>[
{
"msisdn"=>"380973973859",
"reference"=>"ext_id_19"
}
],
"text"=>"My Viber messages is shinier than your SMS messages",
"alpha_name"=>"BSG",
"is_promotional"=>0,
"options"=>{
"viber"=>{
"img"=>"http://mysite.com/logo.png",
"caption"=>"See Details",
"action"=>"http://mysite.com/"
}
}
}
]
));