Getting generic error "Error: Not Found" nodejs-connect-rest-sample\requestUtil.js:80:17
Error on screen after click "send email"
Error: Not Found
at IncomingMessage.
- Pulled the project
- registered a app in https://apps.dev.microsoft.com with my corporate email id ( 0365)
- configured client_id/client_secret
- ran npm start
- app showed up
- logged in microsoft and after success
- clicked "send mail" ..got the above error
my aim is to use graph api for our apps to email/post doc into sharepoint2013
Hi,@ayapsone.
Can you debug it?
you need to watch the value of that error variable at the 80 line of the requestUtil.js file if you can.
After debugging - found out that getting 404 for postSendMail() method Path has path: '/v1.0/me/microsoft.graph.sendMail'
I see '/v1.0/me/sendMail' in https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_sendmail#example
but that also getting 404.
Hi @ayapsone . Can you please log into Graph Explorer with the same user account and try the call there? Sometimes 404 is returned if your account isn't fully set up, so this should test that too. If you get an error response, then can you please send the entire response body that's returned?
-
Sign in with the account you used for the sample, and choose a POST request.
-
Enter this endpoint:
https://graph.microsoft.com/v1.0/me/sendMail(orhttps://graph.microsoft.com/v1.0/me/microsoft.graph.sendMailwhich is an older syntax that this sample uses). -
Paste this abbreviated version of the mail message into the Request Body section, but enter your email address for the Address attribute before sending:
{"Message":{"Subject":"Sent from the Microsoft Graph Connect sample","Body":{"ContentType":"HTML","Content":"<html><head>\r\n<meta http-equiv='Content-Type' content='text/html; charset=us-ascii'>\r\n<title></title>\r\n</head>\r\n<body style='font-family:calibri'>\r\n<h2>Congratulations!</h2>\r\n<p>This is a message from the Microsoft Graph Connect Sample. You are well on your way to incorporating Microsoft Graph endpoints in your apps.</p>\r\n<h3>What's next?</h3><ul>\r\n<li>Check out <a href='https://graph.microsoft.io'>graph.microsoft.io</a> to start building Microsoft Graph apps today with all the latest tools, templates, and guidance to get started quickly.</li>\r\n<li>Use the <a href='https://graph.microsoft.io/graph-explorer'>Graph explorer</a> to explore the rest of the APIs and start your testing.</li>\r\n<li>Browse other <a href='https://github.com/microsoftgraph/'>samples on GitHub</a> to see more of the APIs in action.</li>\r\n</ul>\r\n</body>\r\n</html>"},"ToRecipients":[{"EmailAddress":{"Address":"ENTER YOUR EMAIL HERE"}}]},"SaveToSentItems":true}
you are right,How do i setup my account then ? Getting 404 in graph explorer
client-request-id: c6de1668-cdd6-4bee-9ed2-aabcc7557573 content-type: application/json cache-control: private request-id: c6de1668-cdd6-4bee-9ed2-aabcc7557573 Status Code: 404 { "error": { "code": "ResourceNotFound", "message": "Resource could not be discovered.", "innerError": { "request-id": "c6de1668-cdd6-4bee-9ed2-aabcc7557573", "date": "2017-03-16T09:37:09" } } }
Someone with a similar issue was able to resolve it, I think by logging into https://portal.office.com. Can you try that and make sure you can send and receive email, and then try the query again?
The product team says this could also happen when a user's mailbox is present on an unsupported Exchange environment. In this case, an admin would have to upgrade the Exchange environment.
Or you could sign up for a free trial account/tenant, either a 30-day subscription or an Office 365 developer subscription.
Hi @ayapsone . Closing this issue. Please reopen if you're still having problems.