我一直在尝试使用guzzle从bulksms.com发送大量短信,并返回此错误,
guzzlehttp \ exception \ clientexception客户端错误:发布https://api.bulksms.com/v1/messages导致401满需要身份验证才能访问此资源响应::“ type”“ https://developer.bulksms.com/json/v1/errors#authentication-failed
我的代码
$client = new Client([
'base_uri'=>'https://www.bulksms.com/',
'timeout'=>'900.0'
]); //GuzzleHttp\Client
// $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',
]
]);
请与供应商联系一次,需要传递什么参数或示例代码。