Get a specific Function
Use this API to retrieve the details of a specific function in your Zoho CRM account by specifying its unique ID or API name. The response contains information such as the function's runtime, category, state, arguments, tags, REST API mode, and creation and modification details. To get the implementation code of the function, you must use the Download Function Code API.
You can obtain the function ID or API name using the List Functions API.
Endpoints
- GET /settings/functions/{function_identifier}
Here, {function_identifier} represents the unique ID or API name of the function. You can obtain the function ID or API name using the List Functions API.
Request Details
Request URL
{api-domain}/crm/{version}/settings/functions/{function_identifier}
Here, {function_identifier} represents the unique ID or API name of the function. You can obtain it using the List Functions API.
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.functions.ALL
(or)
ZohoCRM.settings.functions.READ
(or)
ZohoCRM.settings.ALL
Note:
- This API returns the function metadata only. To download the function implementation, use the Download Function Code API.
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/functions/4876876000003358006"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X GETResponse JSON
The response contains a functions array, which contains the details of the requested function. There will be only a single object in the array, and it contains the following keys:
- return_typestring
The data type returned by the function.
Possible values:
map - The function returns key-value pairs.
string - The function returns a text value.
void - The function does not return a value.
For non-Deluge functions, the return type will always be null. - created_timedatetime
Timestamp when the function was created.
- has_draftBoolean
Indicates whether the function has an unpublished draft version. This key is applicable only to Java,Node.js and Python functions.
- descriptionstring
The description of the function. This value will be null if no description is specified.
- runtimestring
The runtime environment used to execute the function.
Possible Values:
Deluge 1.0 - Executes the function using the Deluge runtime.
NodeJS 8 - Executes the function using the Node.js 8 runtime.
NodeJS 22 - Executes the function using the Node.js 22 runtime.
Java 8 - Executes the function using the Java 8 runtime.
Java 17 - Executes the function using the Java 17 runtime.
Python 3.12 - Executes the function using the Python 3.12 runtime. - languagestring
The programming language of the function.
Possible Values: Deluge, Node JS, Java, Python - sourcestring
The source from which the function was created.
Possible Values:
crm - The function was created in Zoho CRM.
extension - The function was created as part of an extension. - rest_api_modeJSON array
The REST API authentication modes enabled for the function.
Possible Values:
Oauth - The function can be invoked using OAuth authentication.
ZAPI - The function can be invoked using a ZAPI key.
None - The function cannot be invoked through REST APIs. - created_byJSON object
Contains the details of the user who created the function. The object contains the user's name and id.
- modified_timedatetime
Timestamp when the function was last modified.
- api_namestring
The unique API name of the function.
- namestring
The display name of the function.
- modified_byJSON object
Contains the details of the user who last modified the function. The object contains the user's name and id.
- argumentsJSON array
Contains the list of arguments accepted by the function. Each object contains the argument's name and type. This key is null if the function does not accept any arguments.
- TagJSON array
Contains the tags associated with the function. Each object contains the tag's name, id, and color_code. This array is empty if no tags are associated with the function.
- idstring
The unique ID of the function.
- statestring
The current state of the function.
Possible Values:
active - The function is published and can be associated with supported features.
unpublished - The function has not been published. This value is valid only for Java and Node.js functions.
deprecated - The function uses a deprecated runtime or deprecated Deluge tasks. - categorystring
The category that determines how the function is executed.
Possible Values:
Related List - Executes from a related list.
Validation Rule - Executes as part of a validation rule.
Schedule - Executes based on a schedule.
Automation - Executes as part of an automation.
Standalone - Executes independently and can be invoked directly.
Signals - Executes when a configured signal is received.
Button - Executes when a user clicks a custom button.
Note:
If the specified function ID or API name does not exist, the API returns an HTTP 204 (No Content) response with an empty response body.
Possible Errors
- INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: This API supports only the GET method. Retry the request using the GET method. - API_NOT_SUPPORTEDHTTP 400
API not supported for client portal user
Resolution: This API is not supported for Client Portal users. Use a supported user account to make the API request. - FEATURE_NOT_SUPPORTEDHTTP 400
Your license does not support this feature
Resolution: Upgrade your Zoho CRM edition to one that supports functions, and then retry the request. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have the required OAUTH SCOPE. Create a new token with valid scope. Refer to the Scope section for more details. - INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section for more details. - NO_PERMISSIONHTTP 403
- Permission denied
Resolution: The user does not have permission to access functions. Contact the admin for the required permissions. - User email not confirmed.
Resolution: Verify the email address associated with the user account, and then retry the request.
- Permission denied
Sample Response
Copied{
"functions": [
{
"return_type": "string",
"created_time": "2023-03-20T12:52:24+05:30",
"has_draft": false,
"description": null,
"runtime": "Deluge 1.0",
"language": "Deluge",
"source": "crm",
"rest_api_mode": [
"Oauth",
"ZAPI"
],
"created_by": null,
"modified_time": "2024-07-22T20:00:55+05:30",
"api_name": "createlead",
"name": "CreateLead",
"modified_by": {
"name": "Patricia Boyle",
"id": "4876876000000327001"
},
"arguments": [
{
"name": "FirstName",
"type": "string"
},
{
"name": "LastName",
"type": "string"
},
{
"name": "Company",
"type": "string"
},
{
"name": "Mobile",
"type": "string"
}
],
"id": "4876876000003358006",
"Tag": [],
"state": "active",
"category": "Standalone"
}
]
}