Sharepoint REST API [英] Sharepoint REST API
问题描述
我的SharePoint SOAP终结点http://hostname/sites/path1/path2/_vti_bin/lists.asmx正在运行.
My SharePoint SOAP endpoint http://hostname/sites/path1/path2/_vti_bin/lists.asmx is working.
我试图切换到REST.但这会返回"404 Not Found"
I tried to switch to REST. But this returns '404 Not Found'
$ uri ="http://主机名/sites/path1/path2/_api/Web/Lists"
$ restData = Invoke-RestMethod -Uri $ uri -UseDefaultCredential
$ jsonLibrary = $ restData.Content
写主机$ jsonLibrary
$uri = "http://hostname/sites/path1/path2/_api/Web/Lists"
$restData = Invoke-RestMethod -Uri $uri -UseDefaultCredential
$jsonLibrary = $restData.Content
Write-Host $jsonLibrary
所有SharePoint门户是否都启用SOAP和REST终结点?我的REST URI错误吗?
Do all SharePoint portals enable both SOAP and REST endpoints ? Is my REST URI wrong ?
谢谢
Mohan
更新:我确定_vti_bin/listdata.svc/而不是_api/Web/Lists返回一些集合.
Update : I determined that _vti_bin/listdata.svc/ instead of _api/Web/Lists returns some collections.
这意味着SharePoint的版本是2010,而不是2013.对吗?
It means that the version of SharePoint is 2010 and not 2013. Right ?
并且 _vti_bin/listdata.svc/没有我要的集合.收藏集的创建者
And _vti_bin/listdata.svc/ does not have the collection I am looking for. Does the creator of the collection
专门为REST访问启用它?我正在寻找的集合可以使用SOAP进行访问.
specifically enable it for REST access ? The collection I am looking for is accessible using SOAP.
推荐答案
1.SharePoint 2010同时启用SOAP和REST终结点.
1.SharePoint 2010 enable both SOAP and REST endpoints.
2.URL [ http://hostname/sites/path1/path2/_api/Web/Lists ]仅适用于SharePoint 2013或更高版本.
2.The URL [http://hostname/sites/path1/path2/_api/Web/Lists] is just applicable for SharePoint 2013 or later versions.
3.URL[ _vti_bin/listdata.svc ]适用于SharePoint 2010,它也可以用于更高版本.
3.The URL [_vti_bin/listdata.svc] is applicable for SharePoint 2010 and it also can be used in later versions.
4.要检索列表的更多详细信息,与在SharePoint 2010中使用REST API相比,最好使用SOAP.
最诚挚的问候,
李刘
这篇关于Sharepoint REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!