Forum Academy Marketplace Showcase Pricing Features

Struggling with API Calls (Making them dynamic)

Hi Guys,

When i call the below on hurl.it:

I get this response:

Whereby the only information pulled in the call is associated with the ‘Locate ID’ VPDKYM.

How can i get the API connector to allow me to have it so that address information is pulled when associated with a user inputted ‘Locate ID’

I have tried the below but it doesn’t seem to filter the data and try to pull every address from the database regardless of its ‘Locate ID’

Thanks,

Joe

Looks like the URL you’re using in cURL is different from the one in bubble api connector.
The constraints part is missing isnt it ?

Just copy the exact same thing and put [ ] around the locateid, text contains, VPDKYM
This will give you 3 parameters (instead of only the locateid you’ve got now in the api connector)

1 Like

Hi,

Sorry im a little confused. So the URL should look like this?

http://locate.world/api/1.0/obj/address?constraints={“key”:"[locateid]",“constraint_type”:"[text contains]", “value”:"[VPDKYM]"}]

If i use this how do the contraints work when i try and make the Locate ID be the ID entered by the user

Joe

Can you share a link to the editor ? That would be faster

1 Like

link here

@closej402880 that link doesnt seem to work

1 Like

How about now?
link here

I haven’t shared a link to the editor before.

Joe

The url in that editor now looks correct
It doesn’t let me save the changes but here’s how it should look

1 Like

HI,

Thanks for the help. Unfortunately however even with those setting as you can see from below its still pulling all of the address date. Rather than just the one address associated with that ‘Locate ID’. 658 results rather than just the one found on hurl.it

do u have a link to the api reference documentation for this (the locate.world) api

1 Like

Its a work in progress but here you go:

Thanks again.

Joe

Here’s the issue:

your api documentation says URL should be:
http://locate.world/api/1.0/obj/address?constraints=[{“key”:“locateid”,“constraint_type”:“text contains”, “value”:“VPDKYM”}]

the URL in your api call is (there’s a pair of [] missing):
http://locate.world/api/1.0/obj/address?constraints={“key”:"[locateid]",“constraint_type”:"[text contains]", “value”:"[VPDKYM]"}

If i put the full URL in like this: http://locate.world/api/1.0/obj/address?constraints=[{“key”:"[locateid]",“constraint_type”:"[text contains]", “value”:"[VPDKYM]"}] - im assuming the missing [ and ] are the ones before key and at the end of the URL.

Then bubble flags up an error and doesn’t recognize the locateid URL parameter.

Im a little confused as to why Hurl.it can understand the URL but Bubble cant.

Thanks,

Joe

any ideas @emmanuel

It appears that if i put the full constraint in [] like advised in the bubble API documentation ( then the API connector automatically sees the whole thing as a parameter and throws up an error when i try to modify call types.

http://locate.world/api/1.0/obj/address?constraints=[{“key”:“locateid”,“constraint_type”:“text contains”, “value”:“VPDKYM”}]

Above is the URL that works in hurl.it but not the bubble API Connector

ok well i managed to get half way there by putting the constraints all as one parameter as below and this returned the one result:

I just need help now on how to make the VPDKYM in the below image, come from a user input rather than me hard coding it in.

Thanks,

Joe

Its actually not difficult. I just got it working. Here’s how to do it:
Just break the stuff after ? into 3 strings as shown and set them in the keys
Then you can initialize (I checked; it sends only 1 record). And uncheck the private from key no. 2 to use it in your app.

2 Likes

Sorry for the late response.

Top Man… Thanks so much…

Works wonders.

Thanks,

Joe

1 Like