Facing issue with nested element parameter in API connector

@Jici So, your pointer about postman helped.

Actually there was nothing wrong in what I was trying as such.

Amazingly the spaces that I had given in before “name”, “email” etc. sub fields in the “customer” segment were not right. Either the number of spaces were not right, or it was expecting a tab there. Not sure.

Here’s the final thing that worked.

{
  "customer": {
    "name": "<name>",
    "email": "<email>",
    "contact": "<contact>"
  },
  "type": "link",
  "amount": "<amount>",
  "currency": "INR",
  "description": "Beegle Services",
  "callback_url": "<callback_url>",
  "callback_method": "get"
}

It is same as one of my previously tried versions, except for the spaces in the nested field.

It is absurd that spaces would make so much difference, and they won’t make it clear that it should be so.

How I found this out?

  • So, I pasted my version in postman and I got the same line_items missing error.
  • Then I thought let me try the version that they have given on the website. Interestingly it worked.
  • Initially I thought it could be presence of some extra parameters, or their sequence.
  • I tried to match everything, but nothing worked.
  • Then I did a diff of text of mine and theirs. Saw some spaces differences.
  • I started matching that too to make sure my text and theirs was similar. At last when I changed the spaces before the nested field’s names, the texts were identical and it worked!

So now I copied the text from postman to Bubble and changed the static fields to dynamic angular bracket thing and tried.

And it worked!

Weird, funny, and relieving!

Thanks for all your help.

2 Likes