그래프 API 버전

디버그 토큰 /debug_token

이 엔드포인트는 특정 액세스 토큰에 대한 메타데이터를 반환합니다. 여기에는 토큰 발급 대상 사용자, 토큰 유효성, 만료 날짜, 앱이 특정 사용자에 대해 보유한 권한 등의 데이터가 포함됩니다.

프로그래밍 방식으로 다수의 액세스 토큰들로 문제를 디버깅하는 데 사용할 수도 있습니다.

읽기

그래프 API 탐색기
GET /v19.0/debug_token?input_token={input-token} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/debug_token?input_token={input-token}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/debug_token?input_token={input-token}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/debug_token?input_token={input-token}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/debug_token?input_token={input-token}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

매개변수

이름 설명 유형

input_token

검사 대상 액세스 토큰입니다. 이 매개변수를 지정해야 합니다.

string

필드

이름설명유형

data

결과를 둘러싼 데이터 래퍼입니다.

object

app_id

이 액세스 토큰이 사용되는 앱의 ID입니다.

string

application

이 액세스 토큰이 사용되는 앱의 이름입니다.

string

error

액세스 토큰으로 인해 그래프 API에 대한 요청에서 반환되는 오류입니다.

object

code

오류의 오류 코드입니다.

int

message

오류의 오류 메시지입니다.

string

subcode

오류의 오류 하위 코드입니다.

int

expires_at

이 액세스 토큰이 만료되는 시점의 타임스탬프입니다.

unixtime

data_access_expires_at

사용자 데이터에 대한 앱의 액세스 권한이 만료되는 시점의 타임스탬프입니다.

unixtime

is_valid

액세스 토큰의 유효성입니다.

bool

issued_at

이 액세스 토큰이 발급된 시점의 타임스탬프입니다.

unixtime

metadata

액세스 토큰과 연결된 일반 메타데이터입니다. 'sso', 'auth_type', 'auth_nonce'와 같은 데이터를 포함할 수 있습니다.

object

profile_id

사칭 액세스 토큰의 경우, 이 토큰이 포함된 페이지의 ID입니다.

string

scopes

이 액세스 토큰에서 사용자가 앱에 부여한 권한 리스트입니다.

string[]

granular_scopes

이 액세스 토큰에서 사용자가 앱에 부여한 세분화된 권한 리스트입니다. 권한이 전체에 적용될 경우 대상이 표시되지 않습니다.

shape('scope' => string,'target_ids' => ?int[],)[]

user_id

이 액세스 토큰이 사용되는 사용자의 ID입니다.

string

게시 및 삭제

이 에지에서는 해당 작업을 수행할 수 없습니다.