jeudi 3 mai 2018

Laravel Access denied on outlook API

I am trying to send the email using outlook API from my laravel application. My code block is

$send   =   $graph->createRequest('POST', '/me/sendMail')
                            ->attachBody($mailBody)
                            ->execute();

and it gives me the Access denied error

Client error: `POST https://graph.microsoft.com/beta/me/sendMail` resulted in a `403 Forbidden` response:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",

I can see that access_token is set when I dump the graph and I have given the permissions to send email as well in my .env

OAUTH_SCOPES='openid profile offline_access User.Read Mail.Read Calendars.Read Mail.Send'



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire