Forum Academy Marketplace Showcase Pricing Features

Set up Bubble API with OpenCNAM + EveryoneAPI

Now that I have incoming phone numbers in my database I’m trying to look up the name of the caller and address. There’s an API service call OpenCNAM for this. I send them a number, they return name, address, etc.

Here’s the type of authentication they have

What type would this be with bubble API connector?

For anyone that wants to use this. It’s HTTP Authentication:

So, I figured out the authentication, but can’t figure out the rest of the API configuration.

All of the data seems to be here in and is very clear, I’m just such a newbie I’m not sure:

I can’t figure out:

  1. What the URL should be for the GET request?
  2. If I need to add a parameter and what it should be?
  3. If I need to add a header and what it should be?

The main problem is that I’m not sure how to read API documentation well enough to understand what to do. Any help would be great :slight_smile:

Your going to want to make a call to (with parameters)[NUMBER]?account_sid=[SID]&auth_token=[TOKEN]

A good way to test APIs before going into Bubble is using Postman.

@codurly Thanks. So, my guess is way more basic. What the HTTP request needs to say makes sense to make. What I’m unsure of is…what exactly do I need to put into the bubble API connector for the URL (next to the GET button), headers? parameters?

For example, the [NUMBER] is going to be dynamic, so I’m going to set this up in the bubble workflows when I use them, but how do I set up this dynamically in the API connector?

Copy and paste exactly what I put in the laste post into the API connector. Bubble will automatically make the [] parameters.

Ok, I copied and pasted and it did fill out the parameter but I ran into another problem.

I didn’t fill out the “number” because I thought this would be dynamically inserted somehow and how this error.

I then put in my number into the field +15162536232

Here was the response

It looks like I need to change the API URL to say that I to specify that want JSON as a return value?

Here’s the editor page:

Looks like I need to try this?[NUMBER]?format=json

Bo ya! It worked! Ahh, if I only knew why it worked :wink: haha

However, I’m still unsure how I would dynamically insert numbers from my database into the NUMBER value. If I remove the number I put in, it won’t work any longer.

Any idea?

The reason you need the extra bit of code is because Bubble only reads it in JSON not XML.

To dynamically insert data you need to create a workflow where you:
Get data from an external API

That makes sense.

I don’t see any option to get data from an external API.

I’m trying to build this into an API workflow when an existing call comes in. Here’s the editor page:

The calls comes in from Zapier, it creates a new call.

I then want that phone number to look up the CNAM.

However, when I select plugins and the OpenCNAM API, it doesn’t give me any ability to pay in a number.

I feel like I’m missing something very basic here but am just unsure what it is.

Set your API call type to “Data”

When you want to check the number do:
do a search for: get data from an external API> penCAMN then enter parameters.

If your API is an action it will not work as you intend.

The “Action” API type is more for posting data and information, not receiving.

Ok. I change the API to data.

However, I don’t have the option to “do a search for: get data from an external API> penCAMN then enter parameters.”

I can set a variable to equal to API return value I want, but it’s not clear to me if I’m sending the API a dynamic phone number to return the name that I want.

Here’s all I could figure out how to set up

1 Like

Ahh I found the problem, on the API make sure NUMBER is not private. Then you should be able to edit that parameter.

What exactly are you trying to do with this API, get results of a number correct?

Ahh yes. That should work.

Yes, I pass OpenCNAM a number. It should return the “Name” associated with that one call. It’s basically a Caller ID app!

Got it, once you have the parameter to work then your data entry looks all good.

My apologies with the “Do a search for” advice, I wasnt quite sure what the API was for.

You should be ready to go!

Awesome. Thanks.

Can you explain why the “phone number” should be written [NUMBER] in the api? Is this what it allows it to be dynamic?

Any advice for the URL for this API?

I’m try to send it a number and return name and address.

Here’s the URL I used:[Number]?data=name, address

I used the same HTTP basic authentication by putting the SID and token as the username and password, but the same URL hasn’t worked yet.

Huh. I just tried this:[number]?data=name,address&account_sid=[sid]&auth_token=[token]&pretty=true

Which is a copy and paste from their documentation. No luck. Any thoughts on this one?

They seem very similar.