【问题标题】:How to write the correct URI using camel and facebook4j如何使用骆驼和 facebook4j 编写正确的 URI
【发布时间】:2016-03-13 15:03:41
【问题描述】:

我正在使用 apache camel 和 facebook 组件。当我使用字符串时

<from uri="facebook://me?oAuthAppId={{oAuthAppId}}&amp;oAuthAppSecret={{oAuthAppSecret}}&amp;oAuthAccessToken={{oAuthAccessToken}}"/>

facebook 回复我

{
  "name": "Some Myname",
  "id": "my id"
}

现在我想获得我所有的“喜欢”。根据 facebook api,我应该这样写:me?fields=likes。所以我试过这个uri

<from uri="facebook://me?fields=likes&amp;oAuthAppId={{oAuthAppId}}&amp;oAuthAppSecret={{oAuthAppSecret}}&amp;oAuthAccessToken={{oAuthAccessToken}}"/>

但它不起作用。我应该如何写这个 uri 来获得我的所有喜欢? 提前致谢

【问题讨论】:

    标签: apache-camel jbossfuse facebook4j


    【解决方案1】:

    您可以使用getUserLikes 方法,链接到userLikes 端点:

    facebook://userLikes?oAuthAppId={{oAuthAppId}}&amp;oAuthAppSecret={{oAuthAppSecret}}&amp;oAuthAccessToken={{oAuthAccessToken}}
    

    您可以使用可选的userId 参数。

    【讨论】:

    • 为什么只有前 8 个赞?
    • 我不知道。 API 使用页面,尝试配置一个reading 来指定您想要拥有的元素数量。 camel facebook 组件只是 facebook4j 的包装器。您应该喜欢此文档或尝试使用 facebook api。
    猜你喜欢
    • 1970-01-01
    • 2014-12-14
    • 2015-07-07
    • 2011-06-17
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    • 2013-07-16
    • 1970-01-01
    相关资源
    最近更新 更多