How to send message via API

(Chad Davis) #1

Outcome: Receive data from Integromat in a conversation

Question: How do you receive a message from an API in a conversation?

Situation:

  • Data is sent to webhook from FlowXO into Integromat (including bot connection ID, bot ID, user connection ID, etc)
  • Integromat does a bunch of stuff and has data to send back to the conversation
  • I’m able to get the API data (and encoded message ID) in Integromat
  • I would guess I would need to make an HTTP POST call in integromat to the FlowXO API for that conversation, but looking for guidance on this process.
  • This is where I’m lost.

How do I get that data into the conversation?

Does the API allow you to POST data into a conversation?

Do I use the ‘Wait For A Response’ action?

Would love if someone was able to forward some instructions or walk through this posting process.

Thank you!

(Nathan Stults) #2

Hi Chad -

The only way to receive information back from a service within the context of a single flow is to have the service return the data as part of an outgoing HTTP request. There is not a way to make a conversation “listen” for incoming HTTP requests at the moment, even with a “Wait for a Response”. That only waits for new messages to come in on the chat channel, and currently there’s not a publicly available API to simulate that.

What you can do is split your logic into multiple flows, where one flow ends where control transfer to Integromat, and then you create a new flow with a Webhook trigger for Integromat to call back to which would pick up the workflow from there.