Facebook Graph API 用法 (登入/抓資料)

Graph Explorer:
https://developers.facebook.com/tools/explorer?method=GET&path=me%2F&version=v2.2

Graph API: https://developers.facebook.com/docs/graph-api/reference/v2.6/user/

Token: https://developers.facebook.com/docs/facebook-login/access-tokens

PHP SDK: https://developers.facebook.com/docs/php/gettingstarted

Reference:

Examples:

Get login URL:

Login callback:

Note:

  • Need to submit a request to obtain birthday value in Facebook Developer.
  • Birthday value could be null
  • When adding a new permission, the permission name need to be added when building FB login URL

Image 1

Reference:

  1. Extra params:
    https://developers.facebook.com/docs/graph-api/using-graph-api/
  2. Get birthday data
    https://stackoverflow.com/questions/37698073/get-facebook-birthday-through-php-5-0-sdk
  3. Graph Objects Handling
    https://developers.facebook.com/docs/php/GraphObject/5.0.0