You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/09/29 01:57:41 UTC

[GitHub] allansduarte opened a new issue #2816: Any way to adapt response to Messenger webhook

allansduarte opened a new issue #2816: Any way to adapt response to Messenger webhook
URL: https://github.com/apache/incubator-openwhisk/issues/2816
 
 
   Hi there!
   
   I'm looking for help with Facebook Messenger webhook for a serverless technology bot.
   
   The problem that exists today is the impossibility of responding correctly to the messenger webhook, as it does not accept a JSON dictionary as an answer, but only a token.
   
   Error 400 Bas Request:
   ```
   function webhook (params) {
     if (params ['hub.verify_token'] === 'AWESOME_TOKEN') {
       return Promise.resolve (params ['hub.challenge']);
     }
   }
   ```
   Answer is not accepted by webhook:
   ```
   function webhook (params) {
     if (params ['hub.verify_token'] === 'AWESOME_TOKEN') {
       var apiResponse = {
         body: params ['hub.challenge'],
         statusCode: 200
       };
   
       return Promise.resolve (params ['hub.challenge']);
     }
   }
   ```
   
   s there any way to send a response without a JSON data dictionary? If there is no alternative to this problem?
   
   Thanks for the help.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services