Linking organisations to contacts using API

I'm unable to link my contacts to an organisation using the API v2.2

This was working fine last month, but when I tried to invoke the API request today it failed to do so. It is only linking the new organisations to the contact and not the ones which are already present in Insightly.

Have you guys changed anything in your API calls? Please help its urgent.

0

Comments

9 comments
  • Hi Ravneet,

    Could you please let us know what endpoints you are using? Did a bit of testing myself but could not reproduce the issue.

    I tried PUT to https://api.insight.ly/v2.2/contacts and POST to https://api.insight.ly/v2.2/contacts/{id}/links and both work as expected. 

    If you are using PUT https://api.insight.ly/v2.2/contacts you need to include all the links that are part of the contact object, if you leave out a link that is already saved it will be interpreted as a delete to that link. This has always been the behavior.

    Best Regards,

    Patrick

  • I tried both endpoint ie. PUT to https://api.insight.ly/v2.2/contacts and POST to https://api.insight.ly/v2.2/contacts/{id}/links but both failed to give the expected result.

    Eg. contact ravneet.testing@gmail.com is linked with organisation E3 for the moment. I am trying to update the contact to link with the organisation E1 which already exist in Insightly but it fails and still E3 is linked with the contact. But if I try to add a new organisation in Insightly and link that to the contact it works. Strange.

    In PUT https://api.insight.ly/v2.2/contacts I'm including all the links and only replacing the one with organisation E3. 

     

    Sample JSON for contact:-

    {"CONTACT_ID":180366206,"SALUTATION":null,"FIRST_NAME":"ravneet","LAST_NAME":"testing","BACKGROUND":null,"IMAGE_URL":null,"DEFAULT_LINKED_ORGANISATION":87384480,"OWNER_USER_ID":1171099,"DATE_CREATED_UTC":"2016-07-19 00:43:42","DATE_UPDATED_UTC":"2016-08-18 21:48:00","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[{"CUSTOM_FIELD_ID":"CONTACT_FIELD_1","FIELD_VALUE":"false"},{"CUSTOM_FIELD_ID":"CONTACT_FIELD_2","FIELD_VALUE":"false"}],"ADDRESSES":[],"CONTACTINFOS":[{"CONTACT_INFO_ID":308800606,"TYPE":"EMAIL","SUBTYPE":null,"LABEL":"WORK","DETAIL":"ravneet.testing@gmail.com"}],"DATES":[],"TAGS":[],"LINKS":[{"LINK_ID":117528215,"CONTACT_ID":180366206,"OPPORTUNITY_ID":null,"ORGANISATION_ID":87384480,"PROJECT_ID":null,"SECOND_PROJECT_ID":null,"SECOND_OPPORTUNITY_ID":null,"ROLE":"E3","DETAILS":null}],"CONTACTLINKS":[{"CONTACT_LINK_ID":16507996,"FIRST_CONTACT_ID":180366206,"SECOND_CONTACT_ID":180362939,"RELATIONSHIP_ID":1,"DETAILS":null}]}

     

    Sample JSON during update:-

    {"CONTACT_ID":180366206,"SALUTATION":null,"FIRST_NAME":"ravneet","LAST_NAME":"testing","BACKGROUND":null,"IMAGE_URL":null,"DEFAULT_LINKED_ORGANISATION":87384480,"OWNER_USER_ID":1171099,"DATE_CREATED_UTC":"2016-07-19 00:43:42","DATE_UPDATED_UTC":"2016-08-18 21:48:00","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[{"CUSTOM_FIELD_ID":"CONTACT_FIELD_1","FIELD_VALUE":false},{"CUSTOM_FIELD_ID":"CONTACT_FIELD_2","FIELD_VALUE":false}],"ADDRESSES":[],"CONTACTINFOS":[{"CONTACT_INFO_ID":308800606,"TYPE":"EMAIL","SUBTYPE":null,"LABEL":"WORK","DETAIL":"ravneet.testing@gmail.com"}],"DATES":[],"TAGS":[],"LINKS":[{"ORGANISATION_ID":87384089,"ROLE":"E1"}],"CONTACTLINKS":[{"CONTACT_LINK_ID":16507996,"FIRST_CONTACT_ID":180366206,"SECOND_CONTACT_ID":180362939,"RELATIONSHIP_ID":1,"DETAILS":null}]}

     

  • Strange things are happening. I don't know whether it is just me or others are also facing the same issues.

    I tried to do the above thing using the web application rather than API and I found that once you unlink the organisation from a contact you can not link the same organisation again anymore. And it also displays the result differently in the contact list section verses the actual contact. Below are the screenshots.

     

     

    You can see the first image shows two organisations linked E1 &E2 but when we click on the contact there is organisation E3 linked rather than E1 or E2.

    Can you explain why it is so?

  • Hi Ravneet,

    We were not able to reproduce the behavior in the UI that you are seeing but we found an issue with CONTACTLINKS that could prevent you from updating the objects in case the other part of the relationship has been deleted. We're investigating the issue at the moment and we'll post an update to this thread as soon as we have more information.

    Best Regards,

    Patrick

  • Hi Ravneet,

    We've released a fix to our API for the CONTACTLINKS issue described above. If you're still having issues please open up a support ticket with us so that we can take a closer look at your account.

    Best Regards,

    Patrick

  • CONTACTLINKS was not my issue. I'm not even using them. My issue is with linking organisation to contact.

    I created a "sample user" and linked it to the "Test organisation" with role "Test role". Then using API call PUT to https://api.insight.ly/v2.2/contacts
    I updated the organisation to "Organisation ABC" and it worked fine. Then back again I changed the organisation to "Test organisation" using the same API call and it failed and removed the previous "Organisation ABC" as well from the contact.
     
    Then I tried setting the "Test organisation" using the UI, but it also fails. This only happens once you try to set the old organisation using the API.
     
    I even have emailed you guys at support@insightly.com with some video links.
     
    I need an urgent solution as I have to update approximately two thousand records and I'm waiting for the solution since last week.

     
  • Hi Ravneet, 

    I just noticed that your sample request above included CONTACTLINKS so I wanted to point out that it may have been the cause for your failed request. Sounds like you're still having issues, let me follow up with support to see if they have the video.

    Best Regards,

    Patrick

     

  • Hi guys, I haven't received any solution yet. Can you please tell me till when it will be sorted out?

  • Hi Ravneet,

    Just replying here to confirm that this issue has been fixed. Thanks again for all your help in troubleshooting the issue!

    Best Regards,

    Patrick

Please sign in to leave a comment.