Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use the access token to call the the Microsoft graph api? #41

Open
thebatmanreturns opened this issue May 16, 2020 · 1 comment

Comments

@thebatmanreturns
Copy link

No description provided.

@thebatmanreturns
Copy link
Author

thebatmanreturns commented May 16, 2020

Hi, I have a piece of code here:

$email = "{
    Message: {
    Subject: 'Sent using the Microsoft Graph REST API',
    Body: {
        ContentType: 'text',
        Content: 'This is the email body'
    },
    ToRecipients: [
        {
            EmailAddress: {
            Address: 'myemai@eemail.com'
            }
        }
    ]
    }}";



$response = $client->request('POST', 'https://graph.microsoft.com/v1.0/me/sendMail', [
    'headers' => [
        'Authorization' => 'Bearer ' . $entity->getAccessToken(),
        'Content-Type' => 'application/json;odata.metadata=minimal;odata.streaming=true'
    ],
    'body' => $email
]);

How can I use the access_token token provided by the magium and send an email? Please let me know.

@thebatmanreturns thebatmanreturns changed the title How can I use the access token to call the the microsft graph api? How can I use the access token to call the the Microsoft graph api? May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant