Alright so here is the situation. I am setting up a system that will allow me to push all my new user signups to my Wix CRM. To do this i set up a HTTP Function within the backend system of my Wix account.
I believe that this is setup correctly and working as intended. I need the contact to only be created if there is a first name, last name, and email. the phone number can be optional.
the POST web address should be correct, (i just dont know if i should keep it hidden or not so i marked it out, same with the test info in the key values).
When i try to initialize the call this is the response i get
I think the problem is that how i have the JSON body written in bubble is wrong. Iâm not sure how to set up the array properly from that side to send it in the request. Any thoughts would be much appreciated.
I believe your JS is building an array, but not parsing an array. It seems to be looking for field âemailâ directly in the JSON body (line 41), just like the firstName and lastName and not an array of âemailsâ.
It is then taking that field and putting it as the only element in an array to pass forward.
If you always have only one email, simply change the bubble call to pass it ...lastName>", "email":"<email>"}
If you truly need to support an array on bubble side too, change the JS to read the array in a loop and pass to the new array.
So that did help, Iâm not sure if that change was actually needed but it did prompt me to fix my {}'s which were wrong. once i updated them it finally initialized! so thank you! for anyone in the future wondering how to set up the JSON Body correctly within bubble, here is how i did it.
I will try to add in the array and see if it still works and i will also be adding in the phone number to see if i can get it to send as well and then i will upload that photo so people know how to set up this system.