首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

OpenGraph:我如何在FB.api中指定过滤器?

OpenGraph是一种协议,用于在社交网络中创建和分享开放图形(如Facebook Graph)。在FB.api中指定过滤器的步骤如下:

  1. 创建一个Facebook App并获取access_token
    • 前往Facebook开发者门户创建一个新的App。
    • 安装Facebook SDK,并根据提示获取app_idapp_secret
    • Facebook SDK中启用Graph API,并获取access_token
  2. 使用access_token获取user_idgraph_url
    • 使用access_token调用GET请求,在me资源中获取user_id:GET /v2.11/me?access_token=<access_token>{ "id": "{user_id}", "first_name": "John", "last_name": "Doe", "birthday": "01-01-1990", "gender": "male", "email": "john.doe@example.com", "locale": "en_US" }
      • 如果成功,将返回{user_id}{user_id}
  3. 使用user_idgraph_url获取user_infofriend_list
    • 使用user_id调用GET请求,在me/friends资源中获取friend_list:GET /v2.11/{user_id}/friends?access_token=<access_token>{ "data": [ { "id": "{user_id}", "first_name": "John", "last_name": "Doe", "birthday": "01-01-1990", "gender": "male", "email": "john.doe@example.com", "locale": "en_US" }, ... ] }
      • 如果成功,将返回friend_list
  4. 使用friend_list获取user_info
    • 使用friend_list调用GET请求,在me/friends/{friend_id}资源中获取user_info:GET /v2.11/{user_id}/friends/{friend_id}?access_token=<access_token>{ "id": "{user_id}", "first_name": "John", "last_name": "Doe", "birthday": "01-01-1990", "gender": "male", "email": "john.doe@example.com", "locale": "en_US" }
      • 如果成功,将返回user_info
  5. 使用user_info创建一个OpenGraph对象:
    • 创建一个OpenGraph对象,其中包含user_info中的所有属性:{ "id": "{user_id}", "first_name": "John", "last_name": "Doe", "birthday": "01-01-1990", "gender": "male", "email": "john.doe@example.com", "locale": "en_US", "friend_list": [ { "id": "{user_id}", "first_name": "John", "last_name": "Doe", "birthday": "01-01-1990", "gender": "male", "email": "john.doe@example.com", "locale": "en_US" }, ... ] }
  6. OpenGraph对象添加到friend_list
    • OpenGraph对象添加到friend_list:{ "data": [ { "id": "{user_id}", "first_name": "John", "last_name": "Doe", "birthday
相关搜索:如何在Yii中指定过滤器中的表名?如何在Java Streams收集器分组中添加指定的过滤器如何在我的Prism应用程序(如MS Office)中执行多个shell?如何在CloudFormation中创建安全组时指定我的IP?VIM:如何在我指定的错误信息格式中设置errorformat?如何在web浏览器中单击链接(如myprogram://a/a)时打开我的电子程序如何在我的SimpleUrlAuthenticationFailureHandler中找出哪个身份验证提供者/过滤器失败?我如何在APIView而不是ListAPIView中引入django过滤器来进行过滤和搜索?线程并行如何在TestNg中为DataProvider工作,我如何为DataProvider指定线程计数?如何在我的cucumber代码中指定安装在jenkins中的chromedriver路径?如何在此window.location文档中打开指定的html页面?我需要在javascript中做些什么改变?在机器人框架的小黄瓜风格的测试中,我如何在句子中间指定参数?如何在web API ASP.Net内核中对异常过滤器进行单元测试。我不想模仿onException方法如何在Git中更改我的全局user.name?注意:我已经使用config指定了全局用户名和电子邮件电子-如何在我的应用程序中安装或使用第三方依赖项,如brew或apt-get包?如何在Xcode中创建一个iPhone项目,在项目创建时指定我想要使用的SDK版本?如何在我的应用程序中运行另一个具有指定高度(例如半屏)的应用程序-B4A如何在您的webpack配置中为每个入口点指定不同的路径和文件名?(我的配置是无效的,尽管遵循文档)
相关搜索:
页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

没有搜到相关的沙龙

领券