Dynamic JSON for POST API

Hi folks.
I’m faced with what feels like a massive task to create a target JSON structure for a POST API call which books a flight:

I believe that the rough steps would be:

  1. To prepare the data in the bubbleDB
  2. Generate JSON code via concatenation
  3. Post that JSON code

But the challenge is the complexity of the target structure:

To illustrate:
1 flight offer to n itineraries.
1 itinerary to n segments.
1 departure per segment, 3 attributes to each departure
1 arrival per segment, 3 attributes to each arrival
1 aircraft per segment, 1 aircraft code per aircraft
… and much more…

I need some help with design principles here… has anyone tackled anything of this nature?

@mishav - I am pretty sure that your awesome Toolbox plugin is the way forward, but are you able to give me an idea of how best to structure the bubble data pre generating JSON?

1 Like

Hi Andrew! Facing something similar. Did you ever find a solution? Thanks!


1 Like

Did anyone found a solution?

1 Like

Would recommend one of the JSON plugins for complex sending.