MSGraph API 解除存档团队和恢复组不工作。

问题描述 投票:0回答:1

在MSTeams中存在一个错误(我认为),当你在Azure中删除一个组时,MSTeams中的团队仍然可用。所以我在删除组之前将其存档。

现在,我想取消存档,并恢复该组。没有这些调用工作...

graphApplicationClient.teams({teamId}).unarchive().buildRequest().post();

错误。

    Apr. 24, 2020 5:01:55 PM com.microsoft.graph.logger.DefaultLogger logDebug
INFORMATION: Starting to send request, URL https://graph.microsoft.com/v1.0/teams/{teamId}/microsoft.graph.unarchive
Apr. 24, 2020 5:01:55 PM com.microsoft.graph.logger.DefaultLogger logDebug
INFORMATION: Request Method POST
Apr. 24, 2020 5:01:55 PM com.microsoft.graph.logger.DefaultLogger logError
SCHWERWIEGEND: CoreHttpProvider[send] - 204Error during http request
Apr. 24, 2020 5:01:55 PM com.microsoft.graph.logger.DefaultLogger logError
SCHWERWIEGEND: Throwable detail: com.microsoft.graph.core.ClientException: Error during http request
Exception in thread "main" com.microsoft.graph.core.ClientException: Error during http request
    at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:421)
    at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:204)
    at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:184)
    at com.microsoft.graph.http.BaseRequest.send(BaseRequest.java:306)
    at com.microsoft.graph.requests.extensions.TeamUnarchiveRequest.post(TeamUnarchiveRequest.java:62)
    at MSTeamsService.main(MSTeamsService.java:65)
Caused by: java.lang.NullPointerException
    at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
    at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
    at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
    at java.base/java.util.regex.Pattern.matcher(Pattern.java:1134)
    at okhttp3.MediaType.get(MediaType.java:53)
    at okhttp3.MediaType.parse(MediaType.java:106)
    at com.microsoft.graph.http.CoreHttpProvider$3.contentType(CoreHttpProvider.java:346)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:53)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.TelemetryHandler.intercept(TelemetryHandler.java:35)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.RedirectHandler.intercept(RedirectHandler.java:123)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.RetryHandler.intercept(RetryHandler.java:140)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.AuthenticationHandler.intercept(AuthenticationHandler.java:31)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
    at okhttp3.RealCall.execute(RealCall.java:92)
    at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:355)
    ... 5 more

而另一个电话:

     graphApplicationClient.directory().deletedItems({team/groupId}).restore().buildRequest().post();

ERROR: (SCHWERWIEGEND表示FATAL)

    Apr. 24, 2020 5:04:14 PM com.microsoft.graph.logger.DefaultLogger logDebug
INFORMATION: Starting to send request, URL https://graph.microsoft.com/v1.0/directory/deletedItems/{team/groupId}/microsoft.graph.restore
Apr. 24, 2020 5:04:14 PM com.microsoft.graph.logger.DefaultLogger logDebug
INFORMATION: Request Method POST
Apr. 24, 2020 5:04:14 PM com.microsoft.graph.logger.DefaultLogger logError
SCHWERWIEGEND: CoreHttpProvider[send] - 204Error during http request
Apr. 24, 2020 5:04:14 PM com.microsoft.graph.logger.DefaultLogger logError
SCHWERWIEGEND: Throwable detail: com.microsoft.graph.core.ClientException: Error during http request
Exception in thread "main" com.microsoft.graph.core.ClientException: Error during http request
    at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:421)
    at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:204)
    at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:184)
    at com.microsoft.graph.http.BaseRequest.send(BaseRequest.java:306)
    at com.microsoft.graph.requests.extensions.DirectoryObjectRestoreRequest.post(DirectoryObjectRestoreRequest.java:53)
    at MSTeamsService.main(MSTeamsService.java:66)
Caused by: java.lang.NullPointerException
    at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
    at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
    at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
    at java.base/java.util.regex.Pattern.matcher(Pattern.java:1134)
    at okhttp3.MediaType.get(MediaType.java:53)
    at okhttp3.MediaType.parse(MediaType.java:106)
    at com.microsoft.graph.http.CoreHttpProvider$3.contentType(CoreHttpProvider.java:346)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:53)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.TelemetryHandler.intercept(TelemetryHandler.java:35)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.RedirectHandler.intercept(RedirectHandler.java:123)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.RetryHandler.intercept(RetryHandler.java:140)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at com.microsoft.graph.httpcore.AuthenticationHandler.intercept(AuthenticationHandler.java:31)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
    at okhttp3.RealCall.execute(RealCall.java:92)
    at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:355)
    ... 5 more

(SCHWERWIEGEND表示FATAL)

如果我在GraphExplorer中尝试这些调用,它们工作正常。

谁能帮帮我?

最好的问候

java microsoft-graph microsoft-teams
1个回答
0
投票

对于每个人都有相同的问题,我。GraphAPI提供了一个自定义Request()函数。我使用相同的token,相同的url,相同的属性,但是使用customRequest。

graphApplicationClient.customRequest("/teams/" + pTeamId + "/unarchive").buildRequest().post(new JsonObject());

同样的解决方案,还原...

graphApplicationClient.customRequest("/directory/deletedItems/" + pTeamId + "/restore").buildRequest().post(new JsonObject()

这不是正确的解决方案,因为它应该与普通的GraphAPI一起工作,这就是为什么我不将其标记为答案。但对于大家有同样问题的人来说,这是一个变通的办法......

© www.soinside.com 2019 - 2024. All rights reserved.