I'm trying to use Guzzle to make a request from my server, not a requirement. I use cURL and that works, however when I try with Guzzle I get a 403 error saying the client rejected my request which makes me believe the params are not being passed correctly.
This is my cURL code:
// Sending Sms
$url = "https://api.xxxxxx.com/v3/messages/send";
$from = "xxxxxx";
$to = $message->getTo();
$client_id = "xxxxxx";
$client_secret = "xxxxxx";
$query_string = "?From=".$from."&To=".$to."&Content=".$content."&ClientId=".$client_id."&ClientSecret=".$client_secret."&RegisteredDelivery=true";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url.$query_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec ($ch);
curl_close ($ch);
This is my Guzzle code now:
$client = new Client();
$response = $client->request('GET', "https://api.xxxxxx.com/v3/messages/send", [
"From" => "xxxxxx",
"To" => $message->getTo(),
"Content" => $content,
"ClientId" => "xxxxxx",
"ClientSecret" => "xxxxxx",
"RegisteredDelivery" => "true"
]);