- 그래프 API 탐색기
- https://developers.facebook.com/tools/explorer/
- API 호출 테스트를 할 수 있다.
- 페이스북 내 앱
- https://developers.facebook.com/apps/
- 새 앱 추가 로 app-id 등을 받을 수 있다.
- PHP SDK 구버전
- https://github.com/facebookarchive/facebook-php-sdk
- 액세스 토큰 받아오기
- https://graph.facebook.com/oauth/access_token?client_id={app-id}&client_secret={secret-key}&grant_type=client_credentials
v2.10 기준.
https://developers.facebook.com/tools/explorer
1. posts 내용 가져오기
get
/{user-id}/posts?fields=id,message,link,attachments
으로 하면지정된 추가 정보를 보여준다.
fields 가 없으면 제목 정도만 보여준다.
limit=5 처럼 추가해서 가져올 갯수 제한 가능.
앱-id로 할 경우 page 에 대해서만 동작 가능한 것 같다.
사용자 것을 가져올 수는 없네.
개인 피드 등을 가져올려면 앱 접근 권한 줘야함 -> 할려면 앱에 대해서 우선 심사부터 받아야함. 심사 못 받으면 user_posts 등을 가져올 수 없음.
2. /me
get
사용자의 user-name,user-id 를 알아온다.