Hi,
I try to retrieve the domain shared contacts in gadget and curl, I got
the auth token, but the returned xml has no entry, the
openSearch:totalResults is 0. Actually under Contacts/Directory, there
are 7 contacts. below is my sample.
in gadget:
<ModulePrefs title="google oauth sample" height="320">
<OAuth>
<Service name="contact">
<Access
url="https://www.google.com/accounts/OAuthGetAccessToken"
method="GET" />
<Request
url="https://www.google.com/accounts/OAuthGetRequestToken?
scope=https://www.google.com/m8/feeds" method="GET" />
<Authorization
url="https://www.google.com/accounts/
OAuthAuthorizeToken?oauth_callback=http://oauth.gmodules.com/gadgets/
oauthcallback" />
</Service>
</OAuth>
</ModulePrefs>
.....
url = "https://www.google.com/m8/feeds/contacts/jabberSDK.com/full?
alt=json";
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.AUTHORIZATION] =
gadgets.io.AuthorizationType.OAUTH;
params[gadgets.io.RequestParameters.OAUTH_SERVICE_NAME] = "contact";
params[gadgets.io.RequestParameters.OAUTH_USE_TOKEN] = "always";
params[gadgets.io.RequestParameters.METHOD] =
gadgets.io.MethodType.GET;
--------------------------------------------------------------------------------------------------------------------------------------------------------
The server response:
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/
2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:gContact='http://schemas.google.com/contact/2008'
xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://
schemas.google.com/g/2005'><id>jabbersdk.com</
id><updated>2012-03-09T04:36:00.408Z</updated><category scheme='http://
schemas.google.com/g/2005#kind' term='http://schemas.google.com/
contact/2008#contact'/><title type='text'>jabbersdk.com's Contacts</
title><link rel='alternate' type='text/html' href='http://
www.google.com/'/><link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml' href='https://www.google.com/m8/feeds/
contacts/jabbersdk.com/full'/><link rel='http://schemas.google.com/g/
2005#post' type='application/atom+xml' href='https://www.google.com/m8/
feeds/contacts/jabbersdk.com/full'/><link rel='http://
schemas.google.com/g/2005#batch' type='application/atom+xml'
href='https://www.google.com/m8/feeds/contacts/jabbersdk.com/full/
batch'/><link rel='self' type='application/atom+xml' href='https://
www.google.com/m8/feeds/contacts/jabbersdk.com/full?max-results=25'/><author><name>jabbersdk.com</name><email>jabbersdk.com</email></author><generator
version='1.0' uri='http://www.google.com/m8/feeds'>Contacts</
generator><openSearch:totalResults>0</
openSearch:totalResults><openSearch:startIndex>1</
openSearch:startIndex><openSearch:itemsPerPage>25</
openSearch:itemsPerPage></feed>
--------------------------------------------------------------------------------------------------------------------------------------------------------
using cURL:
curl https://www.google.com/accounts/ClientLogin --data-urlencode
Email=***@jabbersdk.com --data-urlencode Passwd=*** -d service=cp -d
source=jabbersdkCo-jabbersdkApp-1 -d accountType=HOSTED
response:
SID=DQAAANwAAABBzm5CSOhE6P0gZEn42A4hB_cQzcR7PsQl5Qi-6UpkVI-e-
unqWoKQPHpPhwRowNI2xM-
k1mIUHQJpuw13RChC6Muc9Ec4oYfgx2gQ4NQ1UoNz_WPPakL8fVq4Cx54wGrghg3_GyZYO0Rh4nqMzjgDi9kMozPdGloaJeNxuB5kImR_8z9Fo6M_pSz3TBrtCO6w1UWWIiPXGmD8TqXVuz78e2BXPsRc1StFM4XhWgX-
k_eRp6nVKVx0A_9Id1AtQ4qiGTrJeokovjU5McJQjLpY7zTe4aA-YtnrMVvBI5jhnQ
LSID=DQAAAN8AAABUhKIMMffsFw2cJv_sC8vGo0mVh7ltbHurAHSmZBm3zp7GV3MCkX1A1SEG3gk_5AEyZnlt3KZ32_cgHf6NOHjRttGT67IJeOrw6NpITfHNQGeiVVrJmbM36NzAo85lDOy62BYjrUWbUckXvz2f_5tMdGTp4-
HM8uItth5v3e86SVaC1n5NZV5KHhCvhhNjkOwzTSV5ieRyvnqybTkJd46h49o0tOnXkmANdJh0VmVMJd_3RJcxdWgst-
fUR-9K7n_JtLk68GiJZIvr6WpJ7O0TLeMrVUQx8ugAjVZDRiP7OQ
Auth=DQAAAN8AAABUhKIMMffsFw2cJv_sC8vGo0mVh7ltbHurAHSmZBm3zp7GV3MCkX1A1SEG3gk_5AFKXx7mgTfH4Ds3I0HixHwJYNAtFf08hv_1Z-
wtJ_z8wl1-
Zj1lZ0A3US1b_b_zrlBzkOK7lxsLHexOyVfxjVR5N6TuCAVODs4QNPPRxkk6WxrHIy8pcJCHeZDjgTsInCSLAfh8bl7POE7MNlCOnbwqGpiSAWHGJcQSputhNwvQz1_mBbhskz1ubElDQlzYzq6bBnn0JGCes9Ng-
rjCx3ge5RVp1u8aAK7l4mnH1gLPpA
curl --silent --header "Authorization: GoogleLogin
auth=DQAAAN8AAABUhKIMMffsFw2cJv_sC8vGo0mVh7ltbHurAHSmZBm3zp7GV3MCkX1A1SEG3gk_5AFKXx7mgTfH4Ds3I0HixHwJYNAtFf08hv_1Z-
wtJ_z8wl1-
Zj1lZ0A3US1b_b_zrlBzkOK7lxsLHexOyVfxjVR5N6TuCAVODs4QNPPRxkk6WxrHIy8pcJCHeZDjgTsInCSLAfh8bl7POE7MNlCOnbwqGpiSAWHGJcQSputhNwvQz1_mBbhskz1ubElDQlzYzq6bBnn0JGCes9Ng-
rjCx3ge5RVp1u8aAK7l4mnH1gLPpA" "https://www.google.com/m8/feeds/
contacts/jabbersdk.com/full"
response:
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/
2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:gContact='http://schemas.google.com/contact/2008'
xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://
schemas.google.com/g/2005'><id>jabbersdk.com</
id><updated>2012-03-09T04:36:00.408Z</updated><category scheme='http://
schemas.google.com/g/2005#kind' term='http://schemas.google.com/
contact/2008#contact'/><title type='text'>jabbersdk.com's Contacts</
title><link rel='alternate' type='text/html' href='http://
www.google.com/'/><link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml' href='https://www.google.com/m8/feeds/
contacts/jabbersdk.com/full'/><link rel='http://schemas.google.com/g/
2005#post' type='application/atom+xml' href='https://www.google.com/m8/
feeds/contacts/jabbersdk.com/full'/><link rel='http://
schemas.google.com/g/2005#batch' type='application/atom+xml'
href='https://www.google.com/m8/feeds/contacts/jabbersdk.com/full/
batch'/><link rel='self' type='application/atom+xml' href='https://
www.google.com/m8/feeds/contacts/jabbersdk.com/full?max-results=25'/><author><name>jabbersdk.com</name><email>jabbersdk.com</email></author><generator
version='1.0' uri='http://www.google.com/m8/feeds'>Contacts</
generator><openSearch:totalResults>0</
openSearch:totalResults><openSearch:startIndex>1</
openSearch:startIndex><openSearch:itemsPerPage>
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html