问题描述
我正在遵循入门教程( https://developers.facebook.com /docs/messenger-platform/quickstart )和本教程( https://github.com). com/jw84/messenger-bot-tutorial )来创建一个用于Messenger的简单机器人.我创建了一个fb页面和一个应用程序.我有一台Heroku服务器正在运行,并且已经成功完成了webhook的设置.我还生成了页面访问令牌.
I'm following the getting started tutorial(https://developers.facebook.com/docs/messenger-platform/quickstart) and this tutorial(https://github.com/jw84/messenger-bot-tutorial) to create a simple bot for messenger.I have created a fb page and an app. I've got one Heroku server running and have successfully done the webhook setup. I've also generated the page access token.
现在,当我尝试使用以下方式将应用程序订阅到页面上时:
Now when I try to subscribe the App to the Page using:
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运行时:
when I run without the -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
如何解决以上错误?
推荐答案
在Windows PowerShell中运行此
Run this in Windows PowerShell
Invoke-RestMethod -Uri https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<theToken> -Method Post
这篇关于无法将应用程序订阅到页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!