Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run asynchronous queries via HTTP ? (where to set service accounts ?) #2

Closed
julbrs opened this issue Dec 1, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@julbrs
Copy link

julbrs commented Dec 1, 2018

Hello

The adapter works pretty well for synchronous queries. But I am testing to use the robot.router.post method that allow asynchronous queries:

In exemple.coffee:

  robot.router.post '/hubot/chatsecrets/:room', (req, res) ->
    room   = req.params.room
    console.log req.body
    data   = req.body
    secret = data.secret

    robot.messageRoom room, "I have a secret: #{secret}"

    res.send 'OK'

And I have this result:

TypeError: Cannot read property 'thread' of undefined
  at HangoutsChatBot.sendMessage (/home/julien/web/hubot-google-hangouts-chat/src/bot.js:58:34)
  at HangoutsChatBot.send (/home/julien/web/hubot-google)hangouts-chat/src/bot.js:77:10)
  at Robot.messageRoom (/home/julien/web/myhubot/node_modules/hubot/src/robot.js:608:23)
  at /home/julien/web/myhubot/scripts/example.coffee:92:5, <js>:9:13

I assume that using HTTP mode we can only use today synchronous queries (it post data using httpRes sent in the message). Any option to have asynchronous ? :)

@kumarse
Copy link

kumarse commented Dec 5, 2018

Hello,

Yes today the adapter supports only synchronous responses in HTTP. We will look into adding asynchronous support soon.

@kumarse kumarse added the enhancement New feature or request label Dec 5, 2018
@rochejeremy
Copy link

Are cards supported when using pub/sub? Cards seem to work fine for webhooks, but I cannot get them to work with msg.send.

@rtilikay
Copy link

Hello,

Asynchronous support has now been added. You will need to use a service account when making asynchronous queries. Please consult our documentation on how to set up a service account:

https://developers.google.com/hangouts/chat/how-tos/integrate-hubot#service_account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants