เวอร์ชันของ API กราฟ

โทเค็นการแก้ไขจุดบกพร่อง /debug_token

ตำแหน่งข้อมูลนี้ส่งคืนเมตาดาต้าเกี่ยวกับโทเค็นการเข้าถึงที่กำหนด ซึ่งรวมถึงข้อมูล เช่น ผู้ใช้ที่ออกโทเค็นให้ สถานะการใช้งานของโทเค็น เวลาหมดอายุของโทเค็น และสิทธิ์การอนุญาตที่แอพมีให้สำหรับผู้ใช้ที่กำหนด

ตำแหน่งข้อมูลนี้สามารถใช้ในโปรแกรมเพื่อแก้ไขจุดบกพร่องของปัญหาที่เกิดกับชุดโทเค็นการเข้าถึงจำนวนมากได้

การอ่าน

Graph API Explorer
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

Wrapper ข้อมูลของผลลัพธ์

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

การเผยแพร่และการลบ

คุณไม่สามารถดำเนินการเผยแพร่และลบได้ในขอบเขตนี้