Create Variables
Purpose
To create a new variable in the subscriber org.
Endpoints
Request Details
Request URL
{api-domain}/crm/{version}/settings/variables
Header
Authorization: Zoho-oauthtoken 100xx.92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.variables.{operation_type}
Possible operation types
ALL - Full access to variable data
CREATE - Create variable data
Input JSON Keys
To create variables, send a POST request with request body containing the following attributes:
- namestring, mandatory
Specify the display name of the variable that you want to create. It is a unique field.
Example: VariableName3 - api_namestring, mandatory
Specify the name with which the variable is to be referred in any API request. It is a unique field.
Example: MainVariable - typestring, optional
Specify the data type of the variable.
Possible values: integer, text, percent, decimal, currency, date, datetime, email, phone, url, checkbox, textarea, long - variable_groupJSON object, mandatory
Specify the group to which the variable must belong to.
Example: {"id": 40000000047005} or {"name":"Group2"} - valuedepends on type, optional
Specify the default value of the variable.
Example: 123 - descriptionstring, optional
Specify a short description of the variable.
Example: A short description of the variable.
Sample Input
Copied
Possible Errors
- INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to add variables
Resolution: The user does not have the permission to add variables. Contact your system administrator. - PATTERN_NOT_MATCHEDHTTP 400
Please check whether the input values are correct
Resolution: The value specified for "type" key is incorrect. Refer to Input JSON Keys and specify a valid input. - INVALID_DATAHTTP 400
invalid data
Resolution: The input specified is incorrect. Refer to Input JSON Keys section above and specify the valid input. - DUPLICATE_DATAHTTP 400
duplicate data
Resolution: You have specified a duplicate value for one or more unique fields. Refer to Fields Metadata API to know the unique fields. - REQUIRED_PARAM_MISSINGHTTP 400
One of the expected parameter is missing
Resolution: You have not specified one or more mandatory fields in the input. Refer to Input JSON Keys section above and specify all the mandatory fields in the input. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have ZohoCRM.settings.variables.CREATE scope. Create a new client with valid scope. Refer to scope section above. - NO_PERMISSIONHTTP 403
Permission denied to create records
Resolution: The user does not have permission to create variables. Contact your system administrator. - 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 above. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team.
Sample Response
Copied