I copied the attached sample code from the Google Apps Profiles Developer's 
Guide: 
http://code.google.com/googleapps/domain/profiles/developers_guide.html

However I consistently get the following error when I try to run it:


$ python sample.py 2>&1 | html2text
Traceback (most recent call last): File "sample.py", line 6, in  feed =
gd_client.GetProfilesFeed() File "/home/nottheoilrig/gdata-2.0.16/src/
gdata/contacts/client.py", line 358, in get_profiles_feed
desired_class=gdata.contacts.data.ProfilesFeed, **kwargs) File "/home/
nottheoilrig/gdata-2.0.16/src/gdata/client.py", line 640, in get_feed
**kwargs) File "/home/nottheoilrig/gdata-2.0.16/src/gdata/client.py",
line 319, in request RequestError) gdata.client.RequestError: Server 
responded
with: 403,
[Google]
403. That's an error.
Your client does not have permission to get URL /m8/feeds/profiles/domain/
asyv.org/full from this server. That's all we know.
$


Is this an error in the Google Apps Profiles Developer's Guide?

I get an identical error when I try to run the Google Shared Contacts 
Python Client: http://code.google.com/p/google-shared-contacts-client/

$ python shared_contacts_profiles.py -a [email protected] -e csv 2>&1 | 
html2text
Password of [email protected]: 
Export as CSV to: csv Domain: asyv.org Administrator: [email protected] ###
Exporting contacts/profiles to CSV file: csv Retrieving contacts... (0
retrieved so far) Traceback (most recent call last): File
"shared_contacts_profiles.py", line 1143, in  main() File
"shared_contacts_profiles.py", line 1138, in main
contacts_manager.ExportMsOutlookCsv(contact_entries, profile_entries,
export_csv_file) File "shared_contacts_profiles.py", line 531, in
ExportMsOutlookCsv contact_entries)) File "shared_contacts_profiles.py", 
line
719, in writerows for row in rows: File "shared_contacts_profiles.py", line
212, in GetAllContacts desired_class=gdata.contacts.data.ContactsFeed) File 
"/
usr/lib/pymodules/python2.6/gdata/client.py", line 635, in get_feed 
**kwargs)
File "/usr/lib/pymodules/python2.6/gdata/client.py", line 320, in request
RequestError) gdata.client.RequestError: Server responded with: 403,
[Google]
403. That's an error.
Your client does not have permission to get URL /m8/feeds/contacts/asyv.org/
full from this server. That's all we know.
$ 

-- 
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
import gdata.contacts.client

gd_client = gdata.contacts.client.ContactsClient(domain='asyv.org')
gd_client.ClientLogin('[email protected]', '********', None)

feed = gd_client.GetProfilesFeed()

for i, entry in enumerate(feed.entry):
  print '\n%s %s' % (i+1, entry.name.full_name.text)
  if entry.content:
    print '    %s' % (entry.content.text)
  # Display the primary email address for the contact.
  for email in entry.email:
    if email.primary and email.primary == 'true':
      print '    %s' % (email.address)
  # Display extended properties.
  for extended_property in entry.extended_property:
    if extended_property.value:
      value = extended_property.value
    else:
      value = extended_property.GetXmlBlob()
    print '    Extended Property - %s: %s' % (extended_property.name, value)

Reply via email to