Fetch Schema

Hello Guys,

I’m using an Australian API, to find business’s entity name using “ABN number”.
When I fetch the schema on the Server Connect, I have this:

When I remove the word “Callback” and the parenthesis on the Wappler API Schema Editor, the scheme is fetched. Is there a way to remove automatically this word and parenthesis?

Thanks!

Once you fetch the schema you are good to go and can use the fields/data for whatever. A lot of the time I am using dynamic data in the API call, so I can’t request the API data with the variables, they have to be actual data. So just fetch with test data and you are good to go.

1 Like

Thanks Baub! But when I fetch the data without removing the “callback” word in the beginning of the response, the schema is not fetched…I can’t even select the fields on front end!

Hey Otavio,

You are providing a manual source, rather than fetching automatically, so you need to provide a valid json object. In your case, it would be correct to remove the callback and the parenthesis (as well as anything at the end of the json that might be there.)

1 Like

Thanks Ken! But how to remove? LOL

I’m confused…it is just text, remove what is not needed.

Ken, I removed them on server connect and the data and schema are feteched, but on front end, inpecting on Chrome, the word “callback” is still on response…when I select the field I need from the response, to set as an input value, nothing is returned, I’m assuming that the value is not been showed due to this “callback” word and the parenthesis…am I right?

Are you sure this api is returning json? Have you tried to troubleshoot using Postman?

1 Like

I’ll try using postman!
Here an example of this call:

https://abr.business.gov.au/json/

Anyone? I’m stuck with this! :frowning:

If you DM the access ID to me I’ll have a go at it.

Okay, this isn’t going to work the way most modern api’s work. It is really a web services (xml) api, and they have bolted on a “json” option. It will always return the callback function, not JSON. So you need a javascript function with the same name as the callback query parameter in order to process the response and do something with the values contained within.

The page you provided has an example of this – you could download the .js files they use, and use those functions as a starting place.

It’s all doable, but it is javascript exercise, not Wappler.