How to get latitude and longitude using address from google geocode API in Configigure.IT API stream

How to get latitude and longitude values ​​using the address below the geocoding API inside the Configure.IT API stream.

https://maps.googleapis.com/maps/api/geocode/json?address=XXXXX&key=XXXXX

In the flowchart below, before inserting client data, I need to get the lat and lng values ​​and save these values ​​in the clients table.

enter image description here

+7
php mysql codeigniter google-maps
source share
2 answers

ConfigureIT provides an API Connector block for connecting to external data sources and fetching data. You need to insert the API Connector block before the INSERT_CUSTOMER_DATA block.

Follow the steps below and sample screenshots: -

1) Add an input parameter to supply the address.

enter image description here

2) Save the changes and in the next step, double-click the Context API block to add it to your API configuration scheme.

enter image description here

3) In the API interface block configuration dialog box, select Custom for API Type

enter image description here

4) And then enter https://maps.googleapis.com/maps/api/geocode/json in the API URL field and in the input parameters section add both the input parameter, the address and bind it to the input of the API input code (added in step 1), and then click Save and then to go to the next step.

enter image description here

5) Now you need to configure the output of the API. Enter the test input, and then to get the full result from the google api as a result, select the Current format and for a specific part of the answer select Specific result

enter image description here

6) Save all your API changes and then Run to check the result

enter image description here

Hope this helps.

+8
source share

https://maps.googleapis.com/maps/api/geocode/json?address= & key = You need to transfer the Google service API key to the above URL, after which you will get the result in json format:

{ "results" : [ { "address_components" : [ { "long_name" : "Mumbai", "short_name" : "Mumbai", "types" : [ "locality", "political" ] }, { "long_name" : "Maharashtra", "short_name" : "MH", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "India", "short_name" : "IN", "types" : [ "country", "political" ] }, { "long_name" : "400093", "short_name" : "400093", "types" : [ "postal_code" ] } ], "formatted_address" : "Udyog Sarathi, Mahakali Caves Road, Marol Industrial Area, Andheri East, Mumbai, Maharashtra 400093, India", "geometry" : { "location" : { "lat" : 19.1254233, "lng" : 72.8665118 }, "location_type" : "GEOMETRIC_CENTER", "viewport" : { "northeast" : { "lat" : 19.1267722802915, "lng" : 72.86786078029151 }, "southwest" : { "lat" : 19.1240743197085, "lng" : 72.8651628197085 } } }, "place_id" : "ChIJ02N9eyPI5zsRMEB_9ivO_B0", "types" : [ "establishment", "point_of_interest" ] } ], "status" : "OK" } 

The geometry contains the location in lat lon format.

+1
source share

All Articles