3

I am working on sugarCRM, I need to get all the contacts from active opportunities. I can relate the contacts with Opportunities for single record using the below url

https://xxxxxxxx.trial.sugarcrm.eu/rest/v10/Opportunities/5ae1907a-9408-178f-87d6-523cc7d679b6/link/contacts

But I have to get he contacts details for all opportunities which is active. Can Anyone please help me.... Thanks in advance

Amitesh Kumar
  • 3,051
  • 1
  • 26
  • 42
Jagan
  • 590
  • 1
  • 8
  • 21

1 Answers1

3

you are going right , The url provide by:

https://xxxxxxxx.trial.sugarcrm.eu/rest/v10/Opportunities/5ae1907a-9408-178f-87d6-523cc7d679b6/link/contacts

It will give all record related to that Opportunities.

But you want All contacts of active Opportunities

  1. First you need to hit API for Opportunities which is active :

    https://xxxxxxxx.trial.sugarcrm.eu/rest/v10/Opportunities/filter[0][status][$in][]=active

Like this you can apply filter.

For more help check this link

2.Now after that you get array on Opportunities , so will use loop get get Opportunities id and hit your URL.

https://xxxxxxxx.trial.sugarcrm.eu/rest/v10/Opportunities/5ae1907a-9408-178f-87d6-523cc7d679b6/link/contacts

You can make Dynamic according to your need. I hope this will help you.

Amitesh Kumar
  • 3,051
  • 1
  • 26
  • 42