-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend-sms.php
More file actions
70 lines (58 loc) · 1.58 KB
/
send-sms.php
File metadata and controls
70 lines (58 loc) · 1.58 KB
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
<?php
// Import
require('JustSendClient.php');
// Errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
try
{
$curl = new JustSendClient();
$curl->SetMethod("POST");
$curl->SetJson();
// Token
$curl->AddToken('API-KEY-HERE');
// Wiadomość
$curl->AddUrl('https://justsend.pl/api/rest/v2/bulk/send');
$curl->AddData("name", "Powiadomienie");
$curl->AddData("groupId", 0);
$curl->AddData("sendDate", date(DATE_ATOM, time()));
$curl->AddData("bulkVariant","ECO"); // ECO, PRO, FULL
$curl->AddData("doubleEncode", true);
// Treść
$curl->AddData("from", "HellGirl");
$curl->AddData("message", "Testowa wiadomość");
// Pojedyńczy odbiorca
$curl->AddData("to", array("500111222"));
// Kilku odbiorców
// $curl->AddData("to", array("500111222","500222333"));
// Send
echo $curl->Send();
}catch(Exception $e){
print_r($e);
}
/*
try
{
$curl = new JustSendClient();
$curl->SetMethod("POST");
$curl->SetJson();
// Token
$curl->AddToken('API-KEY-HERE');
// Lub dla pojedyńczego odbiorcy
$curl->AddUrl('https://justsend.pl/api/rest/v2/message/send');
// Wiadomość
$curl->AddData("bulkVariant","ECO"); // ECO, PRO, FULL
$curl->AddData("doubleEncode", true);
$curl->AddData("from", "HellGirl");
$curl->AddData("message", "Testowa wiadomość");
$curl->AddData("to", "500111222");
// Send
echo $curl->Send();
}
catch(Exception $e)
{
print_r($e);
}
*/
?>