Hello, I believe you are referring to Domain Shared Contacts<http://code.google.com/googleapps/domain/shared_contacts/gdata_shared_contacts_api_reference.html>. In this case, simple change the FEED_URL to use a url that looks like: https://www.google.com/m8/feeds/contacts/<DOMAIN>/full
Best, Alain On Wed, Nov 9, 2011 at 10:18 PM, Nirzari Bhatt <[email protected]>wrote: > Hi, > > I am very new to GAE. I want to add a Google domain contact using Java > API. > > I tried using following code, but its adding a new contact for the id > which I am passing as value of "xoauth_requestor_id" parameter, and > not a domain contact. > > ContactEntry newContact = new ContactEntry(); > > newContact.setId(contactId); > newContact.setTitle(new PlainTextConstruct(name)); > newContact.setContent(new PlainTextConstruct(notes)); > Email primaryMail = new Email(); > primaryMail.setAddress(emailId); > primaryMail.setPrimary(true); > newContact.addEmailAddress(primaryMail); > ExtendedProperty companyProperty = new ExtendedProperty(); > companyPropery.setName("CONTACT-ID"); > companyPropery.setValue(contactId); > newContact.addExtendedProperty(companyProperty); > GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters(); > oauthParameters.setScope(SCOPE); > oauthParameters.setOAuthConsumerKey(CONSUMER_KEY); > oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET); > > String url = FEED_URL + "?xoauth_requestor_id=" + "[email protected] > "; > URL postUrl = new URL(url); > > OAuthSigner signer = new OAuthHmacSha1Signer(); > ContactsService myService = new ContactsService("ContactDemoApp"); > > myService.setOAuthCredentials(oauthParameters, signer); > ContactEntry createdContact = > myService.insert(postUrl,newContact); > > Kindly let me know is there any way we can create domain contact using > API. > > Thanks in advance. > > Regards, > Nirzari > > -- > 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 > -- Alain Vongsouvanh | Developer Programs Engineer -- 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
