appnexus-client icon indicating copy to clipboard operation
appnexus-client copied to clipboard

inventory-list-items nested into inventory-lists

Open Samuel29 opened this issue 4 years ago • 3 comments

Hi. I've just forked the repository to add some missing services, but I'm not familiar with Thingy. I'm especially interested in implementing the inventory-list and its nested inventory-list-items (cf doc here and there) so far, I've added the support for InventoryList. But I'm not sure about the way to fetch its children objects.

GET/POST /inventory-list/<ID>/item interacts with the list of items GET/POST /inventory-list/<ID>/item/<ITEM-ID> interacts with a single item

Could you provide some guidance?

Samuel29 avatar Mar 29 '21 14:03 Samuel29

Hey there, glad to see someone from AppNexus playing with this project. :)

What's the Python API you'd expect? Something in these lines?

inventory_list = InventoryList.find_one()
print(inventory_list.items[0])

If so, you'd just have to add an InventoryList(Model) class inside models.py that defines an items property.

ramnes avatar Mar 29 '21 15:03 ramnes

Hello. Thanks for pointing that out, I'm realizing that my profile was outdated. I'm a former Appnexus folk. now I'm using the platform as a client :-)

Your proposal seems so obvious... I've been trying more complex changes lol. I'll give it a shot. Thanks for your prompt answer!

Samuel29 avatar Mar 31 '21 09:03 Samuel29

Hi,

Ramnes's snippet work but it's a read only solution, and maybe you'd like to query Items by Id and not getting the full inventory ?

We had the same issue with campaigns being now ALI/split, you should have a look on it: https://github.com/numberly/appnexus-client/pull/36

Also are inventory's item ids unique or are they just list indexes ?

Do not hesitate to PR changes you made.

rambobinator avatar Apr 02 '21 08:04 rambobinator