グラフ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

公開と削除

このエッジでこれらのアクションを実行することはできません。