Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Get Opportunities of Contact using API

Posted on by 2
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?
Categories:
  • SeGra Profile Picture
    SeGra 44 on at
    Get Opportunities of Contact using API
    Hi,
     
    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'

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans