Add Record API

Purpose

To add a record in the form. There are two types of Add Record API available: Add Employee API - To add an employee to your organization and Add Department API- To add various departments in your Zoho People account.

Request URL

https://people.zoho.com/people/api/forms/<inputType>/<formLinkName>/insertRecord?authtoken=<token>&inputData=<inputData>

Note:

Request Parameters

authtokenSpecify the authentication token
formLinkNameTo get formLinkName,use the Fetch Forms API.
inputTypexml or json
inputDataXML input: <Request><Record><field name="Labelname">value</field><field name="LabelName1">value1</field><field name="Labelname2">value2</field></Record></Request>
JSON input: {LabelName:'value',LabelName1:'value1',LabelName2:'value2'}

Add Employee API

To add an employee to your organization, use the below API and mention the keyword employee instead of formLinkName.

Request URL

https://people.zoho.com/people/api/employee/records?authtoken=<token>&xmlData=<xmlData>

Request parameter

authtokenSpecify the authentication token
xmlDatasample input: <Request><Record><field name="Labelname">value</field><field name="LabelName1">value1</field><field name="Labelname2">value2</field></Record></Request>

Add Department API

You can add various departments one by one in Zoho People using the API below

Request URL

https://people.zoho.com/people/api/department/records?authtoken=<token>&xmlData=<xmlData>

authtokenSpecify the authentication token
xmlDatasample input: <Request><Record><field name="Labelname">value</field><field name="LabelName1">value1</field><field name="Labelname2">value2</field></Record></Request>

Example - Add Record API

XML request:

https://people.zoho.com/people/api/forms/xml/employee/insertRecord?authtoken=7d985878998943g4j09h43dd0b167dda34b&inputData=<Request><Record><field name='EmployeeID'>011</field><field name='FirstName'>steves</field><field name='LastName'>V</field><field name='EmailID'>steves@domain.com</field><field name='Marital_status'>Married</field></Record></Request>

JSON request:

https://people.zoho.com/people/api/forms/json/employee/insertRecord?authtoken=7d985878998943g4j09h43dd0b167dda34b&inputData={EmployeeID:'011',FirstName:'steves',LastName:'V',EmailID:'steves@domain.com',Marital_status:'Married'}

XML response:

<?xml version=""1.0"" encoding=""UTF-8""?>
<response uri=""/api/forms/xml/employee/insertRecord"">
<status>
0</status>
<message>
Data added successfully</message>
<result>
<message>
Successfully Added</message>
</result>
</response>

JSON response:

{"response":{"message":"Data added successfully","result":{"message":"Successfully Added"},"status":0,"uri":"/api/forms/json/employee/insertRecord"}}

Example - Add Employee API

Request URL:

https://people.zoho.com/people/api/employee/records?authtoken=7d985878998943g4j09h43dd0b167dda34b &xmlData=<Request><Record><field name='EmployeeID'>011</field><field name='FirstName'>steves</field><field name='LastName'>V</field><field name='EmailID'>steves@domain.com</field><field name='Marital_status'>Married</field></Record></Request>

XML response:

<Response Status="1">
<message>Successfully Added</message>
</Response>

JSON response:

[{"message":"Successfully Added","Response":1}]

Example - Add Department API

Request URL:

https://people.zoho.com/people/api/department/records?authtoken=7d985878998943g4j09h43dd0b167dda34b &xmlData=<Request><Record><field name='Department'>support</field><field name='MailAlias'>sohail@domain.com</field><field name='Department_Lead'>17</field><field name='testing'>17</field></Record></Request>

XML response:

<Response Status="1">
<message>Successfully Added</message>
</Response>

JSON response:

[{"message":"Successfully Added","Response":1}]

Error codes

Please refer Error Codes.

Note:

  • Use POST method to pass the parameters instead of GET method.
  • To add or edit data for Lookup field, you must pass the record ID as value. For example, consider Department lookup in Employee form and let the department be Finance. For this case, the recordID of Finance in the Department form should be passed as value.