Link between Opportunities and Tasks

Hello,

 

I am using Qlik Sense with the API to retrieve data from Insightly.

For the opportunities I download all data which is available via: https://api.insight.ly/v2.1/opportunities.

For the tasks I download all data which is available via: https://api.insight.ly/v2.1/tasks.

Unfortunately there is no link in this data for the opportunity and task. When I download the data for Leads there is a connection to the taskid.

 

On the support page for the API I found that it should be possible to get for each opportunity the tasks with: /v2.1/Opportunities/{c_id}/Tasks. 

How can I do this? I tried to retrieve data with an opportunity ID instead of {c_id} but that did not return any info.

Is there also a way to get a list with all taskid's and connected opportunity id's listed? 

 

Thanks in advance for your help.

 

0

Comments

2 comments
  • Official comment

    Hello there,

    Yes, for example if you have an opportunity with ID 12345, you can GET /v2.1/Opportunities/12345/Tasks to retrieve the tasks linked to that opportunity. If you don't receive any data with that call then that would indicate that that particular opportunity doesn't have any tasks linked to it. It will only return the tasks for that opportunity.

    I personally would recommend grabbing the links from the tasks when you download the tasks. So you can call /v2.1/Tasks and the task links (including TaskLinks for opportunities) will be included, and as a bonus you'll have the tasks as well. Alternatively you can use the /v2.1/TaskLinks endpoint to get just the task links for all of your tasks, which will also of course include TaskLinks for opportunities.

    We strongly encourage everyone now to start using v2.2 of the API. It enforces paging, but it performs better and has a number of other features and enhancements.

    Hope that helps! Please let me know if I misunderstood your question. Thanks,
    Nate

     

    Comment actions Permalink
  • Thanks, that was exactly what I was looking for. 

     

    Perfect!

    1
    Comment actions Permalink

Please sign in to leave a comment.