Forum Discussion
Stuart_Weenig
25 days agoLegend
This should be getting better soon as websites are slated to be moved to the resources page "soon" and would be treated like any other object there.
As for getting the list under a group, you just need the group id then make a call to the api to get the list. Use the SDK and lmwrapper for this.
websites = lm.get_website_list(size=1000, filter="groupId:74").items
Where 74 is the id of the group in question.
- Kelemvor25 days agoExpert
That only works for the immediate group. I need subgroups included as well. Since websites don't contain the FullPath field like resources do, I don't think there is any way to do this.
- Stuart_Weenig25 days agoLegend
Yeah, you'd just have to loop through all groups:
website_groups = lm.get_website_group_list(size=1000).items for group in website_groups: websites = lm.get_website_list(size=1000, filter=f"groupId:{group.id}").items print(f"{group.full_path}: {','.join([x.name for x in websites])}")
- Stuart_Weenig25 days agoLegend
One liner if you play code golf:
for group in lm.get_website_group_list(size=1000).items: print(f"{group.full_path}: {','.join([x.name for x in lm.get_website_list(size=1000, filter=f'groupId:{group.id}').items])}")
Related Content
- 9 months agoMark_Hensler
- 10 months agoTim_OShea
- 13 days agoName_ToLong