Subform API

A subform is a secondary form or a table, that enables you to include multiple line items into a primary form. You can associate multiple items to a single record. On a more technical perspective, subforms easily solve the need for you to establish a one-to-many relationship with the data in your CRM, in which, many secondary items are associated to a single primary record.

Note

  • You can use the Modules API and Fields Metadata API to get the API name of the subform module and its fields, respectively.
  • A subform can have a maximum of five aggregate custom fields.
  • Edition-wise Subform Support and Limits:
    • Enterprise and Zoho One - Two subforms per module. Each record's subform can have a maximum of 100 subform records.
    • Utlimate and CRM Plus - Five subforms per module. Each record's subform can have a maximum of 100 subform records.

Get Subform Data

Purpose

To get the subform data of a record.

Endpoints

  • GET /{module_API_name}/{record_ID}
  • GET /{subform_API_name}

Request Details

Request URL

{api-domain}/crm/{version}/{module_API_name}/{record_ID}
(or)
{api-domain}/crm/{version}/{subform_API_name}

Supported modules

Leads, Accounts, Contacts, Deals, Campaigns, Cases, Solutions, Products, Vendors, Quotes, Sales Orders, Purchase Orders, Invoices and custom modules.

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.modules.{module_name}.{operation_type}

Possible module names

leads, accounts, contacts, deals, campaigns, cases, solutions, products, vendors, quotes, salesorders, purchaseorders, invoices and custom.

Possible operation types

ALL - Full access to a record
READ - Get records in a module

Parameters
  • fieldsstring, mandatory when using the subform's API name

    Specify the API names of the fields whose details you want to receive in the response. Note that you can include a maximum of 50 field API names in this parameter.
    Possible values: Multiple field API names, comma separated.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/Contacts/554023000000298003"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v8/Contacts/554023000000298003"
	type: GET
	connection:"crm_oauth_connection"
];
info response;

Possible Errors

  • INVALID_MODULEHTTP 400

    You have either specified an invalid module API name, there is no tab permission, or the module is removed from the list of available modules.
    Resolution: Use the Modules API to get the API name of the module. If you have no tab permission or the module is removed, contact your system administrator.

  • INVALID_MODULEHTTP 400

    The given module is not supported in API.
    Resolution: The modules such as Documents and Projects are not supported in API, currently. This error will not be shown, once these modules are supported.

  • INVALID_REQUEST_METHODHTTP 400

    The request method is incorrect.
    Resolution: Use the HTTP GET method to make this API call. Any other request method will result in this error.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    The access token you have used to make this API call does not have the required scope.
    Resolution: Generate a new access token with the scope ZohoCRM.modules.{module_name}.{operation_type}. Refer to the Possible module names and Possible operation types sections for details.

  • AUTHENTICATION_FAILUREHTTP 401

    You have not authenticated the API call with valid access token.
    Resolution: Include a valid access token in the request header to authenticate the API call.

  • NO_PERMISSIONHTTP 403

    You do not have permission to get the details of the subform.
    Resolution: Contact your system administrator.

  • INVALID_URL_PATTERNHTTP 404

    The request URL is incorrect.
    Resolution: Specify a valid request URL. Refer to the Request URL section for the right URL.

  • INTERNAL_ERRORHTTP 500

    Unexpected and unhandled exception in the server. 
    Resolution: Contact the support team at support@zohocrm.com.

Sample Response

Copied{
    "data": [
        {
            "Owner": {
                "name": "Patricia Boyle",
                "id": "554023000000235011"
            },
            "Email": null,
            "$currency_symbol": "Rs.",
            "Other_Phone": null,
            "Mailing_State": null,
            "Other_State": null,
            "Languages": [
                {
                    "Proficiency": "Professional",
                    "$approval": {
                        "delegate": false,
                        "approve": false,
                        "reject": false,
                        "resubmit": false
                    },
                    "$currency_symbol": "Rs.",
                    "$process_flow": false,
                    "Languages_Known": "English",
                    "Parent_Id": {
                        "name": "Last_Name1",
                        "id": "554023000000298003"
                    },
                    "$editable": true,
                    "id": "554023000000473001",
                    "$approved": true
                },
                {
                    "Proficiency": "Native",
                    "$approval": {
                        "delegate": false,
                        "approve": false,
                        "reject": false,
                        "resubmit": false
                    },
                    "$currency_symbol": "Rs.",
                    "$process_flow": false,
                    "Languages_Known": "French",
                    "Parent_Id": {
                        "name": "Last_Name1",
                        "id": "554023000000298003"
                    },
                    "$editable": true,
                    "id": "554023000000473003",
                    "$approved": true
                }
            ],
            "Date_created": "2019-03-04",
            "Other_Country": null,
            "Last_Activity_Time": "2019-04-22T11:27:23+05:30",
            "Department": null,
            "$process_flow": false,
            "Assistant": null,
            "Mailing_Country": null,
            "id": "554023000000298003",
            "$approved": true,
            "Reporting_To": null,
            "$approval": {
                "delegate": false,
                "approve": false,
                "reject": false,
                "resubmit": false
            },
            "Other_City": null,
            "Created_Time": "2019-03-04T11:51:53+05:30",
            "$editable": true,
            "No_of_Employees": null,
            "Home_Phone": null,
            "Created_By": {
                "name": "Patricia Boyle",
                "id": "554023000000235011"
            },
            "Secondary_Email": null,
            "Description": null,
            "Vendor_Name": null,
            "Mailing_Zip": null,
            "Twitter": null,
            "Other_Zip": null,
            "Mailing_Street": null,
            "Salutation": null,
            "First_Name": null,
            "Asst_Phone": null,
            "Full_Name": "Last_Name1",
            "Record_Image": null,
            "Modified_By": {
                "name": "Patricia Boyle",
                "id": "554023000000235011"
            },
            "Skype_ID": null,
            "Phone": null,
            "Account_Name": null,
            "Email_Opt_Out": false,
            "Modified_Time": "2019-04-22T11:27:23+05:30",
            "Date_of_Birth": null,
            "Mailing_City": null,
            "Title": null,
            "Other_Street": null,
            "Mobile": null,
            "Territories": [],
            "Last_Name": "Last_Name1",
            "Lead_Source": "Advertisement",
            "Tag": [],
            "Fax": null
        }
    ]
}

In this response, "Languages" is the subform in the Contacts module with two picklist fields "Languages_Known" and "Proficiency".