Project

General

Profile

Rest TimeEntries » History » Version 6

Gaëtan Noël, 2017-05-05 10:30

1 5 Konstantin Ladutenko
(note: for some versions of Redmine you can need some other extension of path /time_entries.xml, e.g. 2.5 works with *.json http://www.redmine.org/boards/2/topics/48933?r=48934#message-48934 , sometimes in plugins it comes simply without any extension)
2
3 1 Jean-Philippe Lang
h1. Time Entries
4
5 4 yuya ito
{{>toc}}
6
7 1 Jean-Philippe Lang
h2. Listing time entries
8
9
  GET /time_entries.xml
10
11
Returns time entries.
12
13 6 Gaëtan Noël
+Parameters+:
14
15
* @offset@
16
* @limit@
17
* @user_id@
18
* @spent_on@
19
* ...
20
21
22 1 Jean-Philippe Lang
h2. Showing a time entry
23
24
  GET /time_entries/[id].xml
25
26
Returns the time entry of given id.
27
28
h2. Creating a time entry
29
30
  POST /time_entries.xml
31
32
Creates a time entry.
33
34
+Parameters+:
35
36
* @time_entry@ (required): a hash of the time entry attributes, including:
37
38
  * @issue_id@ or @project_id@ (only one is required): the issue id or project id to log time on
39
  * @spent_on@: the date the time was spent (default to the current date)
40
  * @hours@ (required): the number of spent hours
41
  * @activity_id@: the id of the time activity. This parameter is required unless a default activity is defined in Redmine.
42
  * @comments@: short description for the entry (255 characters max)
43
44
+Response+:
45
46
  * @201 Created@: time entry was created
47
  * @422 Unprocessable Entity@: time entry was not created due to validation failures (response body contains the error messages)
48
49
h2. Updating a time entry
50
51
  PUT /time_entries/[id].xml
52
53
Updates the time entry of given id.
54
55
+Parameters+:
56
57
* @time_entry@ (required): a hash of the time entry attributes (same as above)
58
59
+Response+:
60
61
  * @200 OK@: time entry was updated
62
  * @422 Unprocessable Entity@: time entry was not updated due to validation failures (response body contains the error messages)
63
64
h2. Deleting a time entry
65
66
  DELETE /time_entries/[id].xml
67
68
Deletes the time entry of given id.