Announcements
Hi Experts,
Our requirement is to search a Search call "FROM" and call "TO" contacts in Phonecall record based on Contact's Phone Number using web API.
Could anyone confirm is it possible ? If yes,share us the web api for this.
Instead of 2 webapi calls, we can look for expand attribute in webapi
Hi Kiruthigarani,
You have to first fetch the contact Id filter by the Contact's Phone number using the below query.
https://yourorg.crm.dynamics.com/api/data/v9.1/contacts/?$filter=telephone1 eq '123456789'
After that use the below query
If a Phone Call activity has From and To as Contacts, the phonecall-activity_parties will retrieve the records.
You can also use the below fetch XML and pass it to the Web API
You can use the FetchXmlBuilder to generate oData queries from FetchXML
Hope this helps
Best Regards
PG
shall we do it in single API?
Hi Kiruthigarani,
Both From and To are Party List type, you can use $expand. Once you get the party Id you can search in contacts. Below for reference.
https://[yourorg].crm8.dynamics.com/api/data/v9.1/phonecalls/?$expand=phonecall_activity_parties
Hope this helps
Best Regards
PG
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator