vendredi 16 août 2019

i am trying make sms service at aws server using laraval 5.8 but getting error below

This is my controller file

{

protected function sendSMS(){
    //echo "test";die;
    $sms = AWS::createClient('sns');

 $result = $sms->publish([
            'Message' => 'Hello, This is just a test Message',
            'PhoneNumber' => '+919711......',    
            'MessageAttributes' => [
                'AWS.SNS.SMS.SMSType'  => [
                    'DataType'    => 'String',
                    'StringValue' => 'Transactional',
                 ]
             ],
          ]);
 var_dump($result);
 return Response()->json($result);
}

} Above code getting error { "message": "Error executing \"Publish\" on \"https://sns.us-east-1.amazonaws.com\"; AWS HTTP error: Client error: POST https://sns.us-east-1.amazonaws.com resulted in a 403 Forbidden response:\nhttp://sns.amazonaws.com/doc/2010-03-31/\">\n \n Sender\n InvalidClie (truncated...)\n InvalidClientTokenId (client): The security token included in the request is invalid. - http://sns.amazonaws.com/doc/2010-03-31/\">\n \n Sender\n InvalidClientTokenId\n The security token included in the request is invalid.\n \n a38862b7-7857-509e-aba6-3767d5bd7efb\n\n", "exception": "Aws\Sns\Exception\SnsException", "file": "/home/kanak/workspace/btutee-app/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php",

I have follow article https://www.kerneldev.com/2018/01/03/send-sms-in-laravel-using-aws-sns/ i have search everywhere above this but not getting exact solution for this.i have fixed all keys right.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2z3qQzg
via IFTTT

Aucun commentaire:

Enregistrer un commentaire