Forum Academy Marketplace Showcase Pricing Features

Abr.business.gov.au

Hi community,
This post is about troubles with Australian Business Register. Once there are was conversation here, but as I understood without happy end: Help with setting up API for a non-coder

I am trying to crack this nut myself and need help.

So here is their jason JSON Services

My key (guid) is

b8e045a0-0cf9-4795-bef0-5bb3b25c70bd

(I know I shouldn’t share it, but I will ask ABR to reissue it)
My example call: https://abr.business.gov.au/json/MatchingNames.aspx?name=smsf&maxResults=1&callback=callback&guid=b8e045a0-0cf9-4795-bef0-5bb3b25c70bd

The problem is that Bubble API Connector doesn’t want to initialize api call.
It returns:

There was an issue setting up your call.
undefined error: this header name is not correct undefined

I tried many things:

(1) TEXT type instead of JASON + manually initialize:

callback({“Message”:"",“Names”:[{“Abn”:“91156549754”,“AbnStatus”:“0000000001”,“IsCurrent”:true,“Name”:"#SMSF",“NameType”:“Business Name”,“Postcode”:“4078”,“Score”:100,“State”:“QLD”}]})

///// But without word “callback” and starting and ending brackets.///////

After manual initialization it looks like it accepts, but I can’t build any logic on the app anyway.
It returns this:

Error parsing data from Apiconnector2: [],callback({“Message”:“There was a problem completing your request.”,“Names”:[]})

(2) I played around adding head parameters: Content-Type = application/jsonp (as was discussed in the other forum thread)

(3) I chose “Attempt to make the call from the browser” and many other stupid things which didn’t work anyway :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob: :sob:

Answer found! Thanks to Bubule support:

“The response type here is a piece of text - it’s a Javascript function call to a named “callback” passing in the JSON object as a response. This means that: yes, you can initialize as text, then do some parsing with Regex - but we won’t recognize the keys as JSON keys, because it’s not JSON, it’s pure text.”

RESUME: When API response is a plain text (but not JSON), use REGEX. Watch useful manual about Regex in Bubble at: How to use regex in bubble Part 1 - YouTube and part2 here How to use regex in bubble Part 2 - YouTube

2 Likes