Hi there! In REST API I don’t see a way to view all products or if I have a folder that I know has a product as its child, I don’t know how to get that product’s ID. Is that possible?
Hi @mariosbikos-catches - could you describe what you have tried do currently? E.g. share an example snippet?
- You should just be able to query for all products under a folder path or folder id.
- The product ID should just be available on the product entity as
id
?
hi there. What is the REST API to get all products under a folder ID? I only see in docs how to get a product using a given product ID but nothing about getting all products. https://ayon.ynput.io/api#tag/Products/operation/get_product
Ah I see. In the ayon_api
the get_products
is done through a GraphQL query it seems.
I’m not sure what the REST API equivalent is. @martin.wacker is there any?
Generally, we don’t support listing entities via REST endpoints as GraphQL is more flexible, and having a separate REST interface would mean a lot of code duplication. GraphQL is the way to go in this case.
There are exceptions - for example, listing projects and ALL folders in the project hierarchy is implemented also in REST but in this case, the endpoints are heavily optimized for the frontend usage.
For completeness, here’s how to get all products using GraphQL Explorer on AYON server.