Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何从联机sharepoint url获取文档uri?_Php_Sharepoint_Microsoft Graph Api_Office365_Uri - Fatal编程技术网

Php 如何从联机sharepoint url获取文档uri?

Php 如何从联机sharepoint url获取文档uri?,php,sharepoint,microsoft-graph-api,office365,uri,Php,Sharepoint,Microsoft Graph Api,Office365,Uri,我有一个web应用程序来显示我网站中的文件夹和文档列表,来宾用户可以在仪表板中管理它们 我想获得一个文档uri,这样当我从列表中单击文档时,我就可以使用客户端应用程序打开文档 (文档名称将显示为带有href的html标记) 如果我使用Graph API获取文档列表,大多数文档都有webUrl来打开Sharepoint online webUrl看起来像: (docx示例) https://contoso.sharepoint.com/sites/MySite/_layouts/15/Doc.as

我有一个web应用程序来显示我网站中的文件夹和文档列表,来宾用户可以在仪表板中管理它们

我想获得一个文档uri,这样当我从列表中单击文档时,我就可以使用客户端应用程序打开文档

(文档名称将显示为带有
href
html标记)

如果我使用Graph API获取文档列表,大多数文档都有
webUrl
来打开Sharepoint online

webUrl
看起来像:

docx
示例)

https://contoso.sharepoint.com/sites/MySite/_layouts/15/Doc.aspx?sourcedoc=%xxxxxxx-xxxx-xxxx-xxxx-XXXXXXXXXX%xx&file=Document.docx&action=default&mobileDirect=true

但我想获得如下可下载链接:

https://contoso.sharepoint.com/sites/MySite/Shared%20Documents/SomeFolder/Document.docx

然后我可以将
prefix
ms-word:ofe | u |
一样附加到
docx
文档的每个链接,以便使用客户端应用程序打开

我如何实现这一点

我想知道当我从
路径
名称
生成文档uri时,它是否是最佳选择

尝试此端点:

GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}
测试结果:

感谢您对我的问题的回答。顺便说一句,我可以在
{item id}
中获取文档列表吗?实际上,我使用
{folder id}
和类似
的路径获取文档列表https://graph.microsoft.com/v1.0/sites/{site id}/drive/items/{folder id}:/{path to relative}:/children
。在这种情况下,我可以使用
文件夹id
获取我想要的吗?我使用数据库中的
文件夹id
。你是说在{item id}中获取文档列表?我是说在
{item id}
之后使用什么https://graph.microsoft.com/.../{item id}/{相对路径}/子项
。这可能吗?你还在这里寻求帮助吗?@Shiva MSFTIdentity我使用父文件夹
webUrl
name
实现了这一点。因此,我成功地获得了正确的url。很高兴您的问题得到了解决:)-谢谢@Shiva MSFTIdentity