SugarCRM apis : how can i get module and related modules data in one request?

Hi all,

I am using REST APIs to retrieve data. I need to get Accounts and Contacts that having one or more active Contract or not lost Opportunities.

In my understanding, I have to call rest/v11/Contracts and rest/v11/Opportunities and loop them with rest/v11/Contracts/:record/link/accounts to get Account data and then rest/v11/Contracts/:record/link/contacts to get Contacts data.

I get errors from apis when I loop to get Accounts and Contacts data due to there are too many requests. So I am trying to find the way to reduce the request amount.


Do you have any suggestion?

Thank in advance