无法创建任何应用程序请求 [英] Failed to create any app request
问题描述
我想通过Facebook应用程序图发送请求. 有时成功,但有时失败,并返回值:
I want to send a request with the facebook app-graph.. sometimes successfully but sometimes failed with return value:
{
"error": {
"message": "(#2) Failed to create any app request",
"type": "OAuthException",
"code": 2
}
}
请帮助我..为什么会发生?呵呵
please help me .. why did it happen?hehe
推荐答案
您需要使用应用程序access_token
发送应用程序到用户的请求.例如:
You need to send the app-to-user request using the application access_token
. For example:
$param = array(
'message' => 'Check out the latest update',
'data' => 'some_data_string',
'access_token' => 'app_id|app_secret',
);
$tmp = $facebook->api("/[user_id]/apprequests", "POST", $param);
有关生成应用程序access_token的信息,请参见 facebook文档.该文档指出:
See the facebook documentation for generating an app access_token. The documentation states:
还有另一种方法可以调用Graph API 需要使用生成的应用令牌.您只需传递您的应用程序ID和 调用时将应用程序秘密作为access_token参数:
There is another method to make calls to the Graph API that doesn't require using a generated app token. You can just pass your app id and app secret as the access_token parameter when you make a call:
https://graph.facebook.com/endpoint?key=value&access_token=app_id|app_secret
这篇关于无法创建任何应用程序请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!