创建新话题
已回答

Rest API: Get all subitems with full information of an item

Is it possible to get all subitems of a single item? If we take a look at the image below, if I know the handle of Item A, I would like to get a full list of all subitems. For each subitem I would like the same information as if I did a separate /restapi/items/{handle} call to each of the subitems. If I look at the /restapi/items call I can't find a parameter e.g. parentitem (handle to parent == Item A).





最佳答案

Hi Peder, 


In general when we discuss a tree like this in SystemWeaver, we are talking about items and parts. So, I assume that you would like to get all parts and items in a tree with the item you ask for on the top. There is no handle to parent since many parts can point to the same item. Instead, the part knows which item it is pointing to. When you have the whole tree, you automatically know which part is pointing to which item. 


If I understand your need correctly, then you would want to do one of the following restAPI calls (x04000000000000CA is just an example) :


http://server:port/restapi/items/x04000000000000CA/tree 

OR 

http://server:port/restapi/items/x04000000000000CA/tree/full


'full' gives you all information of parts and items, but also needs higher bandwidth since it has more data.


I hope this information is helpful. 


SystemWeaver Support


回答

Hi Peder, 


In general when we discuss a tree like this in SystemWeaver, we are talking about items and parts. So, I assume that you would like to get all parts and items in a tree with the item you ask for on the top. There is no handle to parent since many parts can point to the same item. Instead, the part knows which item it is pointing to. When you have the whole tree, you automatically know which part is pointing to which item. 


If I understand your need correctly, then you would want to do one of the following restAPI calls (x04000000000000CA is just an example) :


http://server:port/restapi/items/x04000000000000CA/tree 

OR 

http://server:port/restapi/items/x04000000000000CA/tree/full


'full' gives you all information of parts and items, but also needs higher bandwidth since it has more data.


I hope this information is helpful. 


SystemWeaver Support

Hi


The /full version of tree or list was what I needed. Thanks!

登录 发表评论