我是Microsoft图形API的新手,并尝试使用graphClient使用“列出位置” API。无法找到graphClient的任何place方法,如下面的Microsoft文档中所示:
https://docs.microsoft.com/en-us/graph/api/place-list?view=graph-rest-1.0&tabs=java
IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
IRoomCollectionPage microsoft.graph.room = graphClient.places().microsoft.graph.room()
.buildRequest()
.get();
这是我的代码(无法看到为graphClient对象创建的places()方法:]
AuthProvider authProvider = new AuthProvider(getTokenUsingGraphClientSecret());
graphClient = GraphServiceClient.builder().authenticationProvider(authProvider)
.buildClient();
令牌代码:
IClientCredential credential = ClientCredentialFactory.createFromSecret(CLIENT_SECRET);
ConfidentialClientApplication cca =
ConfidentialClientApplication
.builder(CLIENT_ID, credential)
.authority(AUTHORITY)
//.setTokenCacheAccessAspect(tokenCacheAspect)
.build();
IAuthenticationResult result = cca.acquireToken(parameters).join();
而且,也没有导入IRoomCollectionPage类的选项。
注意:我在build.gradle中使用以下依赖项:
compile group: 'com.microsoft.graph', name: 'microsoft-graph', version: '1.7.1'
// https://mvnrepository.com/artifact/com.microsoft.azure/msal4j
compile group: 'com.microsoft.azure', name: 'msal4j', version: '1.5.0'
[如果我在这里想念什么,请告诉我。预先感谢。
我发现了同一件事。我对这个问题也很感兴趣。为什么要有关于类和方法调用的文档以及不包含这些类的库?
您看到此内容的原因分为两个部分:
很抱歉造成混乱。我将在发布此文章时对其进行更新。