zendesk / sunshine-conversations-ruby

Smooch API Library for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I know when a user has sent a medsage?

angelacode opened this issue · comments

I want to use smooch as my interface rather than supporting a client for each message channel.

However I don't see how to listen for when a user messages. The closest is get message.

Telegram client for example uses long polling. And messenger triggers off of a webhook.

How do I know when a user has just sent me a message. Get message looks like it takes before and after time stamps. I just want the last most recent message.

It looks like I provide a web hook URL to my serve into your dashboard. So that's where I receive the JSIN payload. Me then use the client to respond.

So I don't use the ruby client as part of listening for the user input. Is that correct? I just set up my own messages end point and process the payload. Is that right?

I just set up my own messages end point and process the payload. Is that right?

Yes that's exactly right. This wrapper is used to issue requests to Smooch. To receive messages and other events, you would configure a webhook pointing to your server and handle that yourself

Get message looks like it takes before and after time stamps. I just want the last most recent message.

If you omit the before and after timestamps, the API will return the most recent 100 messages