-
Notifications
You must be signed in to change notification settings - Fork 1
/
apiary.apib
168 lines (105 loc) · 4.87 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
FORMAT: 1A
HOST: https://intertech-time-api.azurewebsites.net
# TimeEntry api
TimeEntry API is a time entry service.
# Group BookedTimeEntry
TimeEntry related resources of the **TimeEntry API**
## BookedTimeEntry Collection [/bookedTimeEntries{?userId,startDate,endDate}]
### List all BookedTimeEntries [GET]
+ Parameters
+ userId (required, string, `21EC2020-3AEA-4069-A2DD-08002B30309D`) ... String GUID `userId` of the BookedTimeEntry. Has example value.
+ startDate (optional, date, `2014-05-05T00:00:00`) ... Date `startDate` of the BookedTimeEntry. Has example value.
+ endDate (optional, date, `2014-05-05T00:00:00`) ... Date `endDate` of the BookedTimeEntry. Has example value.
+ Request
+ Header
Authorization: bearer <token>
+ Response 200 (application/json)
[{
"id": 1, "userId": "21EC2020-3AEA-4069-A2DD-08002B30309D", "date": "2014-05-05T00:00:00", "hours": 8, "note": "I worked all day long on Wednesday.", "readonly": false,
"allocation": { "id": 2, "client": "State of Minnesota DEED", "project": "MN Works", "task": "Development" }
}, {
"id": 2, "userId": "31EC2020-3AEA-4069-A2DD-08002B30309D", "date": "2014-05-05T00:00:00", "hours": 8, "note": "I worked all day long on Thursday.", "readonly": true,
"allocation": { "id": 2, "client": "Agribank", "project": "Titaniun", "task": "Testing" }
}]
### Create a BookedTimeEntry [POST]
+ Request (application/json)
+ Header
Authorization: bearer <token>
+ Body
{ "userId": "21EC2020-3AEA-4069-A2DD-08002B30309D", "date": "2014-05-07T00:00:00", "hours": 8, "note": "I worked all day long on Friday.", "allocationId": 1 }
+ Response 201 (application/json)
{ "id": 3, "userId": "21EC2020-3AEA-4069-A2DD-08002B30309D", "date": "2014-05-07T00:00:00", "hours": 8, "note": "I worked all day long on Friday.", "allocationId": 1 }
## BookedTimeEntry [/bookedTimeEntries/{id}]
A single BookedTimeEntry object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the BookedTimeEntry to perform action with. Has example value.
### Update a BookedTimeEntry [PUT]
+ Request (application/json)
+ Header
Authorization: bearer <token>
+ Body
{ "userId": "21EC2020-3AEA-4069-A2DD-08002B30309D", "date": "2014-05-10T00:00:00", "hours": 8, "note": "I worked all day long on Saturday.", "allocationId": 1 }
+ Response 204
### Remove a BookedTimeEntry [DELETE]
+ Response 204
# Group Allocation
Allocation related resources of the **TimeEntry API**
## Allocation Collection [/allocations{?userId}]
### List all Allocations [GET]
+ Parameters
+ userId (required, string, `21EC2020-3AEA-4069-A2DD-08002B30309D`) ... String GUID `userId` of the BookedTimeEntry. Has example value.
+ Request
+ Header
Authorization: bearer <token>
+ Response 200 (application/json)
[{
"id": 1, "client": "State of Minnesota DEED", "project": "MN Works", "task": "Development"
}, {
"id": 2, "client": "Agribank", "project": "Titaniun", "task": "Testing"
}]
## Allocation [/allocations/{id}]
A single Allocation object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Allocation to perform action with. Has example value.
### Retrieve an Allocation [GET]
+ Request
+ Header
Authorization: bearer <token>
+ Response 200 (application/json)
+ Body
{ "id": 1, "client": "State of Minnesota DEED", "project": "MN Works", "task": "Development" }
# Group User
User related resources of the **TimeEntry API**
## User Collection [/users]
### List all Users [GET]
+ Request
+ Header
Authorization: bearer <token>
+ Response 200 (application/json)
[{
"id": "21EC2020-3AEA-4069-A2DD-08002B30309D", "userName": "ckent"
}, {
"id": "31EC2020-3AEA-4069-A2DD-08002B30309D", "userName": "bwayne"
}]
## User [/users/{id}]
A single User object with all its details
+ Parameters
+ id (required, guid, `21EC2020-3AEA-4069-A2DD-08002B30309D`) ... GUID `id` of the User to perform action with. Has example value.
### Retrieve a User [GET]
+ Request
+ Header
Authorization: bearer <token>
+ Response 200 (application/json)
+ Body
{"id": "41EC2020-3AEA-4069-A2DD-08002B30309D", "userName": "pparker"}
## User [/users{?userName}]
A single User object with all its details
+ Parameters
+ userName (required, string, `srogers`) ... String `userName` of the User to perform action with. Has example value.
### Retrieve a User [GET]
+ Request
+ Header
Authorization: bearer <token>
+ Response 200 (application/json)
+ Body
{"id": "51EC2020-3AEA-4069-A2DD-08002B30309D", "userName": "srogers"}