Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

How to search a call "FROM" and call "TO" contacts in Phonecall record based on entity's Phone number

(0) ShareShare
ReportReport
Posted on by

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.

  • venkatsr Profile Picture
    User Group Leader on at
    RE: How to search a call "FROM" and call "TO" contacts in Phonecall record based on entity's Phone number

    Instead of 2 webapi calls, we can look for expand attribute in webapi

  • Pankaj Gogoi Profile Picture
    3,177 on at
    RE: How to search a call "FROM" and call "TO" contacts in Phonecall record based on entity's Phone number

    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

    https://yourorg.crm.dynamics.com/api/data/v9.1/phonecalls/?$expand=phonecall_activity_parties($filter=_partyid_value eq '25A17064-1AE7-E611-80F4-E0071B661F01')

    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

      
            
        
        
        
          
            
              
            
          
        
      
    

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/retrieve-and-execute-predefined-queries#use-custom-fetchxml

    You can use the FetchXmlBuilder to generate oData queries from FetchXML

    pastedimage1597094306442v1.png

    Hope this helps

    Best Regards

    PG

  • Community Member Profile Picture
    on at
    RE: How to search a call "FROM" and call "TO" contacts in Phonecall record based on entity's Phone number

    Pankaj G

    shall we do it in single API?

  • Pankaj Gogoi Profile Picture
    3,177 on at
    RE: How to search a call "FROM" and call "TO" contacts in Phonecall record based on entity's Phone number

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans