According to Facebook docs requesting birthday data is done by requesting user_birthday permission set and then the birthday string is stored under birthday in the return array.
What format does it return in, and does the format vary according to users setting?
Formats that I would predict
1990-05-22 // standard
05.22.1990 // USA reverse format
22.05 // User hid birth year
1990 // Getting only birth year without a date
NULL // User hid entire birthday
For me right now is important to determine whether Facebook gives one standard format of birthday value or its format depends on users birthday settings?
The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.
With the Facebook Graph API, you can access a wide range of user data, including user information such as name, email address, birthday, and friends list in JSON. You can also access information about pages that a user has liked or engaged with on Facebook, as well as events and photos that they have posted or shared.
The simplest way to get a copy of the User Profile object is to access the /me endpoint: FB. api('/me', function(response) { }); This will this will return the users name and an ID by default.
The Legacy REST API is in the process of being deprecated, while the Graph API is the most current, so if you're unsure of which one to use, your best bet is to go with that one. As you suggested, the Graph API, just like the Legacy REST API, is in fact a RESTful API.
The birthday returned by the facebook is a string of the format: MM/DD/YYYY
.
Reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With