Hello everyone,
We're experimenting with the API functionality and its OData query possibilities. We have a situation that we can't seem to get "right" though.
Let's consider the following situation:
Table "car"
Table "driver"
Table "car_driver"
Car_driver obviously is the linking table between car and driver. To query that, we need to "expand" the relation, as explained in the documentation.
So, we can do like this:
https://our-fabulous.thinkwise-app.net/indicium/iam/our-app-id/car?$expand=detail_ref_car_car_driver
to obtain the car and all ID's of the drivers, or
https://our-fabulous.thinkwise-app.net/indicium/iam/our-app-id/driver?$expand=detail_ref_driver_car_driver
to obtain a driver and all the car ID's he or she drives. Both queries can use an addition filter and other goodies.
So, how do we "expand" our data model, so that it gives a car with its drivers in one go, or all drivers with their cars in one go? We can expand one level, but not beyond that. What do we need to do, to hop over all three the tables in one go? Yes, we could call the API twice; call #1 for cars + driver ID's from the linking table, or drivers + car ID's from the linking table, and an additional call #2 to get the actual entities by their ID's. But somehow that doesn't seem like an elegant solution.
Any ideas?
Best regards,
-Alex.