Opportunities LINKS (organisation ID)
Hi I got Insigthly SDK by Brian McConnell, who I would like to say thanks for share your knowledge about python /Insightly API very usefully!
I am an Insightly user and starting to create python codes… very beginner programmer, but my first task is create an internal app integrated with Insightly, where a need to get an opportunity ID, and the organization code/name that they are into opportunities/LINKS…. I can´t do that! D
how I can do that, somebody can help me !
tks in advance
Carmello
Comments
Hi Carmello,
If I'm understanding your question correctly, it sounds like you're trying to create a Link between an Opportunity and Organisation. The Python library is an open source library that's intended to assist customers, so I had to spend some time looking over the source code to see how it works.
It looks like there's a create_child(...) method that can be used to create a link.
Here is a little example of how you could go about doing that:
You also mentioned that you need the ID itself. You could get a list of Opportunities and Organisations using the read(...) method.
Also, since this is an open source library, you can also dig through the source code to see how it was implemented, to give yourself some ideas on how you could implement a more customized solution.
Documentation for the API can be found here https://api.insight.ly/v2.2/Help#! .
Good luck!
Sung
Hi
Actually I need to read an opportunity id and get the existents links and check the organization id and organization name are linked on that!!
Following a sample in json format, where I have an opportunity id 6800505, and two links item , one for contact and another for organization.
I need to check if there is a link items, if there is, check each one have an organization id, and them get the organization information .. I will get those information into my local application. (opportunity info and organization info).
I hope it is clear what I need.. sorry for my poor English....
[
{
"BID_TYPE": "Fixed Bid",
"BID_CURRENCY": "BRL",
"VISIBLE_TEAM_ID": 2039537,
"BID_DURATION": null,
"OPPORTUNITY_VALUE": 349000,
"OPPORTUNITY_STATE_REASON_ID": null,
"RESPONSIBLE_USER_ID": 660462,
"PROBABILITY": 75,
"FORECAST_CLOSE_DATE": "2016-03-31 00:00:00",
"ACTUAL_CLOSE_DATE": null,
"VISIBLE_TO": "TEAM",
"PIPELINE_ID": 119092,
"IMAGE_URL": null,
"VISIBLE_USER_IDS": null,
"OPPORTUNITY_ID": 6800505,
"STAGE_ID": 361631,
"DATE_UPDATED_UTC": "2016-03-24 15:19:38",
"TAGS": [],
"OPPORTUNITY_DETAILS": null,
"OPPORTUNITY_STATE": "OPEN",
"CUSTOMFIELDS": [
{
"FIELD_VALUE": "Symantec",
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_1"
},
{
"FIELD_VALUE": "Products",
"CUSTOM_FIELD_ID": "OPPORTUNITY_FIELD_2"
}
],
"OPPORTUNITY_NAME": "Walmart - VERITAS - NBU Appliance",
"LINKS": [
{
"ORGANISATION_ID": 56698004,
"SECOND_PROJECT_ID": null,
"CONTACT_ID": null,
"LINK_ID": 73044326,
"ROLE": null,
"DETAILS": null,
"SECOND_OPPORTUNITY_ID": null,
"PROJECT_ID": null,
"OPPORTUNITY_ID": 6800505
},
{
"ORGANISATION_ID": null,
"SECOND_PROJECT_ID": null,
"CONTACT_ID": null,
"LINK_ID": 73167654,
"ROLE": "",
"DETAILS": null,
"SECOND_OPPORTUNITY_ID": 6813467,
"PROJECT_ID": null,
"OPPORTUNITY_ID": 6800505
}
],
"BID_AMOUNT": 349000,
"DATE_CREATED_UTC": "2015-04-28 14:28:08",
"OWNER_USER_ID": 649303,
"CATEGORY_ID": 2780706
}
]
Tks
Carmello
Hi Carmello,
I'm not a Python expert by any means, so there could very well be a better way to do this; Does this code snippet help?
Regards,
Sung
Perfet!!! it works P E R F E C T !!!!
Tks so much !!!
Please sign in to leave a comment.