Facebook API. 그래프 API 탐색기 사용

less than 1 minute read

탐새끼 : https://developers.facebook.com/tools/explorer

왜 이걸 쓰는가?

보통 OAuth Client샘플코드나 라이브러리를 만들어서 데이터를 확인하는데 그 과정을 거치려면 시간낭비도 심하고

코딩에 익숙하지 않거나 … 익숙하더라도 소셜API 호출에 익숙하지 않은 사람은 고생스럽다. OAuth가 표준이라고는 하지만 사이트마다 호출구조가 묘하게 다르기도 하고

facebookapiexplorer2

형광펜 표시한 부분만 API파라미터 넣어서 호출하면 된다. 예를들어

https://developers.facebook.com/docs/graph-api/reference/v2.8/user/feed

여기있는 feed호출을 보면

/{user-id}/feed

The feed of posts (including status updates) and links published by this person, or by others on this person’s profile. There are other edges which provide filtered versions of this edge:

  • /{user-id}/posts shows only the posts that were published by this person.
  • /{user-id}/tagged shows only the posts that this person was tagged in.

All of these derivative edges share the exact same reading structure, however /feed sh

 

라고 나와있으니 요즘 열받는 피자헛코리아 아이디를 넣어주고 feed를 넣고 호출 하면 결과가 출력된다.

/pizzahutkorea/feed

 

API 뽑고 쓰고 별로재미도 없는데 요즘 자주 하게 되네