必须使用app access_token调用此方法 [英] This method must be called with an app access_token

查看:527
本文介绍了必须使用app access_token调用此方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在搜索论坛/网页的日子之后,我仍然无法让它离开,并使用SCORE图api

 error:{
message:(#15)必须使用app access_token调用此方法。,
type:OAuthException,
code:15
}
}

api资源管理器我尝试使用这个(已将publish_actions权限激活并选择POST):

  https://graph.facebook.com / 100003429183160 / score?score = 555& access_token = APP_ACCESS_TOKEN 

没有运气:(



我已经完成了以下操作:



•将我的应用程序设置为GAME,基本信息,设置Auth对话框

•设置Open Graph类型,对象,聚合



•使用/验证正确的APP ACCESS_TOKEN(不是用户access_token)通过访问令牌工具



•使用publish_actions权限



•确保使用POST方法



•试用appID | appSecret作为应用程序access_token



•验证我确实安装了应用程序



•可以通过图形API,拉朋友列表和照片等发布到墙上。



任何线索还可能导致不能使用Graph API Explorer运行?

解决方案

strong>答案: -



实际上,使用SCORE Graph API需要与普通访问令牌不同的应用程序访问令牌



所以如果你想要完成你的任务,通过使用以下脚本来获取应用程序访问令牌.......



然后用旧的access_token替换生成的application_access_token,就是

  $ APPLICATION_ID =APP_ID; 
$ APPLICATION_SECRET =APP_SECRET;

$ token_url =https://graph.facebook.com/oauth/access_token? 。
client_id =。 $ APPLICATION_ID。
& client_secret =。 $ APPLICATION_SECRET。
& grant_type = client_credentials;
$ app_token = file_get_contents($ token_url);

获取此应用程序访问令牌后,您可以轻松完成此任务。



当您需要应用程序访问令牌



当您有进程时,您需要使用Facebook应用程序访问令牌代表应用程序而不是代表特定用户。当您通过图形访问您的应用程序的Facebook Insights数据时,以及当您要为您的应用程序创建测试Facebook用户时,会发生这种情况。



可惜的是,这被掩埋在Facebook图形API的身份验证指南中。


After days of searching the forums/net, I still couldn't get this to go away and use the SCORE graph api

{
  "error": {
  "message": "(#15) This method must be called with an app access_token.", 
  "type": "OAuthException", 
  "code": 15
  }
}

On the graph api explorer i tried using this (with publish_actions permission activated & POST selected):

https://graph.facebook.com/100003429183160/scores?score=555&access_token=APP_ACCESS_TOKEN

Having no luck :(

I have done the following:

• Set my app as a GAME, the basic info, setup the Auth Dialog

• Setup the Open Graph type, object, aggregation

• Use/Verify the right APP ACCESS_TOKEN (not the user access_token) via Access Token Tool

• Use the publish_actions permission

• Made sure it's using POST as method

• Tried appID|appSecret as an app access_token

• Verified that I indeed installed the app

• Was able to post to a wall via graph api, pull friends list and photos, etc.

Any clues what else could cause this not to run with the Graph API Explorer?

解决方案

Answer:-

Actually for using SCORE Graph API you need the "Application access token" which is different than a normal access token

So if you want your task to be done GET an Application access token by using the following script.......

And then replace the generated application_access_token with old access_token, that's it

$APPLICATION_ID = "APP_ID";
$APPLICATION_SECRET = "APP_SECRET";

$token_url =    "https://graph.facebook.com/oauth/access_token?" .
                "client_id=" . $APPLICATION_ID .
                "&client_secret=" . $APPLICATION_SECRET .
                "&grant_type=client_credentials";
$app_token = file_get_contents($token_url);

After getting this application access token you can easily do this task.

When You Need An Application Access Token

You need to use a Facebook application access token when you have a process that acts on behalf of the application, rather than on behalf of a particular user. This happens when you access your Facebook Insights data for your app via the graph, and also when you want to create test Facebook users for your app.

Sadly, the documentation for this is buried in the authentication guide for the Facebook graph API.

这篇关于必须使用app access_token调用此方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆