我试图存档一个微软团队。
$scopes = 'Group.ReadWrite.All'
$appid = ‘’
$appsecret = ''
$appaaddomain = ''
$url = "https://graph.microsoft.com/v1.0/teams/{team-id}/archive"
…
Invoke-RestMethod -Method "Post" -Uri $url -Headers @{Authorization = "Bearer $token"我变成了403个错误。
{“错误”:{“代码”:"AccessDenied",“消息”:“无法获取团队线程:无法执行Skype后端请求GetThreadRequest。”,"innerError":{“请求-id”:"99b1dd19-7f58-4237-bb80-d04345d67ae5",“日期”:"2019-03-03T23:18:55“}}
我做错了什么?
删除该团队将工作
$scopes = 'Group.ReadWrite.All'
$appid = ‘’
$appsecret = ''
$appaaddomain = ''
$url = "https://graph.microsoft.com/v1.0/groups/{team-id}"
…
Invoke-RestMethod -Method "Delete" -Uri $url -Headers @{Authorization = "Bearer $token"同样的结果出现在微软图形资源管理器(这里我给了我所有可能的权限)。
发布于 2019-03-04 16:12:57
我不认为您的方法有什么问题--我已经包含了下面用于归档团队的Python代码,您的代码中似乎使用了相同的过程。这可能是一个短暂的错误。几天前,我收到了同样的消息,当时一些更改阻止了新通道的创建(甚至在GUI中)。
import requests
import json
# config file with site-specific values
from config import strClientID, strClientSecret, strGraphAuthURL, strTenantID
postData = {"grant_type": "client_credentials","client_id" : strClientID,"client_secret": strClientSecret,"scope": "https://graph.microsoft.com/.default"}
r = requests.post(strGraphAuthURL, data=postData)
strJSONResponse = r.text
if len(strJSONResponse) > 5:
jsonResponse = json.loads(strJSONResponse)
strAccessToken = jsonResponse['access_token']
getHeader = {"Authorization": "Bearer " + strAccessToken }
postRecord = requests.post("https://graph.microsoft.com/beta/teams/{teamID}/archive",headers={"Authorization": "Bearer " + strAccessToken})
print("HTTP Status Code:\t%s\nResult code content:\t%s" % (postRecord.status_code, postRecord.content))https://stackoverflow.com/questions/54975116
复制相似问题