求sharepoint online 中的某个文档生成共享链接的完整代码

book_net1999 2017-12-02 07:05:10
我希望通过REST或其它什么方式,把我 office 365中的SharePoint online 文档(OneNote笔记本)共享为一个匿名链接。这个手动操作是可以的,代码的方式微软官方有开发介绍,可是写得不具体,无法测试验证。哪位高手写过这样的完整代码?非常感谢!

另外怎么使用代码生成一个sharepoint online 中的新 OneNote 文档呢?

官方参考如下:
微软官方的说明只能给会的人读呀:
https://msdn.microsoft.com/en-us/office/office365/howto/onenote-sharing-links
https://www.onenote.com/api/v1.0/me/notes/notebooks/%7bid%7d/action.createSharingLink
...全文
699 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
book_net1999 2017-12-05
  • 打赏
  • 举报
回复
谢谢楼上各位的指教,还是自力更生比较有效呀。
霖雨 版主 2017-12-05
  • 打赏
  • 举报
回复
代码还是得自己写,有问题自己调试的。哪里有这么便宜的事儿,有个功能发到论坛,别人就帮忙搞定了。
Justin-Liu 2017-12-04
  • 打赏
  • 举报
回复
Justin-Liu 2017-12-04
  • 打赏
  • 举报
回复
引用 2 楼 book_net1999 的回复:
谢谢楼上提示。不过那个帖子里的最后一行: var profileLoader = ProfileLoader.GetProfileLoader(ctx); UserProfile profile = profileLoader.GetUserProfile(); Site personalSite = profile.PersonalSite; ctx.Load(personalSite); ctx.ExecuteQuery(); rootWeb = personalSite.RootWeb; ctx.Load(rootWeb); ctx.ExecuteQuery(); rootWeb.ShareDocument(id, email, ExternalSharingDocumentOption.View, true); 中的ID是怎么关联到一个文件的?恳请明示。哪里有完整DEMO代码?
你动手写一下,写到那个方法的时候会提示id表示什么
book_net1999 2017-12-04
  • 打赏
  • 举报
回复
谢谢楼上提示。不过那个帖子里的最后一行: var profileLoader = ProfileLoader.GetProfileLoader(ctx); UserProfile profile = profileLoader.GetUserProfile(); Site personalSite = profile.PersonalSite; ctx.Load(personalSite); ctx.ExecuteQuery(); rootWeb = personalSite.RootWeb; ctx.Load(rootWeb); ctx.ExecuteQuery(); rootWeb.ShareDocument(id, email, ExternalSharingDocumentOption.View, true); 中的ID是怎么关联到一个文件的?恳请明示。哪里有完整DEMO代码?

3,242

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 SharePoint
社区管理员
  • SharePoint社区
  • 霖雨
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧