Help - API CONNECTOR - ARRAY - Just few lines, pls help!

Hello There Bubblers!

I’m using the API connector plugin. With a 3rd service, called AIRCALL

And succesfully did calls for retrieving user’s data. Also to create a user by passing single paramaeter data. But with no luck with the phone numbers.

So, I did just as said in the documentation API References | Aircall

And I pasted the JSON call just to see if it works before doing the dynamic values

{
“id”: 789,
“direct_link”: “https://api.aircall.io/v1/contacts/789”,
“first_name”: “John”,
“last_name”: “Doe”,
“company_name”: “Acme”,
“information”: “”,
“is_shared”: “true”,
“phone_numbers”: [
{
“label”: “Work”,
“value”: “+33631000000”
}
],
“emails”: [
{
“label”: “Work”,
“value”: “john.doe@something.io
}
]
}

Surprisingly, no luck. It says

image

As edited by myself, I tried also with the dynamic values, don’t work neither

{
“id”: 789,
“direct_link”: “https://api.aircall.io/v1/contacts/789”,
“first_name”: " < first-name>",
“last_name”: “< last-name>”,
“company_name”: “< company-name>”,
“information”: “”,
“is_shared”: “true”,
“phone_numbers”: [
{
“label”: “user-phone-number”,
“value”: “< phone-number>”
}
],
“emails”: [
{
“label”: “user-email”,
“value”: “< user-email>”
}
]
}
//// there is a separation line between the < and the first character because if not it gets hidden in the post, not sure why

I’m not quite following… Are you saying it works but you are unable to save the phone number? Into bubbles database… Do you have it working in bubble? Does it work in postman

What is the call setup you are using? Could be something simple like POST instead of GET, or missing header

@Bubbleboy @mishav

Hello guys! thx for jumpin’ in!

noup… it’s set

And the thing is, if I do the call with regular parameters, It does create a contact, but doesn’t saves the phone number, because it’s an array.

And If I do it by the body

It gives me the error…

Aha, there’s nothing to tell their system that you are sending a JSON body … you need to add a header:
Content-Type: application/json

1 Like

When setting the dynamic value for the phone number, try :formatted as URL on it.

The “+” is probably the reason.

Yes, it’s the content-type header that’s missing.

A few gotchas the call me out when I started bubbling… that come to mind

as @reger-alexander mentioned… If you set the phone number to be a number and what comes back from your POST includes something that is not a number ‘+’ that could be the culprit… I actually had a situation yesterday where I was making an API call and the service was returning a number but also had , separating or indicating 'thousands… That caught me out

It could also be that you might be setting the phone number thing to be a single item and not a list… If that’s the case … Then you can try add ‘first item’ or changes to add a list if you are getting an array.

Couple of things that might help everyone diagnose for you is if you could do a screenshot of your ‘db thing’ you’re saving all this stuff to or at least highlight the phone number field

Solved by @mishav and the great coach @romanmg !!!

Feelin good to be part of this community!

Have a great Weekend!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.