1

페이스 북에서 제공하는 지침에 따라 도메인을 허용 목록에 추가하려고했으나 아무 것도 작동하지 않습니다. 내가 처음 컬과 노력도메인이 추가되지 않습니다. 허용 도메인 도메인 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

을 그리고 : 아직도 그것은 컬과 같은 결과를 가져 페이스 북 그래프 API 광고 Explorer의 도구, 여기에 내가 점점 오전 오류입니다 :

Graph Api tool, to whitelist domain

정말 끼 었어, 나는 내가 나해야하는지 모르는 사람들이 어떻게 메신저 확장 정확히 화이트리스트 도메인입니다.

내가 뭘 잘못하고 있니? 도메인이 추가되지 않는 이유는 무엇입니까?

내 프로젝트가 Google App Engine에 있습니다.

+0

잘못된 API 경로를 사용하고 있다고 생각합니다. 대신 "/ me/messenger_profile"이어야합니다. –

+0

{ "오류": { "message": "지원 요청이 지원되지 않습니다. 'me'ID가있는 개체가 없거나 사용 권한이 없어서로드 할 수 없거나이 작업을 지원하지 않습니다. 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); 
});