Dynamic Body Value in API Connector

Hey everybody, I am looking for some help when creating a post API using the bubble API connector. What I’m trying to accomplish is when a user logs in to our platform and loads a page, I would like a workflow to trigger an API that sends that users email address to an external endpoint. I have attempted to do this however while bubbles logs indicate pulling the correct email address via the server logs, on the other end the external endpoint indicates that it is only receiving our test value that was sent via the API connector. Can anyone provide any assistance? Thank you !!!



Hi @aflowers !

Perhaps the current user does not have an account in the system so the api call sends with its default value which is “test”.

Suggestion: On the event (page is loaded) add a condition “current user is logged in”. This way this only runs for logged-in users (which logically would not have been able to log in without an email address).

Hi @aflowers ,

The call in the screenshot is not the one you are using or it’s an old screenshot as you have ‘Use as Data’ and you’re using an ‘Action’. Or maybe you created it as an Action and then changed it to Data. So first thing is to change it to ‘Use as Action’.

Besides that, add the following header to your call:

  • Key: Content-Type
  • Value: application/json

I hope it helps!


Follow me on twitter

hi

I have the following parameter for dynamic values

{“customer”: {
“name”: ,
“last_name”: <last_name>,
“email”: ,
“phone_number”: <phone_number>,
“creation_date”: "<creation_date>,
“external_id”: <external_id>,
} }

I get this error:

There was an issue setting up your call.
undefined error: this body could not be parsed as JSON {“customer”: {
“name”: null,
“last_name”: null,
“email”: null,
“phone_number”: null,
“creation_date”: "null,
“external_id”: null,
} }

What am I doing wrong

Please can someone help me to solve this error?

Thanks for the support
regards
Jorge

Run your JSON through a formatter tool and correct the issues: