I’m trying to learn about working with an SMS script. It currently, successfully sends a message, and I’m wondering how to add a very basic html User Interface with this php code:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = new \Swagger\Client\Configuration();
$config->setUsername('------------');
$config->setPassword('------------');
$apiInstance = new Swagger\Client\Api\MessageApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$api_version = "1.0"; // string | API Version. If not specified your pinned verison is used.
$message = new \Swagger\Client\Model\CreateMessage(); // \Swagger\Client\Model\CreateAccount | Subaccount object
date_default_timezone_set('America/Los_Angeles');
$message->setDestination(["+---------"]);
$message->setSource("+---------");
$message->setText("Hello");
try {
$result = $apiInstance->sendMessage($api_version, $message);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MessageApi->createMessage: ', $e->getMessage(), PHP_EOL;
}
?>
Any input/guidance/insight will be appreciated.