SugarCRM SupportDocumentationSugar DeveloperSugar Developer Guide 7.9IntegrationWeb Servicesv10Endpoints/<module>/:record/link POST

/<module>/:record/link POST

Overview

Creates relationships to a pre-existing record.

Request Arguments

Name Type Description Required
<relationship link> <string> Link between targeted and related records. True
<record ID> <string> The name value list of related records. Each item of the list may be either string equal to related item ID, or map containing record ID ("id" key is required in this case) and addition relationship properties. True

Request

{
    link_name: "accounts"
    ids: [
        "da6a3741-2a81-ba7f-f249-512d0932e94e",
        {
            "id": "e689173e-c953-1e14-c215-512d0927e7a2",
            "role": "owner"
        }
    ]
}

Response Arguments

Name Type Description
record Array The record linked to related records.
related_records Array Records that were associated.

Response

    "record": {
        "id": "da6a3741-2a81-ba7f-f249-512d0932e94e",
        "name": "Slender Broadband Inc - 1000 units",
        "date_entered": "2013-02-26T19:12:00+00:00",
        "date_modified": "2013-02-26T19:12:00+00:00",
        "modified_user_id": "1",
        "modified_by_name": "Administrator",
        "created_by": "1",
        "created_by_name": "Administrator",
        "description": "",
        "img": "",
        "last_activity_date": "2013-02-28T18:21:00+00:00",
        "deleted": false,
        "assigned_user_id": "seed_max_id",
        "assigned_user_name": "Max Jensen",
        "team_name": [
            {
                "id": "East",
                "name": "East",
                "name_2": "",
                "primary": false
            },
            {
                "id": "West",
                "name": "West",
                "name_2": "",
                "primary": true
            }
        ],
        "opportunity_type": "",
        "account_name": "Slender Broadband Inc",
        "account_id": "181461c6-dc81-1115-1fe0-512d092e8f15",
        "campaign_id": "",
        "campaign_name": "",
        "lead_source": "Campaign",
        "amount": "25000",
        "base_rate": "1",
        "amount_usdollar": "25000",
        "currency_id": "-99",
        "currency_name": "",
        "currency_symbol": "",
        "date_closed": "2013-02-27",
        "date_closed_timestamp": "1361992480",
        "next_step": "",
        "sales_stage": "Needs Analysis",
        "sales_status": "New",
        "probability": "90",
        "best_case": "25000",
        "worst_case": "25000",
        "commit_stage": "include",
        "my_favorite": false,
        "_acl": {
            "fields": {

            }
        }
    },
    "related_records": [
        {
            "id": "e689173e-c953-1e14-c215-512d0927e7a2",
            "name": "Gus Dales",
            "date_entered": "2013-02-26T19:12:00+00:00",
            "date_modified": "2013-02-26T19:12:00+00:00",
            "modified_user_id": "1",
            "modified_by_name": "Administrator",
            "created_by": "1",
            "created_by_name": "Administrator",
            "description": "",
            "img": "",
            "deleted": false,
            "assigned_user_id": "seed_sally_id",
            "assigned_user_name": "Sally Bronsen",
            "team_name": [
                {
                    "id": "West",
                    "name": "West",
                    "name_2": "",
                    "primary": true
                }
            ],
            "salutation": "",
            "first_name": "Gus",
            "last_name": "Dales",
            "full_name": "Gus Dales",
            "title": "Director Operations",
            "linkedin": "",
            "facebook": "",
            "twitter": "",
            "googleplus": "",
            "department": "",
            "do_not_call": false,
            "phone_home": "(661) 120-2292",
            "email": [
                {
                    "email_address": "section.sugar.section@example.it",
                    "opt_out": "1",
                    "invalid_email": "0",
                    "primary_address": "0"
                },
                {
                    "email_address": "support.qa.kid@example.co.uk",
                    "opt_out": "0",
                    "invalid_email": "0",
                    "primary_address": "1"
                }
            ],
            "phone_mobile": "(294) 447-9707",
            "phone_work": "(036) 840-3216",
            "phone_other": "",
            "phone_fax": "",
            "email1": "support.qa.kid@example.co.uk",
            "email2": "section.sugar.section@example.it",
            "invalid_email": false,
            "email_opt_out": false,
            "primary_address_street": "48920 San Carlos Ave",
            "primary_address_street_2": "",
            "primary_address_street_3": "",
            "primary_address_city": "Persistance",
            "primary_address_state": "CA",
            "primary_address_postalcode": "54556",
            "primary_address_country": "USA",
            "alt_address_street": "",
            "alt_address_street_2": "",
            "alt_address_street_3": "",
            "alt_address_city": "",
            "alt_address_state": "",
            "alt_address_postalcode": "",
            "alt_address_country": "",
            "assistant": "",
            "assistant_phone": "",
            "picture": "",
            "email_and_name1": "",
            "lead_source": "Support Portal User Registration",
            "account_name": "Arts & Crafts Inc",
            "account_id": "d43243c6-9b8e-2973-aee2-512d09bc34b4",
            "opportunity_role_fields": "",
            "opportunity_role_id": "",
            "opportunity_role": "Technical Advisor",
            "reports_to_id": "",
            "report_to_name": "",
            "portal_name": "GusDales145",
            "portal_active": true,
            "portal_password": "$1$JxYr6tmM$b.O6.KF42jP46RadSwz0N0",
            "portal_password1": "",
            "portal_app": "",
            "preferred_language": "en_us",
            "campaign_id": "",
            "campaign_name": "",
            "c_accept_status_fields": "",
            "m_accept_status_fields": "",
            "accept_status_id": "",
            "accept_status_name": "",
            "sync_contact": "",
            "my_favorite": false,
            "_acl": {
                "fields": {
                }
            }
        },
        {
            "id": "da6a3741-2a81-ba7f-f249-512d0932e94e",
            "name": "Slender Broadband Inc - 1000 units",
            "date_entered": "2013-02-26T19:12:00+00:00",
            "date_modified": "2013-02-26T19:12:00+00:00",
            "modified_user_id": "1",
            "modified_by_name": "Administrator",
            "created_by": "1",
            "created_by_name": "Administrator",
            "description": "",
            "img": "",
            "last_activity_date": "2013-02-28T18:36:00+00:00",
            "deleted": false,
            "assigned_user_id": "seed_max_id",
            "assigned_user_name": "Max Jensen",
            "team_name": [
                {
                    "id": "East",
                    "name": "East",
                    "name_2": "",
                    "primary": false
                },
                {
                    "id": "West",
                    "name": "West",
                    "name_2": "",
                    "primary": true
                }
            ],
            "opportunity_type": "",
            "account_name": "Slender Broadband Inc",
            "account_id": "181461c6-dc81-1115-1fe0-512d092e8f15",
            "campaign_id": "",
            "campaign_name": "",
            "lead_source": "Campaign",
            "amount": "25000",
            "base_rate": "1",
            "amount_usdollar": "25000",
            "currency_id": "-99",
            "currency_name": "",
            "currency_symbol": "",
            "date_closed": "2013-02-27",
            "date_closed_timestamp": "1361992480",
            "next_step": "",
            "sales_stage": "Needs Analysis",
            "sales_status": "New",
            "probability": "90",
            "best_case": "25000",
            "worst_case": "25000",
            "commit_stage": "include",
            "my_favorite": false,
            "_acl": {
                "fields": {

                }
            }
        }
    ]
}

Change Log

Version Change
v10 (7.6.0) Added support for additional relationship values.
v10 (7.1.5) Added /<module>/:record/link POST endpoint.

Last modified: 2017-05-31 21:07:51