2

I want to test the google maps API so I can see the resources that the API have, i found the SoapUI REadyAPI, but I'm still confused. Is there a way to make this REST API calls (gets) from console so i can see the JSON of Google maps?

Thanks in advance

Rorriizz Gold
  • 25
  • 1
  • 5
  • Have you tried `curl` command line utility? – Raghwendra Singh Nov 17 '17 at 19:53
  • No i haven't, to be honest i don't even know what is that... Does it allow to make the gets calls from the API? – Rorriizz Gold Nov 17 '17 at 19:59
  • Since you've asked regarding sending these requests from console, this is the best available option. `CURL` utility comes with most linux OS, if it is not available to you then you can install it using (`yum install curl` on centos or `apt-get install curl` on ubuntu/debian. Also, if you are using windows then fear not, you can install git for windows and use git bash terminal which has many linux command line tools)e.g. `curl -k -L -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"your_payload_key": "your_payload_value", ...}' -X POST https://your.url.extn/request/path` – Raghwendra Singh Nov 19 '17 at 09:39

2 Answers2

1

I recommend creating a Collection in Postman called "Google APIs".

Within that collection, add a GET request called "Get Geocode JSON".

Add https://maps.googleapis.com/maps/api/geocode/json to the request url input.

Add three key-value pairs in the Params tab:

KEY VALUE
address 802/8 Brown Street, Chatswood 2067
components country:AU
key {{key}}

Of course, your address and components values will differ. I am using a variable {{key}} which I have defined within the Google APIs collection.

enter image description here

Finally, click the Send button and view the results in body of the results.

Postman also offers many automatically generated coding implementations for a variety of languages. Click the </> symbol on the right side of the application and select your preferred programming language.

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
0

chrome has an extension called rest client where you could test from and see the JSON response. You can also use postman to test. https://www.getpostman.com/ . Both will work very easily with google maps api.

NicoLA
  • 71
  • 8
  • Ok, so i install both to try, but how do i enter the URL so the JSON data can be displayed. I still have problems figuring out how to display the resource info from maps... Can you help me with that? – Rorriizz Gold Nov 18 '17 at 00:01
  • so enter the web API request url in the url textbox. next specify that the HTTP method is a GET then run it. you should return a json in the response body. If you return an error, follow the error and make adjustments until you get a 200 response – NicoLA Nov 18 '17 at 00:04
  • 1
    Oh ok, i understand now, i read the documentation and with your help everything is clearer. https://developers.google.com/maps/documentation/geocoding/start?hl=es-419 thanks a lot. – Rorriizz Gold Nov 18 '17 at 00:55