简体   繁体   English

包含Office365 API OneNote API

[英]Office365 API OneNote API included

Months ago I integrated Office365 sign on on my website. 几个月前,我在网站上集成了Office365登录。 (I used office365 account to sign in to my website). (我使用office365帐户登录到我的网站)。

Now I want to include Onenote API feature like create page, create section etc. 现在,我想包括Onenote API功能,例如创建页面,创建部分等。

I research that is possible with office365 login you have access to the Onenote API. 我研究使用Office365登录可能实现的,您可以访问Onenote API。

First of all I modified the app which we use before on azure (include onenote in app). 首先,我修改了我们之前在天蓝色上使用的应用程序(在应用程序中包含onenote)。

Login with office365 works fine, but when I try to communicate with onenote I always get unauthorized code (401). 使用office365登录可以正常工作,但是当我尝试与onenote通信时,总是得到未授权的代码(401)。

I used this library https://github.com/ankitsam/office365-api-php-client/blob/master/src/Office365_Client.php for office365 client. 我将这个库https://github.com/ankitsam/office365-api-php-client/blob/master/src/Office365_Client.php用于Office365客户端。 And when I try to access 当我尝试访问
the scope is: 范围是:

stdClass Object
(
    [token_type] => Bearer
    [expires_in] => 3599
    [scope] => Contacts.Read Mail.Read User.Read User.Read.All
    [expires_on] => 1444251788
    [not_before] => 1444247888
    [resource] => https://graph.microsoft.com/
    [access_token] => access_token here
    [refresh_token] => refresh_token here
    [id_token] => id_token here
)

I don't see on scope Onenote scope (I include on azure app). 我在范围Onenote范围上看不到(我在azure应用程序中包含)。

Thanks 谢谢

The problem was at [resource] url. 问题出在[resource] url。 To communicate with onenote we need to use [resource] => https://onenote.com/ 要与onenote通信,我们需要使用[resource] => https://onenote.com/

Thanks 谢谢

Try to use Microsoft OneNote API for php in github. 尝试在github中将Microsoft OneNote API用于php。 it is up to date to the recent changes in o365 api. 它是最新的o365 api的最新更改。

https://github.com/OneNoteDev/OneNoteAPISamplePHP https://github.com/OneNoteDev/OneNoteAPISamplePHP

Also, you can test out your code using this console: https://apigee.com/onenote/embed/console/onenote/?apig_cc=1 另外,您可以使用以下控制台测试您的代码: https : //apigee.com/onenote/embed/console/onenote/?apig_cc=1

Here is a tutorial on how to use this console: 这是有关如何使用此控制台的教程:

https://msdn.microsoft.com/en-us/library/office/dn575419.aspx https://msdn.microsoft.com/zh-CN/library/office/dn575419.aspx

Hope this helps. 希望这可以帮助。

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

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