1 min to read

PHP - Guzzle (API - Query)


This is an example query of the API with Guzzle in PHP

<?php
$client = new Client();
$headers = [
  'Content-Type' => 'application/x-www-form-urlencoded'
];
$options = [
'form_params' => [
  'apy_key' => 'XXXXXXXX',
  'apy_secret' => 'XXXXXXXX',
  'to' => '+41790000000',
  'from' => 'Test',
  'text' => 'Hey, this is a test'
]];
$request = new Request('POST', 'https://smsly.ch/api/', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();








On This Page