Google API/get directory contacts
Asked Answered
G

3

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)?

Geneviegenevieve answered 14/7, 2014 at 13:24 Comment(0)
P
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.

Precise answered 15/7, 2014 at 0:31 Comment(3)
this one is correct answer. Unfortanly it require domain administration user privileges, which greatly decrease posible use caseGeneviegenevieve
For end user read access to the gal see my answer at: https://mcmap.net/q/1635121/-how-to-get-google-profile-info-including-custom-fields-from-an-apps-domain-user/1503886Precise
Doesn't metter. I have set via admin user with OAuth 2 and session store. Work ok.Geneviegenevieve
E
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.

Energid answered 27/11, 2018 at 20:33 Comment(0)
A
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

Allude answered 14/7, 2014 at 15:59 Comment(3)
I have tried that, thoose api always return "403 Not Authorized to access this resource/api". Even when Admin SDK API enabled.Geneviegenevieve
You can try the Google APIs Explorer [developers.google.com/apis-explorer/#p/admin/directory_v1/… and look at Google API in Java [code.google.com/p/google-api-java-client/]Allude
yes, i know about explorer. give same result. Looks like need be domain admin to read directory. Will test with more privileges.Geneviegenevieve

© 2022 - 2024 — McMap. All rights reserved.