简体   繁体   English

用于Office365的OneDrive for busines API

[英]OneDrive for busines API with Office365

I'm writing a library on php to communicate Office365, and now I need to communicate with OneDrive for business. 我正在用php写一个库来与Office365通信,现在我需要与OneDrive for business通信。

I follow all the steps from this link https://dev.onedrive.com/auth/aad_oauth.htm 我遵循此链接https://dev.onedrive.com/auth/aad_oauth.htm的所有步骤

When i try to connect with curl 当我尝试用curl连接时

GET {serviceEndPointUri}/drive
Authorization: Bearer {access_token}

I get: 我得到:

[errorNumber] => 403
[error] => Request returned HTTP error 403

I follow exactly all the steps from documentation for access token 我完全按照访问令牌文档中的所有步骤进行操作

Any idea, 任何想法,

Thanks 谢谢

For OneDrive for business uses office 365 API (api.office.com); 对于OneDrive for business,使用office 365 API(api.office.com); Here is a sample on how to read files from OneDrive for business (o365). 这是有关如何从OneDrive for business(o365)读取文件的示例。 the link you were using is the Personal OneDrive (dev.onedrive.com). 您使用的链接是个人OneDrive(dev.onedrive.com)。

https://msdn.microsoft.com/office/office365/APi/files-rest-operations#UsetheOffice365clientlibraryGetanaccesstoken https://msdn.microsoft.com/office/office365/APi/files-rest-operations#UseOffice365客户端库获取访问令牌

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

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

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