Microsoft Graph API:获取文件列表API,给出空数组

我尝试了API来获取iOS SDK中的文件。
我已经注册了所有范围的应用程序读取/读取文件访问应用程序。 我能够成功地使用示例代码发送邮件。 我在图表资源pipe理器中尝试了API https://graphexplorer2.azurewebsites.net/?UrlRequest=GET&text=https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fdrive%2Froot%2Fchildren

请求摘录:

AuthenticationManager *authManager = [AuthenticationManager sharedInstance]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://graph.microsoft.com/v1.0/me/drive/root/children"]]; [request setHTTPMethod:@"GET"]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [request setValue:@"application/json, text/plain, */*" forHTTPHeaderField:@"Accept"]; NSString *authorization = [NSString stringWithFormat:@"Bearer %@", authManager.accessToken]; [request setValue:authorization forHTTPHeaderField:@"Authorization"]; NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if(conn) { NSLog(@"Connection Successful"); } else { NSLog(@"Connection could not be made"); } [conn start]; 

响应:

 {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('<user-email>')/drive/root/children","value":[]} 

先谢谢您的帮助 :)

我的示例应用程序的权限 我的示例应用程序的权限

当应用程序没有权限访问给定用户驱动器的根目录中的任何文件时,预计会收到对该请求的空响应。 你可以检查(例如通过http://jwt.calebb.net )您使用的访问令牌是否有任何文件。*范围? 对于这个请求,Files.Read已经足够了。