Google maps locations API Help

(Tamer Khashman) #1

Hi,
Can any one show me how to connect Google maps API to get suggestions based on my location?
I need detailed info on how to do it, and how the flow looks like, I tried the existing location template in flow xo and gets users location, but I don’t know how to tell the bot to search for the nearest location and how to show it, Please Flow XO team I want a detailed tutorial how to, and I want to add the location button but always gets me an error on something called token which I don’t know.

Thanks in advance, knowing that we’re planning to start using Flow XO in a big scale with our company.

(Daniel Beckett) #2

@Tamer_Khashman

It sounds like you went to the right place already, the find location template shows exactly how to setup what you just described. :slight_smile:

The error that you mentioned is most likely from the action in the template called ‘Keep the settings all in one place’ - you’ll notice that the edit button is red which indicates that there’s a problem which needs fixing. In this case there are two things that you need to do:

  1. Get an API key from the Google Developers page and then copy it into the settings in your flow so that it replaces {{ MISSING OUTPUT }}
  2. Replace the ‘keyword’ with whatever it is you want to search for

In the above example you can see where the API key and keyword goes.

Hopefully that helps but if you’re still running into any problems please feel free to let me know. It may help to share any errors that you encounter from the interactions log for your flow. Feel free to email support@flowxo.com if it’s easier for you.

Thanks,
Dan

1 Like
(Augusto Vera) #3

Hello Daniel I managed to get the template working, but I need to embed the “find location” feature calling it from a selected button from a main menu in a bot. I tried to trigger it from the menu selected, but the template only works if a file is sent to the flow (location file it is) and the trigger flow from within another flow only sends a word. ¿can the location be sent in the middle of a bot flow not as a trigger?, or call the location template with a location file? (tried the second one attaching both flows to bot but it is not working.

(Daniel Beckett) #4

Hi Augusto,

You can use a custom request to send the user a location request button.

For Telegram the following request should work:
{
“chat_id”: “{{bot_new_message.channel_id}}”,
“text”: “Hello World”,
“reply_markup”: {
“keyboard”: [
[{
“text”: “Send Location”,
“request_location”: true
}]
]
}
}

Metadata
Method SendMessage

On Facebook Messenger it would be a custom request using the following:
{
“text”:“Please share your location:”,
“quick_replies”:[
{
“content_type”:“location”
}
]
}

(Jakub Straka) #5

Is there a different content served on the bot when different API used? Whether it is places, maps or directions API for example? Thanks for answer

(Karen Barker) #6

Hi Jakub,

Yes each of the Google maps API’s does return a slightly different set of data. You’ll be able to see what’s returned by looking in your interaction logs. :slight_smile:

(Govher Abbas Zade) #7

API key is not free? is it require paid for it?

(Daniel Beckett) #8

It’s based on Google’s API billing. Full details are on the following page:
https://developers.google.com/places/web-service/usage-and-billing

There’s a free tier for basic data.

(Govher Abbas Zade) #9

I want set branch adress is there any template

(Daniel Beckett) #10

Sorry, there’s no template for that. The best place to look would be the Google Places API documentation. :slight_smile:

(Govher Abbas Zade) #11

unfortunately İ cant set google location to my bot