Using an array object in the API connectors parameters

Hey everyone !

I am trying to use the Routific API, an API that allows to solve the Travelling Salesman problem (ie : attributes door-to-door meetings to salesmen).

Here is an exemple of the parameters I need to enter :
{
“name”: “Paris Delivery”,
“date”: “2023-04-10”,
“drivers”: [{
“name”: “Pierre Dupont”,
“start_location”: {
“address”: “1 rue de Rivoli, 75001 Paris, France”,
“coords”: {
“lat”: 48.859336,
“lng”: 2.341541
}
},
“end_location”: {
“address”: “1 rue de Rivoli, 75001 Paris, France”,
“coords”: {
“lat”: 48.859336,
“lng”: 2.341541
}
},
“shift_start”: “08:00”,
“shift_end”: “18:00”
},{
“name”: “Jeanne Martin”,
“start_location”: {
“address”: “10 rue des Archives, 75004 Paris, France”,
“coords”: {
“lat”: 48.857541,
“lng”: 2.355555
}
},
“end_location”: {
“address”: “10 rue des Archives, 75004 Paris, France”,
“coords”: {
“lat”: 48.857541,
“lng”: 2.355555
}
},
“shift_start”: “09:00”,
“shift_end”: “19:00”
}],
“stops”: [{
“name”: “Pauline Durand”,
“location”: {
“address”: “15 rue de la Roquette, 75011 Paris, France”,
“coords”: {
“lat”: 48.857405,
“lng”: 2.372616
}
},
“start”: “10:00”,
“end”: “11:00”,
“duration”: 20,
“types”: [“a”],
“load”: 1,
“priority”: true,
“email”: “pauline@durand.com”,
“notes”: “Sonner à l’interphone”,
“custom_notes”: {
“orderId”: “DEF456”
}
},{
“name”: “Alexandre Leclerc”,
“location”: {
“address”: “27 rue Saint-Maur, 75011 Paris, France”,
“coords”: {
“lat”: 48.865371,
“lng”: 2.381742
}
},
“start”: “13:00”,
“end”: “14:00”,
“duration”: 30,
“types”: [“b”],
“load”: 2,
“priority”: false,
“email”: “alexandre@leclerc.com”,
“notes”: “Appeler avant de livrer”,
“custom_notes”: {
“orderId”: “GHI789”
}
}]
}

As you see, “Drivers” and “stops” both requires an array of parameters. Can I create a list of parameters inside a parameter in Bubble ?

Second, I can’t predict the number of drivers & stops. How Bubble can handle this ?

Thank you so much for your help, I really need you on this one :sweat_smile:

yes, you can, I did the same with ElasticRoute, to get an optimized route.

just make a parameter, in api body, and when you call it put a list of items and format them as text. do mind the Jason format though?

DO tag me if you get stuck.