简体   繁体   English

OneNote API-REST和邮递员

[英]OneNote API - REST & Postman

I am trying to integrate the OneNote API as part of a new application. 我正在尝试将OneNote API集成为新应用程序的一部分。 Is it possible to use Google Chrome's POSTMAN REST Client to test the API? 是否可以使用Google Chrome浏览器的POSTMAN REST客户端来测试API? The OneNote API appears to be standard REST, so there should be no reason why not. OneNote API似乎是标准的REST,因此应该没有理由不这样做。

To login, I followed the documentation and did a GET request in POSTMAN to 要登录,我按照文档进行操作,并在POSTMAN中进行了GET请求以

https://login.live.com/oauth20_authorize.srf?client_id=myClientIdIsHere&scope=wl.signin&response_type=token&redirect_uri=dontKnowWhatToPutHere

Broken down, that is: 细分为:

https://login.live.com/oauth20_authorize.srf
client_id=myClientIdIsHere
scope=wl.signin
response_type=token
redirect_uri=dontKnowWhatToPutHere

I tried the following based off advice from this blog: http://blogs.msdn.com/b/onenotedev/archive/2014/07/23/how-to-authenticate-with-microsoft-account-in-a-chrome-extension.aspx 我根据此博客的建议尝试了以下方法: http : //blogs.msdn.com/b/onenotedev/archive/2014/07/23/how-to-authenticate-with-microsoft-account-in-a-chrome -extension.aspx

https://login.live.com/oauth20_authorize.srf?client_id=myClientIdIsHere&scope=wl.signin&response_type=token&redirect_uri=https://login.live.com/oauth20_desktop.srf

When I do a GET request to this, I get HTML back, but it does not show up in the preview mode. 当我对此执行GET请求时,我得到了HTML,但是在预览模式下没有显示。

Am I on the right track? 我在正确的轨道上吗?

The code that you are trying to execute is just the initial part of the oAuth login process. 您尝试执行的代码只是oAuth登录过程的初始部分。

As you have mentioned the below peice 正如您提到的以下香料

redirect_uri=dontKnowWhatToPutHere REDIRECT_URI = dontKnowWhatToPutHere

redirect_uri is the URL of your application. redirect_uri是您的应用程序的URL。 Once the authentication is success, the server will redirect the navigation to provided URL and you can proceed further from here. 身份验证成功后,服务器会将导航重定向到提供的URL,您可以从此处继续进行操作。 Just keep in mind that the URL given is as same as the one you have provided while creating the azure app. 请记住,给定的URL与创建azure应用程序时提供的URL相同。 If they do not match, the server is going to simply throw an exception. 如果它们不匹配,则服务器将简单地引发异常。

Please change the JSON to 请将JSON更改为

https://login.live.com/oauth20_authorize.srf
client_id=myClientIdIsHere
scope=wl.signin
response_type=token
redirect_uri=http://localhost:8008/login

Replace http://localhost:8008/login with your application login route. 用您的应用程序登录路由替换http:// localhost:8008 / login

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM