$global_from
$global_from : string|null
Class SMS help send messages.
Class to make use of Info SMS API service to send sms messages. It extends Class API. A class to help quickly make request to api endpoints. Only Content-Type application/json is supported. And methods currently supported are GET and POST.
__construct(string $base_url, string $username, string $password, string|null $global_from = null)
SMS constructor.
It used to create a new instance of the SMS Class.
string | $base_url | INfobip Account Personal Base url. |
string | $username | Infobip Account Username. |
string | $password | Infobip Account Password. |
string|null | $global_from | Identification of the source of the SMS. |
send(string $text, string $to, string|null $from = null) : boolean|string
SMS public function send.
It is used to send SMS
string | $text | Body of the SMS |
string | $to | Number of the recipient |
string|null | $from | Name of the send. if null will fallback to global_from |
call(string $endpoint, string|array $data, array $extra_headers = null) : boolean|string
API protected function call.
A function used to make request to api endpoint. It clean the input data to a form suitable usable by the class
string | $endpoint | Endpoint to be used in addition to the base_url to construct full url path. |
string|array | $data | JsonEncoded string of the intended request data to send as the request body. |
array | $extra_headers | The result return after try to or connecting to the api endpoint. |
engine(string $end_point, string $data = null, array $extra_headers = null) : boolean|string
API private function engine.
A function used by the API class to actually make a curl request to the intended api endpoint.
string | $end_point | Endpoint to be used in addition to the base_url to construct full url path. |
string | $data | JsonEncoded string of the intended request data to send as the request body. |
array | $extra_headers | Any Extra headers that needs to be added to specific request. |
The result return after try to or connecting to the api endpoint.