Projects API

Purpose

These APIs are used to get the list of projects, project details, add project, modify project, change the project status and delete the project(s).

Get projects API

This API is used to get the list of projects.

Request URL:

http://people.zoho.com/people/api/timetracker/getprojects?authtoken=<authtoken>&clientId=<clientId>&assignedTo=<assignedTo>

Request parameter:

ParametersValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
assignedTo< all | ERECNO | Email-ID | Employee-ID ><current user>Specify user whose projects needs to be fetched
isUserCount<true | false>falseFetches the number of users assigned to project
isJobCount<true | false>falseFetches the number of jobs mapped to project
includeDeptProjects<true | false>falseFetches the projects that are mapped to departments
clientId< clientId>allSpecify the client id based on which projects needs to be fetched
projectStatus< all | inprogress | completed >allSpecify the project status
sIndex< sIndex>0Specify from which record the response should be fetched
limit< limit>200Specify the number of records to be fetched. Maximum value is 200.

Success Response Format:

{
"response": {
    "result": [
      {
        "projectId": < projectId >,
        "projectName": < projectName >,
        "projectStatus": < projectStatus >,
        "projectCost": < projectCost >,
        "projectManager": < projectManager >,
        "projectManagerName": < projectManagerName >,
        "projectUsersCount": < projectUsersCount >,
        "ownerId": < ownerId >,
        "owner": < OwnerName >,
        "clientId": < clientId >,
        "clientName": < clientName >,
        "jobCount": < jobCount >,(NOTE:This key exists if isJobCount is true)
        "isDeptProject":< true >(NOTE:This key exists if the project is assigned to department)
        "isDeleteAllowed":< true|false >
      },... ],
      "isNextAvailable": true, (NOTE:This key will be available only if there is more data) 
      "message": "Data Fetched Successfully",
      "uri": "/api/timetracker/getprojects",
      "status": 0
      }
}

Error Response Format:

{
  "response": {
    "message": "Error in fetching data",
    "uri": "/api/timetracker/getprojects",
    "errors": [
      {
        "code": < error_code >,
        "message": < error_message >
      }],
    "status": 1
  }

Error Codes & Messages:

Error CodeError Message
9000Permission denied
9003Wrong value for <parameter_name> parameter

Example

Request URL:

http://people.zoho.com/api/timetracker/getprojects?authtoken=2110c57f48434f76c22c139c6ef88926&clientId=2239000000332107&
assignedTo=all

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/getprojects">
    <status>0</status>
    <message>Data fetched successfully</message>
    <result>
    <project>
    <projectManager>492688000000135005</projectManager>
    <projectUsersCount>5</projectUsersCount>
    <clientId>492688000000793027</clientId>
    <projectManagerName>Christine</projectManagerName>
    <clientName>Robin Li</clientName>
    <isDeleteAllowed>true</isDeleteAllowed>
    <ownerId>492688000000135005</ownerId>
    <projectStatus>In-Progress</projectStatus>
    <ownerName>Christine</ownerName>
    <projectCost>1000.0</projectCost>
    <projectName>Project2</projectName>
    <projectId>492688000000341099</projectId>
    <jobCount>1</jobCount>
    </project>
    </result>
</response>         
 

JSON response:

{
    "response": {
        "result": [{
                "projectManager": "492688000000135005",
                "projectUsersCount": 5,
                "clientId": "492688000000793027",
                "projectManagerName": "Christine",
                "clientName": "Robin Li",
                "isDeleteAllowed": true,
                "ownerId": "492688000000135005",
                "projectStatus": "In-Progress",
                "ownerName": "Sridhar",
                "projectCost": 1000,
                "projectName": "Project2",
                "projectId": "492688000000341099",
                "jobCount": 1
            }
        ],
        "message": "Data fetched successfully",
        "uri": "/api/timetracker/getprojects",
        "status": 0
    }
}

Get project Details API

This API is used to get the details of a specific project.

Request URL:

http://people.zoho.com/people/api/timetracker/getprojectdetails?authtoken=<authtoken>&projectId=<projectId>

Request parameter:

ParametersValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
*projectId<projectId><Mandatory>Specify the project id for which project details needs to be fetched
includeDept<true | false>falseFetches the department assigned to the project
isJobCount<true | false>falseFetches the number of job assigned to the project

Success Response Format:

{
  "response": {
    "result": [
      {
        "projectId": < projectId >,
        "projectName": < projectName >,
        "projectStatus": < projectStatus >,
        "projectCost": < projectCost >,
        "projectManager": < projectManager >,
        "projectManagerName": < projectManagerName >,
        "projectUsers": [
          {
            "erecno": < ProjectUserID >,
            "name": < ProjectUserName >
          },...
        ],  
        "projectDeptUsers": [ (NOTE:This key exists when includeDept param is true)                   {
             "deptName": < deptName >,
             "deptId": < deptId >
        },...
        ],
        "ownerId": < ownerId >,
        "owner": < OwnerName >,
        "clientId": < clientId >,
        "clientName": < clientName >,
        "jobCount": < jobcount >(NOTE: This key exists when "isJobCount" key is true)

      }
    ],
    "message": "Data Fetched Successfully",
    "uri": "/api/timetracker/getprojectdetails",
    "status": 0
  }
}

Error Response Format:

{
  "response": {
    "message": "Error in fetching data",
    "uri": "/api/timetracker/getprojectdetails",
    "errors": [
      {
        "code": < error_code >,
        "message": < error_message >
      }],
    "status": 1
  }

Error Codes & Messages:

Error CodeError Message
9000Permission denied
9005Time Tracker Tab is disabled

Example

Request URL:

http://people.zoho.com/api/timetracker/getprojectdetails?authtoken=2110c57f48434f76c22c139c6ef88926&projectId=2239000000332107

XML response:

<response uri="/api/timetracker/getprojectdetails">
<status>0</status>
<message>Data fetched successfully</message>
<result>
   <project>
     <projectManager>492688000000135005</projectManager>
     <projectStatus>In-Progress</projectStatus>
     <ownerName>Christine</ownerName>
     <projectManagerName>Christine</projectManagerName>
     <isDeleteAllowed>true</isDeleteAllowed>
     <projectName>HR</projectName>
     <ownerId>492688000000135005</ownerId> 
     <projectUsers>
           [{"erecno":"492688000000142087","rate":200,"name":"Christine"},...]
     </projectUsers>
     <projectId>492688000000790001</projectId>
  </project>
</result>
</response>
 

JSON response:

{
    "response": {
        "result": [
            {
                "projectManager": "492688000000135005",
                "projectStatus": "In-Progress",
                "ownerName": "Christine",
                "projectManagerName": "Christine",
                "isDeleteAllowed": true,
                "projectName": "HR",
                "ownerId": "492688000000135005",
                "projectUsers": [
                   {
                        "erecno": "492688000000142087",
                        "rate": 200,
                        "name": "Christine"
                    },...
        },]
        "message": "Data fetched successfully",
        "uri": "/api/timetracker/getprojectdetails",
        "status": 0
    }
}

Form based API to Get Projects

 

Add project API ( deprecated - Instead Use this API)

This API is used to add the project.

Request URL:

http://people.zoho.com/people/api/timetracker/addproject?authtoken=<authtoken>&projectName=<projectName>&clientId=<clientId>&projectCost=<projectCost>&jobIds=<jobIds>

Request parameter:

ParameterDescription
*authtokenSpecify the authentication token
*projectNameSpecify the project name to be added
clientIdSpecify the client Id if needed to be mapped to project
projectCostSpecify the project cost
jobIdsSpecify the jobIds (seperated by commas)

Example URL:

http://people.zoho.com/api/timetracker/addproject?authtoken=c0f4d58c9c922494c23b76ac919c2b48&
user=2958000000067007&projectName=Googleproducts&clientId=2958000000126297&
projectCost=200000&jobIds=2958000000126497

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/addproject">
   <status>0</status>
   <message>Project added successfully</message>
   <result>
     <projectId>2958000000137009</projectId>
   </result>
</response>
 

JSON response:

{
        "response": {
        "message": "Project added successfully",
        "result": [ { "projectId": "2958000000136077" } ],
        "uri": "/api/timetracker/addproject",
        "status": 0
    }
}

Form based API for Add Project

This API is used to add a Project

Request URL:

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

Request Parameters

ParameterDescription
*authtokenSpecify the authentication token
*formLinkNameSpecify as P_TimesheetJobsList
*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'}

Example:

XML Request:

https://people.zoho.com/people/api/forms/xml/P_TimesheetJobsList/insertRecord?authtoken=c05097bb5311b6eadfd5cbbbd66d9ef6&inputData=<Request><Record><field name="Project_Name">Website Designing</field><field name="ClientId">9000000130027</field><field name="ProjectCost">1000</field><field name="ProjectManager">9000000019535</field><field name="ProjectUsers">9000000013255;9000000019535</field><field name="ProjectUserRate">100;100</field><field name="departmentIds">9000000013669;9000000019671</field></Record></Request>

JSON Request:

https://people.zoho.com/people/api/forms/json/P_TimesheetJobsList/insertRecord?authtoken=c05097bb5311b6eadfd5cbbbd66d9ef6&inputData={"Project_Name":"Website Designing","ClientId":"9000000130027","ProjectCost":"1000",
"ProjectManager":"9000000019535","ProjectUsers":"9000000013255;9000000019535",
"ProjectUserRate":"100;100","departmentIds":"9000000013669;9000000019671"}

XML response:

<?xml version=""1.0"" encoding=""UTF-8""?>
<response uri=""/api/forms/xml/P_TimesheetJobsList/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" } ],
        "uri": "/api/forms/json/P_TimesheetJobsList/insertRecord",
        "status": 0
       }
}

Note:

 

Modify project API ( deprecated - Instead Use this API)

This API is used to modify the project.

Request URL:

http://people.zoho.com/people/api/timetracker/modifyproject?authtoken=<authtoken>&projectId=<projectId>&projectName=<projectName>&clientId=<clientId>&projectCost=<projectCost>&jobIds=<jobIds>

Request parameter:

ParameterDescription
*authtokenSpecify the authentication token
*projectIdSpecify the project Id
projectNameSpecify the project name
clientIdSpecify the client Id
projectCostSpecify the project cost
jobIdsSpecify the job Id

Example URL:

http://people.zoho.com/api/timetracker/modifyproject?authtoken=c0f4d58c9c922494c23b76ac919c2b48&user=2958000000067007
&projectId=2958000000136077&projectName=Google products&clientId=2958000000126297&
projectCost=200&jobIds=2958000000126497

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/modifyproject">
   <status>0</status>
   <message>Project details modified successfully</message>
   <result>
      <projectId>2958000000136077</projectId>
   </result>
</response>
 

JSON response:

{
    "response": {
        "message": "Project details modified successfully",
        "result": [ { "projectId": "2958000000136077" } ],
        "uri": "/api/timetracker/modifyproject",
        "status": 0
    }
}

Form based API for Modify Project

This api is used to modify any project.

Request URL:

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

Request parameter:

ParameterDescription
*authtokenSpecify the authentication token
*formLinkNameSpecify as P_TimesheetJobsList
*inputTypexml or json
*recordIdSpecifies the user record ID of the record being edited
*inputDataXML input: <Request><Record><field name="Labelname"quot;>value</field><field name="LabelName1">value1</field><field name="Labelname2">value2</field></Record></Request>
JSON input: {LabelName:'value',LabelName1:'value1',LabelName2:'value2'}

Example:

XML Request:

https://people.zoho.com/people/api/forms/xml/P_TimesheetJobsList/updateRecord?authtoken=c05097bb5311b6eadfd5cbbbd66d9ef6&inputData=<Request><Record><field name="Project_Name">Website Designing</field><field name="ClientId">9000000130027</field><field name="ProjectCost">1000</field><field name="ProjectManager">9000000019535</field><field name="ProjectUsers">9000000013255;9000000019535</field><field name="ProjectUserRate">100;100</field><field name="departmentIds">9000000013669;9000000019671</field></Record></Request>&recordId=9000000317003

JSON Request:

https://people.zoho.com/people/api/forms/json/P_TimesheetJobsList/updateRecord?authtoken=c05097bb5311b6eadfd5cbbbd66d9ef6&inputData={"Project_Name": "Website Designing","ClientId":"9000000130027","ProjectCost":"1000",
"ProjectManager":"9000000019535","ProjectUsers":"9000000013255;9000000019535",
"ProjectUserRate":"100;100","departmentIds":"9000000013669;9000000019671"}
&recordId=9000000317003

XML Response:

<?xml version=""1.0"" encoding=""UTF-8""?>
<response uri=""/api/forms/xml/P_TimesheetJobsList/updateRecord"">
    <status>0</status>
	<message>Data updated successfully</message>
	<result>
	<message>Successfully Updated</message>
	</result>
</response> 
 

JSON Response:

{
        "response": {
		"result": {
			"pkId": "9000000317003",
			"message": "Successfully Updated"
		},
        "message": "Data updated successfully",
        "uri": "/api/forms/json/P_TimesheetJobsList/updateRecord",
        "status": 0
        }
     } 
            

Note:

 

Change project status API

This API is used to change the project's status.

Request URL:

http://people.zoho.com/people/api/timetracker/changeprojectstatus?authtoken=<authtoken>&projectId=<projectId>&status=<status>

Request parameter:

ParametersValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
*projectId<projectId><Mandatory>Specify the project Id
*status<In-progress | Inprogress| 0|completed|1><Mandatory>Specify the status as in-progress or completed

Success Response Format:

{
    "response": {
        "result": [
            {
                "projectId": < projectId >
            }
        ],
        "message": "Project status changed successfully",
        "uri": "/api/timetracker/changeprojectstatus",
        "status": 0
    }
}

Error Response Format:

{
  "response": {
    "message": "Project Status cannot be changed",
    "uri": "/api/timetracker/changeprojectstatus",
    "errors": [
      {
        "code": < error_code >,
        "message": < error_message >
      }],
    "status": 1
  }

Error Codes & Messages:

Error CodeError Message
8000No <parameter_name> specified
8001Wrong value for <parameter_name>

Example

Request URL:

http://people.zoho.com/api/timetracker/changeprojectstatus?authtoken=c0f4d58c9c922494c23b76ac919c2b48&
projectId=2958000000136077&status=completed

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/changeprojectstatus">
<status>0</status>
<message>Project status changed successfully</message>
<result>
<projectId>492688000000806210</projectId>
</result>
</response>

JSON response:

{
    "response": {
        "result": [
            {
                "projectId": "492688000000806210"
            }
        ],
        "message": "Project status changed successfully",
        "uri": "/api/timetracker/changeprojectstatus",
        "status": 0
    }
}

Delete projects API

This API is used to delete the projects.

Request URL:

http://people.zoho.com/people/api/timetracker/deleteproject?authtoken=<authtoken>&projectId=<projectId>

Request parameter:

ParametersValues AllowedDefault ValueDescription
*authtoken<authtoken><Mandatory>Specify the authentication token
*projectId<projectId><Mandatory>Specify the projectIds (seperated by commas max count of 1000)

Success Response Format:

{
    "response": {
        "result": [
            {
                "projectId": "2958000000136077"
            }
        ],
        "message": "Project deleted successfully",
        "uri": "/api/timetracker/deleteproject",
        "status": 0
    }
}

Error Response Format:

{
  "response": {
    "message": "Error in deleting project",
    "uri": "/api/timetracker/deleteproject",
    "errors": [
      {
        "code": < error_code >,
        "message": < error_message >
      }],
    "status": 1
}

Error Codes & Messages:

Error CodeError Message
8000No <parameter_name> specified
8001Wrong value for <parameter_name>

Example

Request URL:

http://people.zoho.com/api/timetracker/deleteproject?authtoken=c0f4d58c9c922494c23b76ac919c2b48&projectId=2958000000136077

XML response:

<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/timetracker/deleteproject">
<status>0</status>
<message>Project deleted successfully</message>
<result>
<projectId>2958000000136077</projectId>
</result>
</response>

JSON response:

{
    "response": {
        "result": [ {
                     "projectId": "2958000000136077"
        }]   
        "message": "Project deleted successfully",
        "uri": "api/timetracker/deleteproject",
        "status": 0
    }
}