Y
Y
Yuri Matveenko2017-08-16 18:02:15
Facebook
Yuri Matveenko, 2017-08-16 18:02:15

FaceBook API authorization, how to find out ID?

Comrades, I authorize the user like this:

https://www.facebook.com/v2.10/dialog/oauth?client_id=******&scope=user_friends&redirect_uri='.$uri.'&response_type=code'

The redirect comes code and then I do:
$ajson=file_get_contents('https://graph.facebook.com/v2.10/oauth/access_token?client_id=*******&redirect_uri='.$uri.'&client_secret=*****&code='.$_GET['code']);

JSON arrives:
object(stdClass)#999 (3) {
  ["access_token"]=>
  string(181) "*****"
  ["token_type"]=>
  string(6) "bearer"
  ["expires_in"]=>
  int(5177362)
}

VK also comes with a user ID. How do I get the user ID to continue using the GRAPH API??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philipp, 2017-08-16
@zoonman

You need to get information about yourself
Here is how to do it correctly https://developers.facebook.com/docs/php/howto/exa...
https ://developers.facebook.com/tools/explorer/145
... how to install packages via Composer, then getjump.me/en-php-the-right-way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question