0

当我尝试获取网站集和网站 ID 时,出现以下错误。可能是什么原因?任何帮助将非常感激。

var getMessage = new HttpRequestMessage(HttpMethod.Get, "https://www.onenote.com/api/beta/myorganization/siteCollections/FromUrl(url='https://123.sharepoint.com/teams/techs'");

{
  StatusCode: 400,
  ReasonPhrase: 'Bad Request',
  Version: 1.1,
  Content: System.Net.Http.StreamContent,
  Headers: {
    OData - Version: 4.0 Cache - Control: private Server: Microsoft - IIS / 8.5 X - AspNet - Version: 4.0.30319 X - Powered - By: ASP.NET X - Powered - By: ASP.NET Date: Sun, 17 Jan 2016 19: 59: 05 GMT Content - Length: 168 Content - Type: application / json;
    charset = utf - 8;
    odata.metadata = minimal;
    odata.streaming = true;
    IEEE754Compatible = false
  }
}
4

2 回答 2

1

如果那是逐字代码片段,那么您似乎缺少 url 参数的右括号。

var getMessage = new HttpRequestMessage(HttpMethod.Get, "https://www.onenote.com/api/beta/myorganization/siteCollections/FromUrl(url='https://123.sharepoint.com/teams/techs')");
于 2016-01-26T17:09:57.610 回答
0

看起来您可能缺少与身份验证相关的标头。

http://blogs.msdn.com/b/onenotedev/archive/2015/06/11/and-sharepoint-makes-three.aspx

于 2016-01-25T22:44:08.650 回答