Retrieving user's Birthday from google api calls - oauth

Problem : I am facing difficulties in getting user's birthday from api calls and I am new to OAuth.
Steps followed : (Have followed all steps required for implementing login with google+)
1. Created an app.
2. Obtained app_id and secret_key.
3. Did not make use of SDK, implemented the process without SDK in php.
4. Obtained "CODE" by calling accounts[dot]google[dot]com/o/oauth2/auth?
5. Using the code from the URL parameters requested for access token by HTTPS POST method to https://accounts.google.com/o/oauth2/token, using CURL
6. When accessing the login page, user is asked for permissions to access the information such as email, profile, DOB etc., but I am not able to find a way to get that date of birth
7. I have tried access www[dot]googleapis[dot]com/plus/v1/people/User_ID?key={THE_API_KEY} . Still no luck
Please guide or suggest me on how to get the DOB. Also let me know if there is any other information I missed to share.
Thanks in advance.
Cheers!
Farhan

Well Well Ofcourse.. It has to be a security thing from google.
I got to know after I did a part of unit testing with different scenarios and missed out on a simple thing that google only responds with the b'day information if the user has allowed to in his profile settings.
all if the birth year is hidden, it will throw 0000 as year in the response of the HTTPS Post method.
If I am wrong in any of the information provided, Please do correct me.
Cheers!
Farhan.

Related

Setting up Google Calendar API

I'm trying to use the Google Calendar API in one of my projects. To do so, I need to set up OAuth access in the Google API console.
But when creating the consent-form (which is required to use OAuth), I get a meaningless error message:
The translation is as follows:
A problem occured. Please check your data and try again . If you have
not given any details, the problem may solve itself . In this case, we
recommend that you wait and try again later.
I have set the E-Mail address and project name. The optional fields were left blank.
So far I have not been able to solve the problem. I tried to wait for hours/days. I tried three different browsers. I also tried to contact Google support. All without success.
After days of trying, this is the solution:
Create another Google account
Using your old account, add the new account as an owner to your Google API project in the console
Log in with your new user account and accept the invitation
Create the OAuth consent form with the new user account
I have no idea WHY this worked, but it did.

Instagram api not returning any followers although response code is 200

I am using instagram to recieve the list of people i follow and although api returns the status code 200 I recieve absolutely no data.I tried using postman client instead of my code and even from there no data is being returned I am hitting the following service.
https://api.instagram.com/v1/users/self/follows?access_token=token
one thing to be noted is my application is in sandbox mode and this same access token is working and fetching other information about the user including media shared by the user and its basic information etc and user follows and is followed by several users.
Please suggest the solution thanks in advance.
I may have answer to this question since I was facing the same issue on my WinRT project yesterday.
You may need the relationship scope instead of 'follower_list' scope.
I am assuming that you have provided the scope as 'follower_list' in the authorization URL and logged in as yourself or through your own Instagram account(the same account with which you have created your Instagram app). And now if you are hitting the above service it will return nothing in data since you are requesting if the user is following you or not(so obviously you are not following yourself)!! So if you try logging in with someone else's Instagram account and hit the above service with follower_list scope it will return your Instagram account in data if the logged in person is following you.
EDIT
The above service will return all the users that are following you AND present in your sandbox users list. (Or at least that is my conclusion on this)
For further clarification try https://apigee.com/console/instagram for hitting this service there they are using the relationship scope.

Twitter Oauth in windows phone 8 app

I need to use Twitter Oauth to login my windows phone app,
What i need exactly is
1)when the user click twitter log in button from my app, i need to show the twitter llog in page in a browser,
2)when he enters his credentials and accept the app, then i should get the user information like, name, gender, bday, what ever i can take.
That,s it, then i can close the browser and make my app active.
I just need to make the user to log in via twitter.
I referred lot of examples, that are all quit confusing and doing all the stuffs in twiiter.
I tried this example
and got this error
'TweetSharp.TwitterService' does not contain a definition fError 2 'TweetSharp.TwitterService' does not contain a definition for 'GetAccessToken' and no extension method 'GetAccessToken' accepting a first argument of type 'TweetSharp.TwitterService' could be found (are you missing a using directive or an assembly reference?)
and i tried enter link description here
failed on that too.
Can anybody help me to do the authentication via twitter for my app.
Thank you.
I tried this example and got success, I contacted the person who have posted that example and got help from him to solve the issues raised from this example.
Actually this Example works fine for twitter integration,
What you have to do is
1)Register your app in twitter, here the link for app registration,
log in and register your app.
2)Make sure you have given the Call Back URL(i forget to give that, and that makes me face lot of issues)
3)Note down the Consumer Key, Consumer Secret and Call back url(we need specify this 3 in our code)
4)Go to Settings, and set your app access to Read and Write
5)down load the above link and change the Consumer Key, Consumer Secret and Call back url as per your app, and then run the example, it will work fine.
Thank you.
If you just want to authenticate using Twitter and don't want to post anything, perhaps you can try Azure Mobile Service Authentication. You can find more information here: mobile services authentication

Google+ API : Get Profile's currentLocation

I'm currently building a test and trying to get a google+ user location. I'm testing on myself and have set my position to public.
I was originally planning to use Google Latitude, however, since Google is deprecating this API in a few days, my only option is to use the Google+ API.
The parameter currentLocation was added a few months ago
I'm therefore trying to get it. But could not manage to do it.
I've tested on my own server using the PHP API and then the JS API with Oauth2.0, but this damn parameter is never sent back. I can get any other parameter but definitely not that one.
Then I've tested in the google+ explorer, but same thing here, nothing came out
Does anyone have already encounter a similar issue ?
I have a few idea where it could come from :
Does Oauth2.0 does not let me access this information (I've tried
any possible data-scope)
Is there just a bug on this functionality ?
Is it restricted to verified users ?
Or maybe it's just not possible ?
Thanks !
Access to location data is restricted to users who have granted you access to their location data at the time that the OAuth token was generated.
You have to specifically request access to location data in the scope parameter.
What I think is that r.placesLived would only give his location but the location of the user nor the location of the exact machine. It could be remembered that you need to have the address. However, it needs to look for another token for verifying a user's exact location. Going into it might only need more of a tracker and not only a location.
This is an old one but still valid question. Even field "currentLocation" is listed as valid reponse People object field, there´s no way to access field´s data.
Was reported as issue in G+ repository but there is no answer so far.
If you are still trying to get user´s current location try the following snippet, not sure if this is the best option but it works :):
Note: "r" holds the client.request() response data (API call)
r.placesLived.forEach(function(l) {
if (l.primary)
console.log(l.value);
});
Hope this helps.
Cheers.

Get information about authenticated user

I may be missing something simple, but I am having difficulty in getting information about the logged in user. I've successfully authenticated using OAuth and have obtained an access_token. I understand that a user_key is required to get access to private data. I don't seem to be able to figure out how to get this. I'm just starting with EventBrite integration so I'm not completely familiar with it. I've integrated with Facebook in the past. Any help would be appreciated.
See the bit about access_tokens and request headers here:
http://developer.eventbrite.com/doc/authentication/
Or, use one of the API client libraries to make the request for you:
http://developer.eventbrite.com/doc/libraries/

Resources