javascript (#3) 应用程序没有能力进行这个 API 调用。开发工具包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11363598/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 12:55:09  来源:igfitidea点击:

(#3) Application does not have the capability to make this API call. JavaScript SDK

javascriptfacebookapi

提问by user1217055

I am trying to like a post with the JavaScript API, like this (id is the post ID):

我正在尝试使用 JavaScript API 喜欢一个帖子,像这样(id 是帖子 ID):

FB.api('/'+id+'/likes', 'post');

For example, FB.api('/55353596297_10150952824706298/likes', 'post');

例如,FB.api('/55353596297_10150952824706298/likes', 'post');

This returns "(#3) Application does not have the capability to make this API call".

这将返回“(#3)应用程序没有能力进行此 API 调用”。

采纳答案by Daniel Li

Ensure that you have the permissions to affect this. Most applications simply have the PUBLISH capability (feed) and basic permissions.

确保您有权限影响这一点。大多数应用程序仅具有 PUBLISH 功能(提要)和基本权限。

Now, if you're asking to retrieve the Likes for a given pool of users, aim to use:

现在,如果您要求检索给定用户池的 Likes,请使用:

FB.api("/likes?ids=55353596297,55353596298")

FB.api("/likes?ids=55353596297,55353596298")

For retrieving multiple user interests.

用于检索多个用户兴趣。

回答by óscar Palacios

Your app needs the publish_actions permission. My code:

您的应用需要 publish_actions 权限。我的代码:

FB.api(
    '131389306871851_642563079087802/likes',
    'post',
    {access_token:yourTokenHere}, // from authResponse.accessToken
    function(r) {
        console.log(r)            // Prints "true"
    }
);