Unable to subscribe the App to the Page

对着背影说爱祢 提交于 2019-12-23 04:08:54

问题


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>"

I get the following error:

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

when I run without the -ik -X :

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

i get:

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

How can I fix the above error?


回答1:


Run this in Windows PowerShell

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


来源:https://stackoverflow.com/questions/36720560/unable-to-subscribe-the-app-to-the-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!