Skip to content
  • Home
  • Blog
    • yttags
    • Youtube
  • Categories
  • Tools
  • Server-Side
    • php
    • Node.js
    • ASP.NET
    • Magento
    • Codeigniter
    • Laravel
    • Yii
  • JS
    • AngularJS
    • Ajax
    • VueJs
    • jQuery
    • ReactJS
    • JavaScript
  • Full Form
  • Guest Post
  • Advertise
  • About
  • Contact Us
Pakainfo

Pakainfo

Web Development & Good Online education

Facebook Graph Api GET User email address mobile birthday

July 8, 2018 Pakainfo Technology, Ajax, JavaScript, jQuery Leave a comment
Rate this post

Facebook Graph Api GET User email address mobile birthday

facebook graph api friends list example

In this post we will show you facebook Graph Api GET User email address mobile birthday , hear for facebook Graph Api GET User email address mobile birthdaywith example.Download and demo we will give you demo,Source Code and example for implement.

in this post you will show facebook graph api search Like as a User name,User birthday,User email Address,User education and User Mobile cell number list.

Free Live Chat for Any Issue

Requirements

What You Should Already Know
Before you study FaceBook dev Accounts,
need to HTML,
CSS,
JavaScript,
FaceBook Funda..
FaceBook Graph API
Browsers opetions
FaceBook APP ID (var fbAppId = ‘9568444152525458’;)

Read Also:  Previous and next buttons functionality in javascript

how to get access token facebook graph api?

Simple getAuthResponse() Method of used to get access token facebook graph api.

 access_token =   FB.getAuthResponse()['accessToken'];

facebook Graph Api GET User email address mobile
facebook Graph Api GET User email address mobile

Page Access Tokens using Facebook Graph Api

	FB.api(
	  '/me',
	  'GET',
	  {"fields":"id,name,birthday,email,education"},
	  function(response) {
	      console.log(response);
	      access_token =   FB.getAuthResponse()['accessToken'];
		  Console.log(access_token);
	  }
	);

facebook graph api Simple example Step By Step

Step 1 : Create a simple index.html

<html class="no-js">
<head>
    <title>Facebook graph api friends list example Step By step</title>
	<script src="index.js"></script>
</head>
<body>
	<div id="status">
	</div>
	<div id="result"></div>

	<fb:login-button data-max-rows="1" data-size="large" data-button-type="continue_with" data-show-faces="true" data-auto-logout-link="true" data-use-continue-as="false" scope="public_profile,email" onlogin="checkLoginState();">
	</fb:login-button>

	<pre id="resultdata"></pre>
	<pre id="resultdata1"></pre>
	<pre id="resultdata2"></pre>
	<pre id="resultdata3"></pre>
	<pre id="resultdata4"></pre>
</body>
</html>

Step 2 : Include Script index.js

<script>
var fbAppId = '9568444152525458';
function statusChangeCallback(response) {
	if (response.status === 'connected') {
	  testAPI();
	  personalAPI();
	} 
	else 
	{
	  document.getElementById('status').innerHTML = 'Please log ' +
		'into this app.';
	}
}
function checkLoginState() {
	FB.getLoginStatus(function(response) {
	  statusChangeCallback(response);

	});
}
window.fbAsyncInit = function() {
	FB.init({
	  appId      : fbAppId,  
	  status     : true,     
	  cookie     : true,                                  
	  xfbml      : true,                                   
	  version     : 'v2.9',   
	});
	
	FB.getLoginStatus(function(response) {
	statusChangeCallback(response);
	});
};

  // Load the Simple SDK Asynchronously

(function(d, s, id){
 var js, fjs = d.getElementsByTagName(s)[0];
 if (d.getElementById(id)) {return;}
 js = d.createElement(s); js.id = id;
 js.src = "//connect.facebook.net/en_US/sdk.js";
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

function doit() 
{
		alert("Simple do it button clicked!");
}

function testAPI() 
{
	FB.api('/me','GET',{"fields":"name,birthday"}, function(response) {
	document.getElementById('status').innerHTML =
		'Thanks .. , If you are not ' + response.name + '!  Please logout';
	});
}
function personalAPI() 
{
	FB.api(
	  '/me',
	  'GET',
	  {"fields":"name,birthday,email,education"},
	  function(response) {
	  console.log(response);
	      access_token =   FB.getAuthResponse()['accessToken'];
	  
	      document.getElementById('resultdata').innerHTML = "<pre> <b>Access Token<b/> : "+access_token+"</pre>";
	      document.getElementById('resultdata1').innerHTML = "<pre> <b>User Name<b/> : "+response.name+"</pre>";
		  document.getElementById('resultdata2').innerHTML = "<pre> <b>User Email<b/> : "+response.email+"</pre>";
		  document.getElementById('resultdata3').innerHTML = "<pre> <b>User birthday<b/> : "+response.birthday+"</pre>";
		  document.getElementById('resultdata4').innerHTML = "<pre> <b>User education<b/> : "+response.education+"</pre>";
	  }
	);

}

function hide (elements) {
  elements = elements.length ? elements : [elements];
  for (var index = 0; index < elements.length; index++) {
    elements[index].style.display = 'none';
  }
}

</script>

Download

Example

Read Also:  ASP.NET MVC Web Configuration File web.config

Related posts:

  1. GET Facebook friends list email mobile profile url using Facebook Graph API
  2. Facebook Graph API Search Multiple Parameters Queries
  3. Access Tokens – Facebook Login – Facebook Open Graph API
  4. PHP Facebook Graph API GET comments hide-delete comments
  5. Facebook graph api multiple keyword search
  6. Email Validation in pure JavaScript | Validate email address
  7. How to Post Into Facebook Group with PHP using Graph API
  8. Facebook Api Get User Id Profile Information using PHP
  9. Login with Facebook using javascript
  10. FaceBook Graph Search Queries URL API – FaceBook Search
Read Also:  Laravel Search Comma Separated values Example
facebook api get user emailfacebook api get user infofacebook api get usernamefacebook get user idfacebook graph api get mobile numberget birthday from facebook apiget birthday from facebook api iosget user details from facebook api

Post navigation

Previous Post:GET Facebook friends list email mobile profile url using Facebook Graph API
Next Post:Tips normal delivery of baby Pregnancy – baby delivery process

Search

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me
Cricday

Categories

3movierulz (48) Ajax (464) AngularJS (377) ASP.NET (61) Bollywood (92) Codeigniter (174) CSS (96) Earn Money (61) Education (53) Entertainment (108) fullform (77) Google Adsense (62) Highcharts (77) Hollywood (93) JavaScript (1354) Jobs (39) jQuery (1421) Laravel (1083) LifeStyle (50) movierulz4 (47) Mysql (1029) Mysqli (890) Node.js (38) php (2110) Programming (2320) Python (96) ReactJS (37) Software (102) Software (77) Stories (78) tamilrockers (88) Tamilrockers kannada (48) Tamilrockers telugu (47) Tech (101) Technology (2359) Tips and Tricks (107) Tools (111) Top10 (293) Trading (49) Trending (45) VueJs (250) Web Technology (83) webtools (129) wordpress (165) World (121)

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here

Web Development & Good Online education : Pakainfo by Pakainfo.
Top
Subscribe On YouTube : Download Source Code & New itsolutionstuck
We accept paid guest Posting on our Site : Guest Post Chat with Us On WhatsApp