Timesheets

Use Timesheets endpoints to manage timesheet entries in CMap


Get Timesheet Entry

HTTP GET v1/timesheets/5 

Returns an individual timesheet entry

{ 
	"id" : 34543, 
	"date" : "2015-09-21",
	"taskId" : 2343,
	"projectId" : 5413,
	"internalCodeId" : null,
	"contractId" : null,
	"hours" : 7.5,
	"notes" : "Working hard in this project",
	"roleId" : 345,
	"workTypeId" : null,
	"contractWorkTypeId" : null,
	"additionalTime" : false
}

Get Entries in Week

HTTP GET v1/timesheets?week=2015-09-21

Returns all the timesheet entries for the timesheet week, if the timesheet week is omitted then the user's current timesheet week data is returned

Response

[
  { 
	"id" : 2423,
	"hours" : 7.5,
	"date" : "2015-07-01",
	"notes" : "Lots of coding",
	"projectId" : 3424,
	"contractId" : null,
	"internalCodeId" : null,
	"project" : "1003 - The Coding Project",
	"contract" : "",
	"internalCode" : "",
	"taskId" : 34534,
	"roleId" : 4234
  },
  //...
]

Get Entries For Project In Week

HTTP GET v1/timesheets?week=2015-09-21&projectId=[id]

Returns all the timesheet entries for the specified week and specified projectId

Response

[
  { 
	"id" : 2423,
	"hours" : 7.5,
	"date" : "2015-07-01",
	"notes" : "Lots of coding",
	"projectId" : 3424,
	"contractId" : null,
	"internalCodeId" : null,
	"project" : "1003 - The Coding Project",
	"contract" : "",
	"internalCode" : "",
	"taskId" : 34534,
	"roleId" : 4234
  },
  //...
]

Get Entries For Internal Code In Week

HTTP GET v1/timesheets?week=2015-09-21&internalCodeId=[id]

Returns all the timesheet entries for the specified week and specified internalcodeId

Response

[
  { 
	"id" : 2423,
	"hours" : 7.5,
	"date" : "2015-07-01",
	"notes" : "Lots of coding",
	"projectId" : null,
	"contractId" : null,
	"internalCodeId" : 456456,
	"project" : "",
	"internalCode" : "Internal Meeting",
	"taskId" : 34534,
	"roleId" : 4234 
  },
  //...
]

Get Entries On Date

HTTP GET v1/timesheets?date=2015-09-21

Returns all the timesheet entries for the specified date

Response

[
  { 
	"id" : 2423,
	"hours" : 7.5,
	"date" : "2015-07-01",
	"notes" : "Lots of coding",
	"projectId" : 3424,
	"contractId" : null,
	"internalCodeId" : null,
	"project" : "1003 - The Coding Project",
	"contract" : "",
	"internalCode" : "",
	"taskId" : 34534,
	"roleId" : 4234
  },
  //...
]

Get Project Activity Codes

HTTP GET v1/timesheets/projectactivities

Returns all the project activity codes for the client

Response

[
	{
		"projectId" : 123,
		"workActivityId" : 1
	},
	{
		"projectId" : 123,
		"workActivityId" : 3
	}
]

Get Timesheet Roles

HTTP GET v1/timesheets/roles

Returns the roles available for each task for projects that are listed on the users' current timesheet week

Response

[
	{
		"taskId" : 345,
		"budgetRoles" : [{"budgetRoleID":1, "Designer"},{"budgetRoleID":2, "Developer"}]
	},
	{
		"taskId" : 654,
		"budgetRoles" : [{"budgetRoleID":1, "Designer"},{"budgetRoleID":2, "Developer"}]
	}
]

Get Project Tasks

HTTP GET v1/timesheets/tasks?projectId=23423

Returns all the tasks associated to the project

Response

{
	"tasks":[
      {
	    "BudgetSectionID" : 34534,
	    "BudgetTaskID" : 243,
	    "Name" : "Task One",
	    "OrderNo" : 1,
	    "PercentageComplete" : 50,
	    "Section" : "Section One",
    	"Tab" : "Development"
	},{
	    "BudgetSectionID" : 34534,
	    "BudgetTaskID" : 345,
	    "Name" : "Task Two",
	    "OrderNo" : 2,
	    "PercentageComplete" : 25,
	    "Section" : "Section One",
	    "Tab" : "Development"
	}
  ]
}

Create Timesheet Entry

HTTP POST v1/timesheets/

Creates a timesheet entry and returns the id of the new entry

Response

{ 
	"date" : "2015-09-21",
	"taskId" : 2343,
	"projectId" : 5413,
	"internalCodeId" : null,
	"contractId" : null,
	"hours" : 7.5,
	"notes" : "Working hard in this project",
	"roleId" : 345,
	"workTypeId" : null,
	"contractWorkTypeId" : null,
	"additionalTime" : false
}

Update Timesheet Entry

HTTP PUT v1/timesheets

Updates a timesheet entry

Response

{ 
	"id" : 34543, 
	"date" : "2015-09-21",
	"taskId" : 2343,
	"projectId" : 5413,
	"internalCodeId" : null,
	"contractId" : null,
	"hours" : 7,
	"notes" : "Working hard in this project, now with extra notes",
	"roleId" : 345,
	"workTypeId" : null,
	"contractWorkTypeId" : null,
	"additionalTime" : false
}j

Delete Timesheet Entry

HTTP DELETE v1/timesheets/65

Deletes the timesheet entry

Response

{ 
	"result" : true
}

Add Timesheet Section

HTTP POST v1/timesheets/AddRow?week&projectId&internalCodeId

Adds a project or internal code to the users timesheet week. Supply either the projectId or internalCodeId but not both


Remove Timesheet Section

HTTP DELETE v1/timesheets/RemoveRow?week&projectId&internalCodeId

Removes a project or internal code from the users timesheet week. Supply either the projectId or internalCodeId but not both


Submit Current Timesheet Week

HTTP POST v1/timesheets/submit

Submits the current user’s current timesheet week