Facebook graph api 我需要如何通过这些帖子的ID从帖子中获取用户名,以及需要执行哪些请求?Instagram API

Facebook graph api 我需要如何通过这些帖子的ID从帖子中获取用户名,以及需要执行哪些请求?Instagram API,facebook-graph-api,instagram,facebook-javascript-sdk,instagram-api,instagram-graph-api,Facebook Graph Api,Instagram,Facebook Javascript Sdk,Instagram Api,Instagram Graph Api,我有两个访问令牌: 从Instagram Graph API中:var fs\u access\u token,这是我登录Facebook后得到的 从Instagram基本显示:var inst_access_token; 所以 我有帖子ID的集合,我通过ig\u hashtag\u search: 我的Instagram商业账户上也有3篇帖子。 我试图通过一个端点获取我收藏的所有帖子的用户名: for (var u = 0; u < posts_ids.length; u++) {

我有两个访问令牌:

  • 从Instagram Graph API中:
    var fs\u access\u token
    ,这是我登录Facebook后得到的
  • 从Instagram基本显示:
    var inst_access_token
    ; 所以 我有帖子ID的集合,我通过
    ig\u hashtag\u search
  • 我的Instagram商业账户上也有3篇帖子。 我试图通过一个端点获取我收藏的所有帖子的用户名:

    for (var u = 0; u < posts_ids.length; u++) {
      fetch("https://graph.instagram.com/" + posts_ids[u] + "?fields=username&access_token=" + inst_access_token).then(function (response) {
      response.text().then(function (text) {
          alert(text); //using Instagram Basic Display
        });
      });
    }
    
    有趣的事实:如果我在我的Instagram商业帐户上插入我的一篇文章的id而不是posts_id[u],那么它就可以工作了! 这到底是怎么回事?这意味着我只能从Instagram帐户上的帖子中获取“用户名数据”,不是吗?还是怎样 我还尝试使用其他endpoind获取用户名,当然我使用了其他access_令牌,这是我登录Facebook后获得的(我上面使用的access_令牌是access_令牌,这是我登录Instagram后获得的;Instagram Graph API-登录Facebook,Instagram Basic Display-登录Instagram):

    还有一个有趣的事实:如果我在我的Instagram商业帐户上插入我的一篇文章的id,而不是posts_id[u],那么它就可以工作了! 我也试着这样做:

    for (var u = 0; u < posts_ids.length; u++) {
        fetch("https://graph.facebook.com/v8.0/" + posts_ids[u] + "?fields=username&access_token=" + inst_access_token).then(function (response) {
            response.text().then(function (text) {
               alert(text);
            });
        });
    }
    
    很可能,这是因为我试图将Instagram的访问令牌与使用Facebook的技术相结合,并将从Facebook收到的访问令牌与使用Instagram的技术相结合。 所以,你们能不能帮我在Instagram Basic或Instagram Graph中找到端点,以便从其他用户的帖子中获取用户名(特别是通过我通过Hashtag Search/recent_media获得的ID)?或者你不能帮助我理解如何正确使用它吗?因为我是初学者,可能不知道一些细节。请帮我通过帖子的ID获取帖子的用户名

    {
       "error": {
          "message": "Unsupported get request. Object with ID '17884048231750634' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
          "type": "IGApiException",
          "code": 100,
          "error_subcode": 33,
          "fbtrace_id": "AKiycowo9LbwZbKzxOL-EQ9"
       }
    }
    
    for (var u = 0; u < posts_ids.length; u++) {
       fetch("https://graph.facebook.com/v8.0/" + posts_ids[u] + "?fields=username&access_token=" + fs_access_token).then(function (response) {
          response.text().then(function (text) {
             alert(text);
          });
       });
    }
    
    {
       "error": {
          "message": "Unsupported get request. Object with ID '17884048231750634' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
          "type": "GraphMethodException",
          "code": 100,
          "error_subcode": 33,
          "fbtrace_id": "AhN5o9eopccP4NrQsu8QuaN"
       }
    }
    
    for (var u = 0; u < posts_ids.length; u++) {
        fetch("https://graph.facebook.com/v8.0/" + posts_ids[u] + "?fields=username&access_token=" + inst_access_token).then(function (response) {
            response.text().then(function (text) {
               alert(text);
            });
        });
    }
    
    for (var u = 0; u < posts_ids.length; u++) {
        fetch("https://graph.instagram.com/" + posts_ids[u] + "?fields=username&access_token=" + fs_access_token).then(function (response) {
             response.text().then(function (text) {
                 alert(text);
             });
        });
    }
    
    {
       "error": {
          "message": "Invalid OAuth access token.",
          "type": "OAuthException",
          "code": 190,
          "fbtrace_id": "ARVMttFmcIAfwBTPdYcMEfQ"
       }
    }