不能够使用一个驱动API为Business One的驱动器 [英] Not able to use One Drive API for One Drive for Business

查看:240
本文介绍了不能够使用一个驱动API为Business One的驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的winform应用程序(.NET 3.5)提供了一个驱动器的功能。我已经成功地实现了这个一个驱动器,但我有麻烦做它的一个驱动器业务。我已经注册我的应用程序在蔚蓝的,我能够验证用户,获得访问令牌和租户的URL登录的用户。我使用提供了这个[链接]上的说明 https://dev.onedrive.com/auth/ aad_oauth.htm 。当我尝试访问默认驱动器它给了我未经授权错误。这里是我的code访问默认的驱动器。结果
使用(Web客户端WC =新的WebClient()){wc.Headers [Htt的prequestHeader.Authorization] =旗手+ acessToken; wc.DownloadString(https://开头<保证租户名称> -my.sharepoint.com/_api/v2.0/me/drive/items~~V+/驱动器); } 结果
我也曾尝试https://开头<保证租户名称> -my.sharepoint.com/_api/v2.0/drive。结果
我也试图访问根目录文件夹的项目,但它给我同样的错误。我说结果
*的Windows Azure Active Directory的结果
*Office 365的统一的API(preVIEW)结果
*的Office 365的SharePoint Online结果
*Office 365的管理API结果
转授给其他应用程序一节和委托的所有可能对这些权限,在注册我的应用程序在蔚蓝。是,没有别的东西我需要做什么来访问一个驱动器的公司吗?

I am trying to provide one drive functionality in my winform application(.Net 3.5). I have successfully implemented this for one drive, but I am having trouble doing it for one drive for business. I have registered my application in azure and I am able to authenticate user, get the access token and tenant URL for logged in user. I am using the instructions provided on this [link]https://dev.onedrive.com/auth/aad_oauth.htm. When I try to access default drive it gives me unauthorized error. Here is my code to access the default drive.
using(WebClient wc = new WebClient()) { wc.Headers[HttpRequestHeader.Authorization] = " Bearer " + acessToken; wc.DownloadString("https://<the tenant name>-my.sharepoint.com/_api/v2.0/me/drive/items" + "/drive"); } .
I have also tried "https://<the tenant name>-my.sharepoint.com/_api/v2.0/drive".
I also tried to access root folders items, but it is giving me the same error. I added
*"Windows Azure active Directory"
*"Office 365 unified API(preview)"
*"Office 365 SharePoint online"
*"Office 365 management API"
under the "delegation to other application" section and delegated all the permissions possible for these, while registering my app in azure. Is, there something else I need to do to access one drive for business?

推荐答案

这是一个API错误。

It's a API bug.

<一个href=\"http://stackoverflow.com/questions/32144097/onedrive-for-business-api-item-file-download-content-401/32344521#32344521\">OneDrive商务API项目/文件下载内容401

我认为,他们正在努力解决这个bug。

I think they are working to fix this bug.

感谢

这篇关于不能够使用一个驱动API为Business One的驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆