I need to make a list of all the “Assets” in a given project. I know the project Id is 190. I have figured out that this request will get me the project’s information: {{host}}/api/v1/entity/:entity/:record_id?fields=*
But in the data that returns, I don’t see information for the Assets that have been created within that project.
How can I create a request that will give me all of the “Assets” within a given project?
Thanks @Ben_xzj. Unfortunately I’ve been through that documentation fairly thoroughly and though there’s a lot of information there, it doesn’t describe how to actually build the queries and the examples given don’t actually show examples of how to build the request either. Which means I’m still stuck.
The tool I’m writing is in C#. It needs to interface with Shotgun to pull down basic data; List of projects, filtered; list of assets in that project; for a selected asset, list of tasks associated with it.
I’ve been trying to use Postman to help me construct the queries (and then spit out C# code that I can copy/modify). The problem is that for the C# code it is building the URL looking query structure (as displayed in Postman), but I have no recourse but “trial and error” to figure out what magic incantation to put in some of the text boxes (“filter” most specifically). I’ve tried many different things, and all have been wrong (and complained about by Postman). Without real-life examples to look at for what the URL looking query is supposed to look like I can’t figure it out.
Here’s an example:
Loney sent me this snippet as a way to filter based on the project ID:
/api/v1/entity/assets?filter[project.Project.id]=190&fields=*&’
I’ve tried putting in many different versions of that filter specification into the “filter” key in Postman so I can get the code. They all fail with “filter must be a hash”. I can’t figure out what formatting that means.
I see that in constructing the query it is adding a “=” between “filter” and the filter syntax. I’m guessing that might be the problem, but it’s a total guess and I have no idea how to make Postman create it correctly.
My only other recourse is to try to use IronPython within C# to use the Python API, but that’s proving to be rather difficult as well. And I need to get this tool up and running ASAP.
Michael Rich VES, MFA
Computer Graphics Supervisor, Lighting Supervisor
Future House Studios
I just figured it out. The parameters have to be declared like this in Postman. (I was trying to put the full ‘[project.Project.id]=190’ in the Value field.)