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

Running sample app fails with unsupported segment type

Open philipodonnell opened this issue 10 years ago • 5 comments

Downloaded and started the stock Node.JS sample app from the site: http://dev.office.com/getting-started/office365apis

Connected to my account, any attempt to send the email fails with this in the terminal:

400
Bad Request
Response: {
  "error": {
    "code": "BadRequest",
    "message": "Unsupported segment type.",
    "innerError": {
      "request-id": "95b3a68d-e2ae-44fa-b192-53a5c350542b",
      "date": "2016-02-19T22:03:12"
    }
  }
}
Send mail status code: 400

philipodonnell avatar Feb 19 '16 22:02 philipodonnell

Hey @philipodonnell

I tried both versions and you're right, the one from dev.office.com crashes. The one from this repo works fine.

I noticed that the sample from http://dev.office.com/getting-started/office365apis has the following in routes/index.js line 89:

requestUtil.postData('graph.microsoft.com', '/v1.0/me/sendMail'...

That same line from this repo has the following:

requestUtil.postData('graph.microsoft.com', '/v1.0/me/microsoft.graph.sendMail'...

If you update the endpoint to microsoft.graph.sendMail it works okay.

Let me know if that solves the issue. If so, I'll contact the people at dev.office.com to update their package.

Thank you for trying this sample.

ricalo avatar Feb 20 '16 00:02 ricalo

@ricalo That worked great, thanks so much for pointing out the diff.

philipodonnell avatar Feb 20 '16 02:02 philipodonnell

No problem, thank you for letting is know :+1:

ricalo avatar Feb 21 '16 23:02 ricalo

@Ricalo should we loop in @keyur32 to aid us in getting this updated in the Getting Started exp?

iambmelt avatar Feb 25 '16 18:02 iambmelt

Yes, @jamescro already notified him. A fix is in the way. Thanks for the reminder, @iambmelt

ricalo avatar Feb 25 '16 19:02 ricalo