【问题标题】:Unable to subscribe the App to the Page无法将应用订阅到页面
【发布时间】:2016-04-20 06:29:08
【问题描述】:

我正在按照入门教程 (https://developers.facebook.com/docs/messenger-platform/quickstart) 和本教程 (https://github.com/jw84/messenger-bot-tutorial) 创建一个简单的聊天机器人。 我创建了一个 fb 页面和一个应用程序。我有一台 Heroku 服务器正在运行,并已成功完成 webhook 设置。我还生成了页面访问令牌。

现在,当我尝试使用以下方式将应用订阅到页面时:

curl -ik -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<my_access_token>"

我收到以下错误:

Invoke-WebRequest : A parameter cannot be found that matches parameter name 'ik'.
At line:1 char:6
+ curl -ik -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_toke ...
+      ~~~
+ CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

当我在没有 -ik -X 的情况下运行时:

curl "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<my_access_token>"

我明白了:

StatusCode        : 200
StatusDescription : OK
Content           : {"data":[]}
RawContent        : HTTP/1.1 200 OK
                    Access-Control-Allow-Origin: *
                    Pragma: no-cache
                    Facebook-API-Version: v2.6
                    X-FB-Trace-ID: AdIMIX8WMY0
                    X-FB-Rev: 2291809
                    X-FB-Debug: Bh+/Cg7zU8taTXD0reqAlx+2vb9yVO8BcAT4WcOesChneP...
Forms             : {}
Headers           : {[Access-Control-Allow-Origin, *], [Pragma, no-cache], [Facebook-API-Version, v2.6],
                    [X-FB-Trace-ID, AdIMIX8WMY0]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 11

如何解决上述错误?

【问题讨论】:

    标签: curl facebook-messenger


    【解决方案1】:

    在 Windows PowerShell 中运行它

    Invoke-RestMethod -Uri https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<theToken> -Method Post
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-27
      • 1970-01-01
      • 1970-01-01
      • 2023-04-08
      • 2016-08-16
      • 1970-01-01
      相关资源
      最近更新 更多