我想在我的朋友的時間表上發佈消息。我正在使用下面的代碼。我也有適當的訪問令牌,但仍然無法發佈。你可以看看這裏的代碼。無法發佈到Facebook供稿
<script>
$(document).ready(function() {
var token = "<?php echo $_SESSION['access_token'];?>";
alert()token;
$.post(
"https://graph.facebook.com/<?php echo $sqlr['regidfriendsid']; ?>/feed",
{
picture: "http://my.com/hi.jpg",
link: "https://www.my.com/login.php?ref=owall",
privacy: '{value: "EVERYONE"}',
access_token: token,
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
message: " Click to see more? "
}
);
});
</script>
我不知道爲什麼我得到這個錯誤。
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104
}
}
您的'access_token'存在一些問題請在此驗證您的訪問令牌:[Debugger](https://developers.facebook.com/tools/debug) –
@Sahil - 它的有效令牌。我剛纔在調試器上檢查過它。我甚至在var token ='「<?php echo $ _SESSION ['access_token'];?>」;'之後保留了一個alert(token),它給了我值。除此之外還有其他選擇嗎? – Yahoo
使用這個令牌並嘗試使用圖表API瀏覽器發佈一次。 –