RESTful API - Search for person & company entities by phone number

Solved

I am trying to build an integration into Sage CRM which is require me to be able to search for both person and company records using a phone number. I can't see a clear way of doing this from the API reference. Can anyone advise how I would do this?

Parents Reply Children
  • 0 in reply to Sean from Spire

    Thanks Sean, I did find this and attempted to follow it. It has kind of worked, but creating the link seems to have having some issues. 

    With my test code I've created a single communication, but it appears twice in search (one with the company/person, and one without). Clicking into either of them, however, does not show that it is linked to a company or person, nor does it appear under the communications tab of those entities. 

    This is the data being sent with the API calls:

    Creating communication:
    {
    "comm_subject": "Test communication",
    "comm_note": "Phone call",
    "comm_organizer": 29
    }

    Creating Link:
    {
    "CmLi_Comm_UserId": 29,
    "CmLi_Comm_CommunicationId": 269087,
    "CmLi_Comm_PersonId": 116491,
    "CmLi_Comm_CompanyId": 85112
    }

  • 0 in reply to joshSWR

    Hi Joshswr

    We tried on our end and encountered the same issue. Additionally, when we edit one of the entries and save, it disappears, even though the links remain missing on the other. 

    Hoping someone can assist us both.

  • 0 in reply to SAMUEL MAIA

    Just looking at the comm_link table, it looks like the API call is creating two records in the table instead of one. One has the personid and companyid, and one doesn't. Unsure if there's anything that can be done about this or if it's a glitch in the API?

  • 0 in reply to joshSWR

    Morning Josh,
    I'll have to give it a test on my dev system. We've stopped using SData API a while back and developed our own for Sage CRM.
    What version of CRM are you running?

  • +1 in reply to joshSWR
    verified answer

    Hi  
    I can replicate this.
    The POST to the communication table also creates the comm_link record, but with no "CmLi_Comm_PersonId" or "CmLi_Comm_CompanyId" so no need to do another POST.

    Just grab the comm_link record id by

     

    https://baseurl/sdata/crmj/sagecrm2/-/comm_link?where=cmli_comm_communicationid eq ‘xxxx’

    And then PATCH

    https://baseurl/sdata/crmj/sagecrm2/-/comm_link('xxxx')

    with

    {
    "CmLi_Comm_UserId": 29,
    "CmLi_Comm_PersonId": 116491,
    "CmLi_Comm_CompanyId": 85112
    }

  • 0 in reply to Sean from Spire

    Hi  

    Many thanks for your help!

    I believe this was our last hurdle before going live with the integration. Fingers crossed!