Need help with an API call

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
User avatar
SteveMann
 
 
Posts: 71
Joined: Tue Jun 17, 2008 4:54 am

Need help with an API call

Post 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?
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Need help with an API call

Post by wwonderfull »

Do you have any demo project of what you are trying to achieve using wwb?
User avatar
mfirlotte
 
 
Posts: 150
Joined: Tue May 12, 2020 5:09 pm
Location: Quebec, Canada

Re: Need help with an API call

Post 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.
====
Mitch
====
User avatar
SteveMann
 
 
Posts: 71
Joined: Tue Jun 17, 2008 4:54 am

Re: Need help with an API call

Post by SteveMann »

Thanks- float fixed the issue.
Post Reply