Hi, I want to fetch a contact's opportunity id using APIs. Is there any way I can get opportunity id if I have the contact id? I need to update the opportunity but I only have the contact id. So if I can get the opportunity Id I can update the opportunity.
If there is a way kindly let me know what endpoint should I use and hit to get the opportunity Id?
I am using a 3rd party tool to make requests. My end goal is to update the opportunity when I update a contact. So at the moment of contact update I won't have the opportunity ID, to get that I would need make another request to get all opportunity IDs of that contact and then update them. I would prefer to use the api's listed in documentation. Is it possible in any of those APIs?
if you have the contact id, you should also have the contact no. or get this value easily.
You can then filter the get command of opportunities by leaving out the opportunity id and providing the Filter Parameter like this:
GET https://{businesscentralPrefix}/api/v2.0/companies({id})/opportunities?$filter=contactNumber eq 'CT200116'
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.