Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在.NET应用程序中检索所有移动设备Google Directory API_C#_Google Api_Google Admin Sdk_Google Api Dotnet Client - Fatal编程技术网

C# 在.NET应用程序中检索所有移动设备Google Directory API

C# 在.NET应用程序中检索所有移动设备Google Directory API,c#,google-api,google-admin-sdk,google-api-dotnet-client,C#,Google Api,Google Admin Sdk,Google Api Dotnet Client,我想在我的应用程序中使用Google API管理设备。如何检索所有移动/chrome操作系统设备 代码: var listReq1 = service.Mobiledevices.List(serviceAccountEmail); MobileDevices allUsers = listReq1.Execute(); 这里, serviceAccountEmail=Service accounts Key Console.developer.google.com 我犯了这样的错误 Go

我想在我的应用程序中使用Google API管理设备。如何检索所有移动/chrome操作系统设备

代码:

var listReq1 = service.Mobiledevices.List(serviceAccountEmail);
 MobileDevices allUsers = listReq1.Execute(); 
这里,

serviceAccountEmail=Service accounts Key Console.developer.google.com

我犯了这样的错误

Google.Apis.Requests.RequestError
Bad Request [400] 
我试着用

var listReq= new Google.Apis.Admin.Directory.directory_v1.MobiledevicesResource.ListRequest(service,serviceAccountEmail);
还是不工作?我想所有的细节用户就像下面的图片


如果您查看文档中的

检索帐户的所有移动设备的分页列表

我将确保它以客户id作为参数

customerId客户的Google帐户的唯一ID。像 作为帐户管理员,您还可以使用my_客户别名 表示您帐户的customerId。还将返回customerId 作为用户资源的一部分


您正在发送服务帐户电子邮件地址,我真的认为它不是您的客户id。

在这种情况下,它将只返回特定电子邮件地址的一条记录。如果我需要所有记录,该怎么办?然后您为每个客户运行一次。文档中说它只返回一个帐户的设备,而不是你所有的帐户。我只是希望能为你测试一下。我只是在这里查阅文档:
var listReq1 = service.Mobiledevices.List(customerId);
MobileDevices allUsers = listReq1.Execute();