Page 1 of 1

Need help with an API call

Posted: Sun Jul 07, 2024 8:00 pm
by SteveMann
Yes, it's been a long time since I was here.. But I hope someone may be able to offer guidance.

I have a project that is making a call to api.geoapify.com (a free for low volume users geocode service). I send it a latitude, longitude and my API key and it returns the geocode data for that LAT and LON in JSON.

https://api.geoapify.com/v1/geocode/rev ... 511b446ae2
(I've obfuscated the API key and location)

When I type in my home latitude and longitude, the return data is complete and easy to work with in my program.
But when I send it data using a variable for the LAT and LON, I get an error:

Code: Select all

{"statusCode":400,"error":"Bad Request","message":"\"lat\" must be a number"} 
Here's where WWB comes into the equation...
I am completely baffled why the API thinks the latitude is not a number.
Could I write a page on my website that simulates the API call so that I may examine what may be in the numbers passed to the real API?

Re: Need help with an API call

Posted: Mon Jul 08, 2024 4:43 am
by wwonderfull
Do you have any demo project of what you are trying to achieve using wwb?

Re: Need help with an API call

Posted: Mon Jul 08, 2024 3:57 pm
by mfirlotte
Just a thought...I may be way off base here.

Something similar happened to me once before when I provided a float value (ie; 27.45) when it wanted a number, an integer (27). So I would either round up or round down before submitting.

Re: Need help with an API call

Posted: Mon Jul 08, 2024 9:35 pm
by SteveMann
Thanks- float fixed the issue.