我有一个执行查询的命令行应用程序。这是代码。需要访问令牌来请求此资源FQL问题
问题是它接收到形式为“abc ... | xyz ...”的访问令牌。有 没有会话部分。但是,返回的令牌无法用于执行我的查询至 为我的页面选择洞察。帮帮我 !!
const string permissions = "manage_pages,read_insights,offline_access";
dynamic oauthClient = new FacebookOAuthClient() ;
oauthClient.AppId = username ;
oauthClient.AppSecret = password ;
dynamic parameters = new ExpandoObject() ;
parameters.scope = permissions ;
parameters.response_type = "token" ;
// parameters.grant_type = "client_credentials" ;
dynamic result = oauthClient.GetApplicationAccessToken(parameters);
string token = result.access_token ;
// token comes back as "abc...|xyz..."
var fb = new FacebookClient(token);
string query = " select metric, value " +
" from insights " +
" where object_id = MY_PAGE and " +
" metric in ('page_impressions' , 'page_stories') and " +
" end_time >= end_time_date('2012-02-21') and " +
" end_time <= end_time_date('2012-02-11') and " +
" period = period('day') " ;
dynamic result2 = fb.Query(query) ; // Exception generated on this line.
return result2 ;
任何想法?
BTW - 结束时间的东西剪切和粘贴错误。应该是2012-02-11和2012-02-21之间的结束时间。令牌问题是我现在的问题。 – 2012-02-22 00:23:45
使用Facebook C#SDK v5.0.3 – 2012-02-22 02:43:58