{"_id":"55651b27b893840d00444737","category":{"_id":"55651a0c65a1130d00400c2b","pages":["55651a9c03b6710d00916948","55651b27b893840d00444737","55651cb603b6710d0091694c","55651d35b893840d00444740","55652662eb1615230053fd54","556526c1b60f251900703445","556527157a60a419000627f7"],"project":"5548466bd2c8410d006c2143","version":"5548466bd2c8410d006c2146","__v":7,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-27T01:12:44.934Z","from_sync":false,"order":4,"slug":"timesheets","title":"Timesheets"},"editedParams":true,"parentDoc":null,"version":{"_id":"5548466bd2c8410d006c2146","project":"5548466bd2c8410d006c2143","__v":8,"createdAt":"2015-05-05T04:26:19.796Z","releaseDate":"2015-05-05T04:26:19.796Z","categories":["5548466cd2c8410d006c2147","554a69ba0b54d30d007fe128","554a7f3338e3620d0082192e","5565162e03b6710d00916942","55651a0c65a1130d00400c2b","55651d4565a1130d00400c2f","55651e0165a1130d00400c32","5565217903b6710d0091695f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"5548466bd2c8410d006c2143","editedParams2":true,"user":"555a5da8bcb32e19006f816f","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-27T01:17:27.434Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"var tsDate = $('#tsDate').val() || \"2015-04-16T00:00:00\"\nvar hours = $('#hours').val() || \"8\"\nvar data = {\n                \"adminTypeId\": null,\n                \"date\": tsDate,\n                \"hours\": hours,\n                \"projectId\": projectId,\n                \"taskId\": taskId,\n                \"resouceId\": resourceId,                \n                \"name\": null\n}\n\n$.ajax({\n      type: \"POST\", \n   \t\turl: \"/api/v1/timesheets.json\", \n   \t\tcontentType: 'application/json', \n   \t\tdataType: \"json\", \n   \t\tsuccess: worked, \n   \t\tdata: JSON.stringify(data),\n      headers: { apiKey: apiKey }\n});","language":"json","name":""}]},"method":"post","results":{"codes":[{"name":"","code":"{\n  \tstatus: \"Okay\",\n \t\ttimesheet: {\n        \"adminTypeId\": null,\n        \"date\": \"2015-04-16T00:00:00\",\n        \"hours\": 8,\n        \"projectId\": projectId,\n        \"taskId\": taskId,\n        \"resouceId\": resourceId,\n        \"name\": \"Timesheet desc\"\n\t\t}\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"55651b27b893840d0044473e","ref":"","in":"body","required":true,"desc":"The unique identifier of the resource the timesheet is for.","default":"","type":"int","name":"resourceId"},{"_id":"55651b27b893840d0044473d","ref":"","in":"body","required":true,"desc":"The id of the project that the time is being recorded against.","default":"","type":"int","name":"projectId"},{"_id":"55651b27b893840d0044473c","ref":"","in":"body","required":true,"desc":"The id of the Task that the time is being recorded against. The task must belong to the project  denoted by the project  Id.","default":"","type":"int","name":"taskId"},{"_id":"55651b27b893840d0044473b","ref":"","in":"body","required":true,"desc":"Admin Type Id (e.g. Sick leave). If this field is specified, projectId and taskId can be empty.","default":"","type":"int","name":"adminTypeId"},{"_id":"55651b27b893840d0044473a","ref":"","in":"body","required":true,"desc":"The date that the timesheet entry is for.","default":"","type":"yyyy-mm-dd","name":"date"},{"_id":"55651b27b893840d00444739","ref":"","in":"body","required":true,"desc":"The number of hours recorded by the timesheet entry.","default":"","type":"int","name":"Hours"},{"_id":"55651b27b893840d00444738","ref":"","in":"body","required":false,"desc":"Description of the timesheet entry.","default":"","type":"string","name":"name"}],"url":"/timesheets.json"},"isReference":false,"order":5,"body":"Use this API to retrieve create a Timesheet record.","excerpt":"A Timesheet instance records the number of hours spent on Tasks and Administrative activities for a particular Resource.\n\nA Timesheet entry is for a particular day, and there can only be one Timesheet record per Resource for a particular task or admin type for a specific date.\n\nUse this API to retrieve create a Timesheet record.","slug":"add-a-timesheet","type":"endpoint","title":"Create a Timesheet"}

postCreate a Timesheet

A Timesheet instance records the number of hours spent on Tasks and Administrative activities for a particular Resource. A Timesheet entry is for a particular day, and there can only be one Timesheet record per Resource for a particular task or admin type for a specific date. Use this API to retrieve create a Timesheet record.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

resourceId:
required
integer
The unique identifier of the resource the timesheet is for.
projectId:
required
integer
The id of the project that the time is being recorded against.
taskId:
required
integer
The id of the Task that the time is being recorded against. The task must belong to the project denoted by the project Id.
adminTypeId:
required
integer
Admin Type Id (e.g. Sick leave). If this field is specified, projectId and taskId can be empty.
date:
required
yyyy-mm-dd
The date that the timesheet entry is for.
Hours:
required
integer
The number of hours recorded by the timesheet entry.
name:
string
Description of the timesheet entry.

Examples


Result Format


Documentation

Use this API to retrieve create a Timesheet record.