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.
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
Show full
Show less
In this response, "Languages" is the subform in the Contacts module with two picklist fields "Languages_Known" and "Proficiency".