Sample totally not working
Everytime saying Bad Request after successful login. Thats always, everywhere and on several machines.
Hi @ZayaPro . Thanks for reporting this issue. You are getting the error after you click the Send mail button? Can you please log into Graph explorer with the same account and see if it reproduces there? Here's the request:
POST https://graph.microsoft.com/v1.0/me/sendMail (or https://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail, which this sample uses)
Replace ENTER YOUR EMAIL ADDRESS in the email body below, and then paste it into the Request Body field:
{"Message":{"Subject":"Welcome to Office 365 development with Node.js and the Office 365 Connect sample","Body":{"ContentType":"HTML","Content":"<html><head> <meta http-equiv='Content-Type' content='text/html; charset=us-ascii'> <title></title> </head><body style='font-family:calibri'> <p>Congratulations Alex Darrow,</p> <p>This is a message from the Microsoft Graph Connect Sample.</p> <h3>What’s next?</h3> <ul><li>Check out <a href='https://graph.microsoft.io' target='_blank'>graph.microsoft.io</a>.</li><li>Use the <a href='https://graph.microsoft.io/graph-explorer' target='_blank'>Graph explorer</a> to explore the rest of the APIs and start your testing.</li><li>Browse other <a href='https://github.com/microsoftgraph/' target='_blank'>samples on GitHub</a> to see more of the APIs in action.</li></ul> <h3>Give us feedback</h3> <p>If you have any trouble running this sample, please <a href='https://github.com/microsoftgraph/nodejs-connect-rest-sample/issues' target='_blank'>log an issue</a>.</p><p>For general questions about the Microsoft Graph API, post to <a href='https://stackoverflow.com/questions/tagged/microsoftgraph' target='blank'>Stack Overflow</a>. Make sure that your questions or comments are tagged with [microsoftgraph].</p><p>Thanks and happy coding!<br>Your Microsoft Graph samples development team </p> <div style='text-align:center; font-family:calibri'> <table style='width:100%; font-family:calibri'> <tbody> <tr> <td><a href='https://github.com/microsoftgraph/nodejs-connect-rest-sample'>See on GitHub</a> </td> <td><a href='https://officespdev.uservoice.com'>Suggest on UserVoice</a> </td> <td><a href='https://twitter.com/share?text=I%20just%20started%20developing%20apps%20for%20%23NodeJS%20using%20the%20%23MicrosoftGraph%20Connect%20app%20%40OfficeDev&url=https://github.com/microsoftgraph/nodejs-connect-rest-sample'>Share on Twitter</a> </td> </tr> </tbody> </table> </div> </body> </html>"},"ToRecipients":[{"EmailAddress":{"Address":"ENTER YOUR EMAIL ADDRESS"}}]},"SaveToSentItems":true}
If you do get the error in Graph explorer, can you please post the response body here?
If you don't get the error in Graph explorer, can you put a breakpoint on line 85 of requestUtils.js, run the sample, and then post the body string value here?
Hi @ZayaPro . Please reopen this issue if you're still having problems.