Facebook API を使用してパブリック Facebook ページの投稿にアクセスしようとしていますが、適切な資格情報をすべて使用しても認証できないようです。FB.api は次を返します。
{"error":{"type":"http","message":"unknown error"}}
'access token 1: line 1' にエラーが記録されています。
Uncaught ReferenceError: TRJg376YTvXfk6sMur4Mggh5YnU is not defined access_token:1
(匿名関数)
私が使用しているコードは次のとおりです。
<script src="http://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<button name="my_full_name" onclick="connectToFacebook()" value="My Name" />
<script>
function connectToFacebook() {
FB.api('https://graph.facebook.com/oauth/access_token',
'get',
{client_id:'xxxxxxxxxx', client_secret:'xxxxxxxxxx',grant_type:'client_credentials'}, //client_credentials
function(response) {
alert(JSON.stringify(response));
});
FB.api("/publicpage/feed",
function (response) {
console.log(response);
});
}
</script>
それは彼らのサイトで十分に文書化されていません! 何か案は?