Inicializacjia
Przyklad:
try {
}
{
echo $e->getMessage();
}
smsAPI_HTTPClient
__construct
(string $username, string $password, [int $timeout = 0], [bool $ssl = true], [int $method = self::METHOD_POST])
-
string
$username: Nazwa użytkownika w serwisie smsAPI
-
string
$password: Hasło do Twojego konta w serwisie smsAPI zaszyfrowane w MD5
-
int
$timeout: Timeout polączenia
-
bool
$ssl: http lub https
-
int
$method: Sposób przesyania danych do smsAPI
Usuwanie zaplanowanej wiadomości
Przyklad:
try {
}
{
echo $e->getMessage();
}
null
delete_sms
(string $id)
-
string
$id: ID wiadomości w systemie smsAPI
Sprawdzenie ilości punktów na koncie
Przyklad
try {
}
{
echo $e->getMessage();
}
stdClass(points,pro,eco)
get_points
([bool $details = false])
Utwórz nowa wiadomość
Przyklad:
try {
//Tworzenie wiadomości
$msg->add_to( 'xxxxxxxxx', 'xxxxxxxxx' );
$msg->message = 'test message';
$msg->eco = TRUE;
$msg->flash = FALSE;
//Wysłanie wiadomości
$result = $msg->send();
//array
// 0 =>
// object(stdClass)[3]
// public 'id' => string '1010131304559538088' (length=19)
// public 'points' => string '0.07' (length=1)
}
{
echo $e->getMessage();
}
Wysyłanie pojedynczego SMS'a
Przyklad:
//Tworzenie wiadomości
$msg->add_to( 'xxxxxxxxx', 'xxxxxxxxx' );
$msg->message = 'test message';
$msg->eco = TRUE;
$msg->flash = FALSE;
try {
//Wysłanie wiadomości
//array
// 0 =>
// object(stdClass)[3]
// public 'id' => string '1010131304559538088' (length=19)
// public 'points' => string '0.07' (length=1)
}
{
echo $e->getMessage();
}
Wywolanie zapytania do strony smsAPI.pl
string
server_call
(string $params)