nodejs-connect-rest-sample icon indicating copy to clipboard operation
nodejs-connect-rest-sample copied to clipboard

Getting generic error "Error: Not Found" nodejs-connect-rest-sample\requestUtil.js:80:17

Open ayapsone opened this issue 9 years ago • 6 comments

Error on screen after click "send email"


Error: Not Found at IncomingMessage. (C:\Workspaces\jsprojects\nodejs-connect-rest-sample\requestUtil.js:80:17) at emitNone (events.js:72:20) at IncomingMessage.emit (events.js:166:7) at endReadableNT (_stream_readable.js:921:12) at nextTickCallbackWith2Args (node.js:442:9) at process._tickCallback (node.js:356:17)


  1. Pulled the project
  2. registered a app in https://apps.dev.microsoft.com with my corporate email id ( 0365)
  3. configured client_id/client_secret
  4. ran npm start
  5. app showed up
  6. logged in microsoft and after success
  7. clicked "send mail" ..got the above error

my aim is to use graph api for our apps to email/post doc into sharepoint2013

ayapsone avatar Mar 15 '17 11:03 ayapsone

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.

FreedomPaul avatar Mar 15 '17 13:03 FreedomPaul

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.

ayapsone avatar Mar 15 '17 20:03 ayapsone

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?

  1. Sign in with the account you used for the sample, and choose a POST request.

  2. Enter this endpoint: https://graph.microsoft.com/v1.0/me/sendMail (or https://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail which is an older syntax that this sample uses).

  3. 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}

DianeD avatar Mar 15 '17 21:03 DianeD

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" } } }


ayapsone avatar Mar 16 '17 09:03 ayapsone

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.

DianeD avatar Mar 17 '17 16:03 DianeD

Hi @ayapsone . Closing this issue. Please reopen if you're still having problems.

DianeD avatar Apr 12 '17 14:04 DianeD