Mobile app integration

(Jason Mattiace) #1

Hi community, what would be the best way to integrate FlowXO into a custom iOS/Android application? My users would be asking questions via the app which gets routed to my server. The issue I see with FlowXO is that there is no clean way of doing this as there is no web api.

My understanding of how to accomplish this: after receiving a user’s question from the iOS app on my server, send a webhook request to FlowXO. The webhook endpoint should route the user’s question to trigger the proper flow. The triggered flow will send a Custom HTTP Request back to the server with the answer.

This doesn’t fully work for my use case because I will have long dialogs created in FlowXO so there will be no way to have ongoing discussions if the webhook can’t trigger a Message or Question in the middle of a flow.

Any thoughts/suggestions are appreciated!

(Mayank Sharma) #2

Hi @johnjackson

+1 for @Jason
even I tried studying how to integrate the custom built app with flow XO ,could you please help us with this.

Regards
mayank

(Karen Barker) #3

Hi Jason,

It might be best if you email this into support on support@flowxo.com. If you can provide a little more in depth information about what exactly you’re hoping to achieve here. What does your flow consist of? How have you embeded Flow XO into your mobile app? [quote=“Jason, post:1, topic:1901”]
This doesn’t fully work for my use case because I will have long dialogs created in FlowXO so there will be no way to have ongoing discussions if the webhook can’t trigger a Message or Question in the middle of a flow.
[/quote]

Can you expand any further on this or give a particular scenario of how you see things working?

(Karen Barker) #4

Hi Maynak,

To pass data in (or out of Flow XO), you have our Webhooks & HTTP service built in. These webhooks will give you a way of transferring information in and out of web apps through simple HTTP posts (usually containing data in some kind of structured format (JSON or form key/values).

In that instance, your servers can send a HTTP request to trigger a flow OR in a flow, you could post back information to your service.

(Jason Mattiace) #5

Hi Karen,

Expanding further: if I have a Flow with a long dialog, I need to continue the dialog by sending the questions to my mobile app (via my web server) and then receiving responses from the app (via my web server). I don’t see how this is possible with FlowXO.

Example: if I have a Flow with 5 questions asked by the bot, I could have a webhook trigger this flow. The first question could be sent to my web server via an HTTP request after the Flow is tiggered. But when my user replies to this question how can my web server send that information back to trigger question 2 in the Flow, and so on?

(Daniel Beckett) #6

@Jason

If you are able to POST back some kind of unique identifier for each question when you hit the webhook trigger in flow XO you could make use of Flow labels and Filters.

For example when you send your request to your trigger you include __?question=2 so that it is available in your Data Outputs. Each of your questions then has a label setup for the corresponding question number so that you can have GoTo label actions at the start of your flow with a filter for the question number.

The tutorial for Using Label and Goto a Label in Flow XO has some more information that you may find useful.

Out of interest, would it be feasible to use some kind of webview instead? The Web Messenger bot has a shortlink that the user could be passed to which may make all of this a lot easier since you could do the Q&A inside the bot and then pass everything back in a webhook at the end.

Thanks,
Dan

(Jason Mattiace) #7

Hey @DanielBeckett, thanks for the reply. This does make sense using labels, I will give it a try to see how it works. It seems like it will be a bit overkill though if I have to send a custom HTTP request after every single message my bot sends within a flow just to get that data to my server.

The Web Messenger would be perfect but we cannot integrate it within our iOS app since the UI is already built out. If FlowXO provided an api so that custom UI’s could act exactly as the Web Messenger does then that would be perfect for our needs :wink: