Contacts created using Google-contacts API are not getting synchronized from an Android device - google-contacts-api

I have created contacts using google contacts POST API. and I am successfully able to fetch them using GET API.
Reference.
Now, Logged into the same google account from an android device and successfully synced contacts but the contacts which are created using POST API are not imported in sync.
Note:
Contacts Created from Android are fetched Successfully using GET API from Web-Client.
Contacts Deleted using Delete API are successfully deleted from android device on sync ( both contacts which are created using api or android) and vice-versa.
Can anyone help me by telling how to resolve this issue. Thanks in advance.

You have to add the gContact:groupMembershipInfo field in your XML request body while creating contacts in order to create contacts in My Contacts.
Add the following in your POST request
<gContact:groupMembershipInfo deleted="false"
href="http://www.google.com/m8/feeds/groups/userEmail/base/groupId"/>
where groupId is 6 for My Contacts.
You can get the GroupId for all the groups by sending an authorized GET request to the contact groups feed URL
https://www.google.com/m8/feeds/groups/{userEmail}/full
This request wil give the detail of the Groups.
Refer this for more information Retrieving_all_contact_groups

Related

Project with Google APi with self user auth

I was able to create a project to connect an app to google data, for a specific account (followed Google People API)
But now I would like that each customer log in hisself to his account and manage his data.
I can' t create project in the Google API Console for each customer, my app needs to read auth from each user who will use my app and "auto" create auth to read google contact data of the logged user.
Is possible?
Could you suggest me articles about how to do?
It sounds like you are trying to do exactly what OAuth 2.0 (see the page you linked to) gives you: authenticating users. This differs from using an API key, which is only authorizing your project and has nothing to do with a user's credentials.
OAuth 2.0 combines a Client ID (associated with your Google Developers Console project) and a user's login (specific to the user who is accessing your app/site) to give you an authorization token. This token will let your app act on behalf of that user when calling that API. Just make sure to request the necessary scopes as part of the OAuth 2.0 authorization prompt given to the user.
How to give this prompt varies by environment, but many common options are listed on that link.
Note that you always use the same Client ID, so you only need one Google Developers Console project, but you are given a unique token specific to that user's login when they authorize your app, so this lets you act as any user which grants your app access to their account.

getting image url from google contact api

I am using google contacts api for getting my contacts information.
I am getting data through this url to generate feed and then parsing this feed to get the data.
I am able to get email and name of my contacts but unable to get image of my contact.
Can somebody please help me in this
Send a GET request with the userEmail and contactID. Assuming that the contact has a photo, you'll receive a link which you can use to access the photos. Keep in mind this requires authentication.

Working with multiple facebook apps user id v1.0 and v2.0

We're using multiple Facebook apps for our product, in V1.0 we used to get the same user id for all apps. We save accounts collection in our db in which we save Facebook id in and creating new accounts for users in which we don't have their FB id already.
Last week we've created a new app, when we started to use it we found out that we're getting a different id for existing users and we're creating a new account for them in our db. (This happened because the new app was created on v2.0 as explained here - https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids)
I read that we can use business manager in order to define all apps and get all the user id for all apps under the same business (https://developers.facebook.com/docs/apps/for-business), but I couldn't find how can I connect these ids to the original id.
I saw a hack that once I have app_scoped_id, I can make a another FB api call to get the original id (Get Facebook User ID from app-scoped User ID) but this means I keep managing the FB ids on our db, is this a good approach? or should I move on to manage the app scope ids? how can I get them for my V1.0 apps before this transition takes place? can I migrate my data in db (when having FB global ids only)? or do I must have a user access token in order to get this info?
Thanks!
Ilana

How to register Google Maps API key for a client's domain I don't own?

I have a website I developed for a client. One of the pages displays a list of street addresses, for which I also have LAT/LONG data. The client requested to add a little map next to this list with a marker for each address.
I would like to use Google Maps API v3, but I have a problem registering client's internet facing URL, which has a form of "ip address:port" (i.e. something like http://123.45.67.89:555) and which I - naturally - do not own and do not have domain admin access. Likewise, their domain admin - whoever s/he is - does not and will not have access to my Google API project for which I'm trying to register the key.
So far I was able to register the client id for local development in a form of http://localhost:5555, but when I'm trying to add the client's URL I'm getting an error
OAuth 2 redirect URL "http://123.45.67.89:555" is invalid.
I searched for solution for this problem and found a suggestion to whitelist the URL in the Google API Console. Yet when I'm trying to add this URL to approved domain list ("notification endpoints") I'm only getting another error:
You do not have access to the following domain:
http://123.45.67.89:555
which is, of course, true. The documentation also says I cannot register a domain I don't own.
So, my question is: how do I register a Client ID for Google Maps API V3 for the client's URL to which I don't have domain admin privileges and whose domain admin doesn't have access to my API project?
Thank you!
Nikolai
You can create a view of the table (File | Create View ...) and own the view (https://support.google.com/fusiontables/answer/171206?hl=en) - thus enabling you to have your own version of the table which is in sync with changes.
As a footnote remember to deal with Cross Origin Resource Sharing (CORS) in your API project by using JSONP for example (https://developers.google.com/storage/docs/cross-origin).
If your are using Google Maps API v3, there is no need to use Google API Key. Simply use below script.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>

how do I retrieve a user_id in the v2 API?

I'm writing an app to add/remove collaborators to a particular folder. I need to only add collaborators that have setup their box account. I see that the v2 API allows me to specify "The ID of this user" (as opposed to their email address) - how can I get their ID? The v1 API has the get_user_id function - I don't see anything similar in the v2 docs...
There currently isn't an equivalent of get_user_id in the V2 API, so you'll have to resort to using email addresses. It should be noted that sending in an email of an unregistered user kicks off the registration process for the email address.