sel*_*mar 1 graph azure azure-ad-graph-api microsoft-teams microsoft-graph-api
您好,我正在尝试使用 Graph api(最近更新)获取 Microsoft 团队的频道,如下所示
var settings = {
"async": true,
"crossDomain": true,
"url": "https://graph.microsoft.com/beta/groups/f389913f-b38d-4784-a37c-9ae3259275dc/channels",
"method": "GET",
"headers": {
"authorization": "token`enter code here`",
"cache-control": "no-cache",
"postman-token": "f4e5037c-913a-bc76-10a2-a0adb9064c11"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误。
{
"error": {
"code": "AccessDenied",
"message": "Failed to execute Skype backend request GetThreadRequest. Request Url: https://apac-client-ss.msg.skype.com/v1/threads/19:88b4b1fa52214b7fbb3fd8d10bd37cea@thread.skype?view=msnp24Equivalent, Request Method: GET,. The server failed to respond correctly. Response Code: Forbidden, Reason: SkypeToken is from a disallowed region.. Response Headers: Pragma: no-cache\r\nContextId: tcid=7407026678545725096,server=EAP010230200016\r\nCache-Control: no-store, must-revalidate, no-cache\r\nDate: Fri, 12 May 2017 12:29:34 GMT\r\nServer: Microsoft-HTTPAPI/2.0\r\n",
"innerError": {
"request-id": "46e772e4-9611-4f78-82ec-a43289ce5d17",
"date": "2017-05-12T12:29:34"
}
}
}
Run Code Online (Sandbox Code Playgroud)
这里面有没有什么问题呢。参考:https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/group_list_channels 我也授予了权限(Group.ReadWrite.All)。
这是由于此新 API 的分阶段部署所致,该 API 尚未推广到您所在的区域。如果您重试,它现在应该可用。不便之处敬请原谅。
请注意,您可以使用Microsoft Graph Explorer来使用这些 API,并帮助确定您的代码是否存在问题或者 API 本身是否存在问题。您可以将其与示例帐户一起使用,或者更好的是使用您正在使用/测试的特定帐户登录。
| 归档时间: |
|
| 查看次数: |
2055 次 |
| 最近记录: |