I have been trying to use guzzle for sending bulk sms from bulksms.com and it is returning this error,
guzzlehttp\exception\clientexception client error: post https://api.bulksms.com/v1/messages resulted in a 401 full authentication is required to access this resource response: : "type" "https://developer.bulksms.com/json/v1/errors#authentication-failed
My code
$client = new Client([
'base_uri'=>'https://www.bulksms.com/',
'timeout'=>'900.0'
]);
//$result = $client->post('', [
// 'form_params' => [
// 'sample-form-data' => 'value'
// ]
//]);
$result = $client->request('POST','https://api.bulksms.com/v1/messages', [
'form_params' => [
'username' => 'username',
'password' => '****',
'sender' => 'my appname',
'recipients' => '+5555555555',
'message' => 'Testing message',
]
]);