Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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
如何向SharePoint网站添加链接(url)';通过restapi的文档库?_Rest_Sharepoint_Sharepoint Online_Sharepoint Api - Fatal编程技术网

如何向SharePoint网站添加链接(url)';通过restapi的文档库?

如何向SharePoint网站添加链接(url)';通过restapi的文档库?,rest,sharepoint,sharepoint-online,sharepoint-api,Rest,Sharepoint,Sharepoint Online,Sharepoint Api,以下是我所尝试的: 发送post请求以在文档库上创建链接,其中包含承载令牌和正文中的某些数据 答复: 对于SharePoint Online,我们可以使用PnP powershell轻松实现它 $siteurl="https://tenant.sharepoint.com/sites/lz" $libraryTitle="DL" Connect-PnPOnline -Url $siteurl $linkText ="[InternetShortcut]URL=https://www.bing

以下是我所尝试的:

发送post请求以在文档库上创建链接,其中包含承载令牌和正文中的某些数据

答复:


对于SharePoint Online,我们可以使用PnP powershell轻松实现它

$siteurl="https://tenant.sharepoint.com/sites/lz" 
$libraryTitle="DL"
Connect-PnPOnline -Url $siteurl
$linkText ="[InternetShortcut]URL=https://www.bing.com"

$memStream = New-Object System.IO.MemoryStream
$writeStream = New-Object System.IO.StreamWriter $memStream
$writeStream.WriteLine($linkText)

Add-PnPFile -FileName "Bing.url" -Folder $libraryTitle -Stream $memStream -Values @{_ShortcutUrl="https://www.bing.com"}

使用REST API有什么办法吗?似乎不是一个REST API来实现它,我们必须使用PnP powershell,或者使用CSOM C#创建一个自定义web API来实现REST API。