This is not an issue, it's more a feature request.
I'm using the code below to send messages and everything works perfectly. I was just wondering if there is a way to get the whole response? After inspecting the response object I can see it is an instance of Vonage\SMS\Collection and the whole response is stored inside a protected property $data. However, I cannot access it directly (for example, to keep a responses log). Would it be possible to add a method getData() that exposes the $data property?
<?php
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../vendor/autoload.php';
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
$client = new \Vonage\Client($basic);
$response = $client->sms()->send(
new \Vonage\SMS\Message\SMS(TO_NUMBER, BRAND_NAME, 'A text message sent using the Nexmo SMS API')
);
$message = $response->current();
if ($message->getStatus() == 0) {
echo "The message was sent successfully\n";
} else {
echo "The message failed with status: " . $message->getStatus() . "\n";
}
Hey guys,
This is not an issue, it's more a feature request.
I'm using the code below to send messages and everything works perfectly. I was just wondering if there is a way to get the whole response? After inspecting the response object I can see it is an instance of
Vonage\SMS\Collection
and the whole response is stored inside a protected property$data
. However, I cannot access it directly (for example, to keep a responses log). Would it be possible to add a methodgetData()
that exposes the$data
property?