无法将应用程序订阅页面Facebook

时间:2018-08-20 18:04:43

标签: facebook facebook-graph-api facebook-messenger facebook-messenger-bot

我正在遵循入门教程(https://developers.facebook.com/docs/messenger-platform/quickstart)和本教程(https://github.com/jw84/messenger-bot-tutorial)来为Messenger创建一个简单的机器人。我创建了一个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>"

我得到:

curl : {"error":{"message":"Invalid OAuth access
token.","type":"OAuthException","code":190,"fbtrace_id":"DaFO6OXOLgf"}}
Au caractère Ligne:1 : 1
+ curl "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation : (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebEx
   ception
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

我也找到了这个Unable to subscribe the App to the Page,当我这样做的时候:

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

我得到:Invoke-RestMethod : {"error":{"message":"Invalid OAuth access token.","type":"OAuthException","code":190,"fbtrace_id":"EGmX8bew4ee"}} Au caractère Ligne:1 : 1 + Invoke-RestMethod -Uri https://graph.facebook.com/v2.6/me/subscribed_ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation : (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebEx ception + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

我也尝试过使用邮递员,但没有成功。 谢谢您的帮助。

0 个答案:

没有答案
相关问题