-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.php
More file actions
50 lines (34 loc) · 1020 Bytes
/
test.php
File metadata and controls
50 lines (34 loc) · 1020 Bytes
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
<?php
include ( "api.php" );
//lets test the API
//Send an SMS
//sends one sms and returns a text
//enter your api key
$key = '';
//enter your api username
$username = '';
//enter message to be send
$msg = "I love wasaTEXTO";
//enter sender
$from = "";
//enter recipient's number
$to = "";
//send the message and a notice is returned
$api = new Api($key, $username);
$result = $api->send($msg, $from, $to);
//json decode messsage
$result_decoded = json_decode($result);
// Status code = 200 if sms was delivered
echo $result_decoded->status."<br />";
// to get the notification do this
echo $result_decoded->notice."<br />";
//number of pages delivered
echo $result_decoded->message_count. "<br /><br />";
//to check your balance
$balance = $api->balance();
$balance_decoded = json_decode($balance);
//Notice
echo $balance_decoded->notice."<br />";
//Credit Left
echo $balance_decoded->balance."<br />";
?>