7

I need get list of contacts/phones from google buisness directory listing.

I have tried Google Contacts api, it work ok for all contacts under "My Contacts", but not allow show "Directory" contacts.

What i have use/how to access thoose contacts(company ones)?

arheops
  • 15,544
  • 1
  • 21
  • 27

3 Answers3

2

To add users to the Global Address List (GAL), use the Domain Shared Contacts API. It's similar to the regular Contacts API but is only accessible to admins and has a special URL.

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
  • 1
    this one is correct answer. Unfortanly it require domain administration user privileges, which greatly decrease posible use case – arheops Aug 03 '14 at 11:37
  • 1
    For end user read access to the gal see my answer at: http://stackoverflow.com/q/16281326/1503886 – Jay Lee Aug 03 '14 at 17:37
  • Doesn't metter. I have set via admin user with OAuth 2 and session store. Work ok. – arheops Aug 03 '14 at 19:12
2

Note that to get all users on an account is now possible by using the Uses:list endpoint.

By default, this information is only available to administrators, but a teammate just found that you can set the viewType parameter to domain_public which allows anyone within the org to get a list of everyone on the domain.

We spent hours looking into this before we saw the option, so I thought I'd leave a note here for anyone else looking for the same functionality.

Nathan Rutman
  • 2,215
  • 2
  • 21
  • 25
0

The Directory contacts are the users of the Google Apps account. You can access them using the Directory API : https://developers.google.com/admin-sdk/directory/v1/reference/users

Cimballi
  • 176
  • 1
  • 2
  • I have tried that, thoose api always return "403 Not Authorized to access this resource/api". Even when Admin SDK API enabled. – arheops Jul 14 '14 at 20:05
  • You can try the Google APIs Explorer [https://developers.google.com/apis-explorer/#p/admin/directory_v1/directory.users.list] and look at Google API in Java [https://code.google.com/p/google-api-java-client/] – Cimballi Jul 14 '14 at 22:23
  • yes, i know about explorer. give same result. Looks like need be domain admin to read directory. Will test with more privileges. – arheops Jul 15 '14 at 02:07