2
下面是设置代码(我使用PowerShell的,因为它通常是方便)如何获取我的Google Apps域中用户的联系人?
$a1= Add-Type -Path "D:\Google2.1\Google.GData.Client.dll" -passthru
$a2= Add-Type -Path "D:\Google2.1\Google.GData.Apps.dll" -passthru
$a3= Add-Type -Path "D:\Google2.1\Google.GData.Contacts.dll" -passthru
$a4= Add-Type -Path "D:\Google2.1\Google.GData.Extensions.dll" -passthru
$reqSet = New-Object Google.GData.Client.RequestSettings("testApp", $config.admin, $config.password)
$reqSet.AutoPaging = $true
$contReq = New-Object Google.Contacts.ContactsRequest($reqSet)
所以,现在我试着检索联系人:
$contReq.GetContacts()
这个工程......,给我我的联系人(作为域超级管理员)。酷
$contReq.GetContacts("[email protected]")
这让我像
format-default : Execution of request failed: https://www.google.com/m8/feeds/contacts/[email protected]/full
我没有得到附加记录的请求以及一个GDataLoggingRequestFactory因素,而只是表明一个401错误,没有细节的错误。
你有没有试过@ site.com只是“任意用户”? –
是的,我有。可悲的是,相同的结果 –
顺便说一句,我试图模拟的代码是在https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2#Service_Accounts –