1

Facebookの指示に従ってドメインをホワイトリストに登録しようとしていますが、何も動いていません。ドメインが追加されていません、ホワイトリストドメインFacebookのメッセンジャーの拡張子

私が最初にカールしてみました、応答が{result:"success"}ですが、私は私が{data:[]}

を取得していますホワイトリストされているドメインの一覧を表示しようとすると、その後、私は次のようにノード要求モジュールを使用してみました:

request.post("https://graph.facebook.com/v2.6/me/messenger_profile?access_token=sfdlksdfu79r9429049824982342348sjdfsf", { 
       "setting_type": "domain_whitelisting", 
       "whitelisted_domains": ["https://mydomainw.com", "https://mydomainw.com/profile", "https://sfujyx.com/ofr", "mydomain1.com", "mydomain.com"], 
       "domain_action_type": "add"}, function (err, res, body) { 
       console.log("Whitelisting domain"); 
       if (!err) { 
        console.log(body); 
        console.log("Showing the list of whitelisted:"); 
        request.get("https://graph.facebook.com/v2.6/me/messenger_profile?fields=whitelisted_domains&access_token=sfdlksdfu79r9429049824982342348sjdfsf", function (err, res, body) { 
         if (!err) { 
          console.log(body); 
         } else { 
          console.log(err); 
         } 
        }); 
       } else { 
        console.log(err); 
       } 
      }); 

それでもそれはカールと同じ結果をもたらす:

Screen shot of the result of the code

そして、私が使用してFacebookのグラフアピExplorerツール、ここで私は取得していますエラーです:

Graph Api tool, to whitelist domain

を私は本当に立ち往生していますが、私は何をすべき知っているか、どのようにメッセンジャーの拡張のために人々を正確にホワイトリストドメインはありません。

私は間違っていますか?なぜドメインが追加されていないのですか?

私のプロジェクトはGoogle App Engineにあります。

+0

あなたは間違ったAPIパスを使用していると思います。代わりに "/ me/messenger_profile"にする必要があります。 –

+0

{ "エラー":{ "メッセージ": "サポートされていない投稿リクエストIDが 'me'のオブジェクトが存在しない、権限がないために読み込めない、またはこの操作をサポートしていません。 https://developers.facebook.com/docs/graph-api」、 "タイプ": "GraphMethodException"、 "コード":100、 "fbtrace_id": "BDenwqcm3BD" } は}私が得る応答であります/ me/messenger_profile @MichealVu – aidonsnous

+1

あなたが間違ったaccess_tokenを使っているので上記のメッセージが表示されます。ページアクセストークンを取得しようとする必要があります。 –

答えて

2

問題は、ページアクセストークンの代わりにアプリケーションアクセストークンを使用していたため、その違いがわかりませんでした。

2

ドメイン: "https://mydomainw..com"は無効なドメインです。

要求は返す必要があります:

{ 
    "error": { 
    "message": "(#100) whitelisted_domains[0] should represent a valid URL", 
    "type": "OAuthException", 
    "code": 100, 
    "fbtrace_id": "Aq3AVaNVJU9" 
    } 
} 
+0

ちょっと@Micheal Vu、https://mydomainw..comは正しくない私はhttps://mydomainw.comを意味しましたが、とにかくこれらのドメインはすべて自分のものではありません。私はホワイトリストにしたい真のドメインを提供したくありませんでした。また、前回からさまざまな方法(グラフAPIツール)を試していますが、まだ何も動作していないため、さらに情報を追加しました。私の本当のドメインが必要ですか? – aidonsnous

2

実は、私は前に "setting_type" を使用していませんでした。ドメインを登録する方法は次のとおりです。

var request = require("request"); 

var options = { method: 'POST', 
    url: 'https://graph.facebook.com/v2.6/me/messenger_profile', 
    qs: { access_token: 'my_page_token' }, 
    headers: { 'content-type': 'application/json' }, 
    body: 
    { whitelisted_domains: 
     [ 
     'https://mydomainw.com', 
     'https://ijuugwivbc.localtunnel.me' ] }, 
    json: true }; 

request(options, function (error, response, body) { 
    if (error) throw new Error(error); 

    console.log(body); 
}); 
関連する問題