How to replicate the user groups rest endpoint using the sripted API

Hello! I am wondering which parameters I need to pass to replicate what is returned using the List Group REST Endpoint (Same as what shows on a user's profile under the groups tab) but using the https://community.telligent.com/community/11/w/api-documentation/65699/core_5f00_v2_5f00_group-script-api#List ? Currently I get many more groups returned (using the group-script-api) than what I get for the same user using the REST API. I am using the following parameters:

var groups = core_v2_group.List({username:username, IncludeAllSubGroups: false });

Thanks for any help!

Jez



Added extra context as to the data I'm looking to be returned
[edited by: Jez Bayliss at 1:46 PM (GMT 0) on Fri, Jul 12 2024]