How can I link a contact to a opportunity via REST API?

I'm trying to find some documentation on how to do this. I will start trying to use this endpoint now, but its not clear to me if it will work:

<module>/:record/link/:link_name/:remote_id POST

But I do not know if it will work.

Thanks for some help.

Parents
  • Hello Mark,

    Let me answer with a single post on the typical question about manipulating Sugar data externally 

    Let's look at your specific task from a broader perspective of integration tasks because it's possible to avoid building out all the logic data processing by writing the code manually.
    Looks like In your case the logic is actually is a sequence of operations - to find all the contacts in CRM that meet the criteria, then to find all Opps to link them to, then perform linking

    I'm not a code developer and if you are Sugar Admin and keen to setup Sugar with no-code, it may take a few minutes to configure such things with a Logic Builder tool and then just to call it with an API call

    Below is an example that includes the logic for Contacts search (in example on Lastname and Firstname), Opps search (in example on Opp name) following Opps and Contacts linking.
    To read the logic, follow the white line:

    Logic Builder tool generates the Module Loader installable zip file from the logic drawn (zip file is provided below)

    To call the configured logic with a regular call to Sugar API, we would need to provide LinkContactToOpp endpoint definition which could be set up in CRM as a simple data record.
    For doing that just install LB Services module that allows to set up custom endpoints with no-code as module records.

    1. download LB Services from https://integroscrm.com/lb-components/ ,
    2. install LB Services with Module Loader
    3. add a record to the LB Services module with the following fields values

    4. install zip that implements the configured logic 
    z20220530_flowchart_lb6294bb52d08538_58197966.zip


    I performed the deployment sequence to the Sugar demo instance https://sg-example04.demo.sugarcrm.eu/ (login admin, password asdf)

    Now, we can use postman that Sugar instance to make REST  API call (auth, then make a POST request to LinkContactToOpp  endpoint)


    Now, all Contacts with the name "Linda Holiday" are linked to all Opportunities with the name "Opp white Cross" (you may try it out on the demo instance)

    Let me know if any questions



    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

Reply
  • Hello Mark,

    Let me answer with a single post on the typical question about manipulating Sugar data externally 

    Let's look at your specific task from a broader perspective of integration tasks because it's possible to avoid building out all the logic data processing by writing the code manually.
    Looks like In your case the logic is actually is a sequence of operations - to find all the contacts in CRM that meet the criteria, then to find all Opps to link them to, then perform linking

    I'm not a code developer and if you are Sugar Admin and keen to setup Sugar with no-code, it may take a few minutes to configure such things with a Logic Builder tool and then just to call it with an API call

    Below is an example that includes the logic for Contacts search (in example on Lastname and Firstname), Opps search (in example on Opp name) following Opps and Contacts linking.
    To read the logic, follow the white line:

    Logic Builder tool generates the Module Loader installable zip file from the logic drawn (zip file is provided below)

    To call the configured logic with a regular call to Sugar API, we would need to provide LinkContactToOpp endpoint definition which could be set up in CRM as a simple data record.
    For doing that just install LB Services module that allows to set up custom endpoints with no-code as module records.

    1. download LB Services from https://integroscrm.com/lb-components/ ,
    2. install LB Services with Module Loader
    3. add a record to the LB Services module with the following fields values

    4. install zip that implements the configured logic 
    z20220530_flowchart_lb6294bb52d08538_58197966.zip


    I performed the deployment sequence to the Sugar demo instance https://sg-example04.demo.sugarcrm.eu/ (login admin, password asdf)

    Now, we can use postman that Sugar instance to make REST  API call (auth, then make a POST request to LinkContactToOpp  endpoint)


    Now, all Contacts with the name "Linda Holiday" are linked to all Opportunities with the name "Opp white Cross" (you may try it out on the demo instance)

    Let me know if any questions



    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

Children
No Data