【发布时间】:2013-09-02 16:05:26
【问题描述】:
我正在用 c# 制作一个小部件,以便从公共 facebook 页面/个人资料中获取帖子。
我相信您每次向 api 发出请求时都必须获取访问令牌?
我不知道我需要哪个访问令牌以及要使用哪个 url 请求字符串。
这是我目前正在使用的,但它带回了一个意想不到的键。 access_token=112121212121212|NxG_8djeufhfywhduEjaeU4J-lh4
(我输入了随机字符作为结构示例)。
string response = "https://graph.facebook.com/oauth/access_token?client_id=" + facebook_AppID + "&client_secret=" + facebook_AppSecret + "&grant_type=client_credentials";
string accesstoken = RequestResponse(response);
然后,当我使用该代码从墙上获取帖子时,使用:
string urlGetFeed = "https://graph.facebook.com/thepagename?fields=access_token=" + accesstoken2 + ",posts.fields(message,picture)";
我得到一个错误:远程服务器返回一个错误:(400)错误请求。错误。
【问题讨论】:
-
你试过 facebook sdk 吗?
标签: c# facebook facebook-graph-api