Is there any way to get other contacts from Google People API? [duplicate] - google-contacts-api

I'm having a problem with the 2 APIs above. Given the next scenario: I have 2 different google accounts. One that doesn't use Google+ and a second account that uses Google+
When using Contacts API on the first account that doesn't use Google+ I can see all my contacts:
GET /m8/feeds/contacts/<email>/full
Same for the second account that uses Google+.
When I'm using People API for the first account that doesn't use Google+, I'm getting an empty response (actually I'm getting just the next sync token:
GET https://people.googleapis.com/v1/people/me/connections
With the next scope:
https://www.googleapis.com/auth/contacts
Returns:
{
"nextSyncToken": "CMe6...."
}
The same call for the second account (with Google+) works like a charm
The only difference between the 2 accounts is Google+, is it possible that People API only works for accounts with Google+? Or is it something else that I'm missing

I found the difference between the 2 APIs and it has nothing to do with the fact that one of the accounts is connected to Google+ or not
People API will only fetch the contacts that are under the account "My contacts" contacts, while Contacts API will also fetch the other contacts lists ("Other contacts", "Most contacts", ...)

The People API is the newer version.
From Google APIs related to People API page:
The Google Contacts API will be deprecated in the future. The People API is the recommended replacement for apps that read contact data.
It is also important to note that the People API does in fact allow the developer to use "other contacts" just like Contacts API did. In addition, when migrating you should not have to re-ask for user consent to the following:
https://www.google.com/m8/feeds
https://www.googleapis.com/auth/contacts
https://www.googleapis.com/auth/contacts.readonly
Please see these links for further reading:
https://developers.google.com/people/related-apis (Contacts API vs People API)
https://developers.google.com/people (Intro to People API)
I basically just copy/pasted most of this stuff but hopefully, some people find this helpful as I too was curious to find these answers :)

Related

Will old token with Google Contacts API access work for Google People API in the future?

We've discovered that old token with the Google Contacts scope https://www.google.com/m8/feeds/ can be used to access Google People API to access user' contacts. Migration guide provided by Google explains what new scopes Google People API needs, but doesn't explain whether the old token can be kept (https://developers.google.com/people/contacts-api-migration).
Keeping the old token is the preferred option because it doesn't require user interaction (user doesn't have to re-authorize his/her Google account on our system).
According to Google - on December 15th - 100% of Contacts API requests will return an error, but what will happen if requests are made to Google People API, but with the Google Contacts access scope?
It will work for reading and writing contacts and contact groups, but not "Other contacts" or directory data. See https://developers.google.com/people/contacts-api-migration#scope_migration

Will the Google Apps Script Contacts Service (ContactsApp) still work after the People API migration?

Google is migrating the Contacts API to the new People API beginning in June 2021. In some of my Google Apps Scripts I use the ContactsApp class from the Contacts Service (https://developers.google.com/apps-script/reference/contacts). Will this service still will work after the migration to the new People API?
Answer:
Apps Script acts as a client to the Contacts API and will receive the same error rates as all other clients.
More Information:
After the sunset of Contacts API, any errors that would be returned when trying to use it will be seen no matter how it is called - be that a client library, the Apps Script wrapper, or just HTTP requests.
Google sent out an email recently informing of the change - and this should have been received regardless of whether they are using Contacts API directly, or have Apps Script projects which use it.
At the moment it doesn't seem that there are any plans for a PeopleService or equivalent - but the Apps Script Advanced Services do have People API integration.
I would also urge you to make a feature request for a PeopleService equivalent of ContactsService, if you would like to see something like this implemented. You can file a feature request for this here on Google's Issue Tracker under the Apps Script Feature Request component.
To answer this question, No. It does not still work. I am in the middle of refactoring my code because it doesn't work anymore. I am trying to get a list of contacts from Google Contacts that have a specific label and now with the migration, I have not idea how to do this.

Getting storage usage from Google Contact/People API?

I am trying to get the remaining space of one's Google Contact.
This FAQ says every account has 20MB / 25000 contacts. But the People API does not have any REST resource to list one's storage.
How can I get the storage usage/space through People API?
Answer:
This information is not available to People API nor the deprecated Contacts API.
Workaround:
In order to see how many contacts you can still add, you can check how many contacts you currently have via people.connections.list and deduct that from the contact limit (25,000).
File a feature request:
If you think this functionality could be useful, I'd suggest you to file a feature request.

Google API key Vs. Google Client ID

One of our customers is using google maps with a "Client ID". We've developed our product using the Google API Key. All of the features of the map are working properly using the API key, but we are unable to confirm that the client will get the same results with the Client ID since we do not have one. Two question, do you believe that the features will work the same using either the API or the Client ID? Second question, how much does it cost to purchase a Client ID?
Client IDs and API Keys are forms of authentication and authorization. There are easy-to-follow guidelines on their proper usage and their limits. Everything you need to know about them can be found in the documentation (also try seeing the docs per product in the 'For more information' section):
https://developers.google.com/maps/premium/overview#authentication_and_authorization
Related SO post and answer about using Client IDs for their Javascript API:
google maps api javascript usage
For pricing, read more about it here:
https://developers.google.com/maps/pricing-and-plans/
EDIT: There has been recent Google Maps Platform pricing and product changes You'll always need an API key and a valid billing account associated to your Project if you want to use the Google Maps Platform APIs. If you've never had a Client ID then you don't need to worry about it, just continue using your API keys.
You may run into some APIs (i.e. Speed Limits API) that seem to need a Premium Plan account. If you really need access to these, simply contact sales using this form.
P.S.
When using API keys, be sure to properly restrict them!

How long will the Google Contacts API be supported, and is the Google People API the intended replacement?

At the moment, the People API does not retrieve all the contacts that the Contacts API did, but is suggested as a replacement. If I wanted the old list that included Most Contacted and Other Contacts, I believe I would need the Contacts API. How long is this API intended to be supported?
Yes, People API will replace the Contacts API.
The new People API uses the newest protocols and technologies and will eventually replace the Contacts API which uses the GData protocol.
Announcing the People API
The Contacts API has not been deprecated yet so we don't know how long it will be around. Once Google deprecates an API it is typically available for 1-3 years before being fully shut down.
Well, it is still being supported. Based on the Google Contacts v3 documentation, that if you only want for read-only access to users' contacts, then that is the time you need to use the People API. It is not stated here that the Contacts API v3 will be deprecated and will stop the supporting here.
Also based on the Google Contacts API Terms of Service, after April 20, 2015, the Deprecation Policy in Contacts API will not apply.