You can capture the public IP of the user and find a location in the ipinfo.io (50k requests/month), for example, request: https://ipinfo.io/183.37.69.4/json.
With this information, you can use opencagedata.com ( 2,500 requests/day free), request example:
https://api.opencagedata.com/geocode/v1/json?q={latitude}%2C{longitude}&key={api_key}'.
The better option is to pay for a solution. I prefer... the coast is small and you don't will problem changes.
Att,
------------------------------
Breno Canyggia Ferreira Marreco
https://www.linkedin.com/in/brenocfm-40b62182/------------------------------
Original Message:
Sent: 06-19-2024 18:19
From: Joseph Allen
Subject: Digital chatbot: Get user's time zone for voice callback
Hey all,
Working on a simple digital bot flow to greet people on our website and setup voice callbacks with them.
The one issue I'm running into is thinking of the least painful way to figure out what time zone they are in to correctly set the time for a callback. I'm thinking of asking for their zipcode, but then there is not easy out of the box way to use that to offset the time they have chosen.
I would either have to pay for an API to do a lookup, or build a very complex expression using regex to compare the zipcode to a range of codes that are in a state, then use that to make the UTC offset. Additionally, I'd need to make a date lookup to see if it's DST or not. Very painful.
Would love some ideas or examples!
#ConversationalAI(Bots,AgentAssist,etc.)
------------------------------
Joseph Allen
Strive Health
------------------------------