forked from wurmr/IntertechTimeEntryApi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapiary.apib
More file actions
442 lines (252 loc) · 11.4 KB
/
apiary.apib
File metadata and controls
442 lines (252 loc) · 11.4 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
FORMAT: 1A
# TimeEntry api
TimeEntry API is a time entry service.
# Group BookedTimeEntry
TimeEntry related resources of the **TimeEntry API**
## BookedTimeEntry List [/booked-time-entries{?start_date,end_date}]
### List all BookedTimeEntries [GET]
+ Parameters
+ start_date (optional, date, `2014-05-05`) ... Date `start_date` of the BookedTimeEntry. Has example value.
+ end_date (optional, date, `2014-05-05`) ... Date `end_date` of the BookedTimeEntry. Has example value.
+ Request
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
If-None-Match: W/"11-2535484157"
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
ETag: W/"11-2535484157"
+ Body
[{
"id": 1, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Wednesday.", "read_only": false,
"allocation": { "id": 2, "client": "State of Minnesota DEED", "project": "MN Works", "task": "Development" }
}, {
"id": 2, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Thursday.", "read_only": true,
"allocation": { "id": 2, "client": "Agribank", "project": "Titaniun", "task": "Testing" }
}]
## Your BookedTimeEntry List [/me/booked-time-entries{?start_date,end_date}]
### List all your BookedTimeEntries [GET]
+ Parameters
+ start_date (optional, date, `2014-05-05`) ... Date `start_date` of the BookedTimeEntry. Has example value.
+ end_date (optional, date, `2014-05-05`) ... Date `end_date` of the BookedTimeEntry. Has example value.
+ Request
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
If-None-Match: W/"11-2535484157"
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
ETag: W/"11-2535484157"
+ Body
[{
"id": 1, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Wednesday.", "read_only": false,
"allocation": { "id": 2, "client": "State of Minnesota DEED", "project": "MN Works", "task": "Development" }
}, {
"id": 2, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Thursday.", "read_only": true,
"allocation": { "id": 2, "client": "Agribank", "project": "Titaniun", "task": "Testing" }
}]
## BookedTimeEntry [/booked-time-entries]
### Create a BookedTimeEntry [POST]
+ Request (application/json)
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
+ Body
{ "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-07", "hours": 8, "note": "I worked all day long on Friday.", "allocation": { "id": 1 } }
+ Response 201 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{ "id": 3, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-07", "hours": 8, "note": "I worked all day long on Friday.", "allocation": { "id": 1 } }
## BookedTimeEntry [/me/booked-time-entries]
### Create a BookedTimeEntry for yourself [POST]
+ Request (application/json)
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
+ Body
{ "date": "2014-05-07", "hours": 8, "note": "I worked all day long on Friday.", "allocation": { "id": 1 } }
+ Response 201 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{ "id": 3, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-07", "hours": 8, "note": "I worked all day long on Friday.", "allocation": { "id": 1 } }
## BookedTimeEntry [/me/booked-time-entries/{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 for Yourself [PUT]
+ Request (application/json)
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
+ Body
{ "id": 1, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Saturday.", "allocation": { "id": 1 } }
+ Response 200
+ Header
Request-Id: <UUID>
+ Body
{ "id": 3, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Friday.", "allocation": { "id": 1 } }
### Remove a BookedTimeEntry for Yourself [DELETE]
+ Response 200
+ Header
Request-Id: <UUID>
+ Body
{ "id": 3, "user": { "id": "31EC2020-3AEA-4069-A2DD-08002B30309D" }, "date": "2014-05-10", "hours": 8, "note": "I worked all day long on Friday.", "allocation": { "id": 1 } }
# Group Allocation
Allocation related resources of the **TimeEntry API**
## Allocation Collection [/allocations]
### List all Allocations [GET]
+ Request
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
If-None-Match: W/"11-2535484157"
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
ETag: W/"11-2535484157"
+ Body
[{
"id": 1, "client": "Magic Muffin Factory", "project": "MN Works", "task": "Development", "active": true, "billable": true, "isIntertech": false
}, {
"id": 2, "client": "Acme Inc", "project": "Titaniun", "task": "Testing", "active": false, "billable": true, "isIntertech": false
}]
## Your Allocation Collection [/me/allocations]
### List all your Allocations [GET]
+ Request
+ Header
Authorization: Bearer <token>
Accept: vnd.intertech.v1+json
If-None-Match: W/"11-2535484157"
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
ETag: W/"11-2535484157"
+ Body
[{
"id": 1, "client": "Magic Muffin Factory", "project": "MN Works", "task": "Development", "active": true, "billable": true, "isIntertech": false
}, {
"id": 2, "client": "Acme Inc", "project": "Titaniun", "task": "Testing", "active": false, "billable": true, "isIntertech": false
}]
## 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>
Accept: vnd.intertech.v1+json
If-None-Match: W/"11-2535484157"
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
ETag: W/"11-2535484157"
+ Body
{ "id": 1, "client": "State of Minnesota DEED", "project": "MN Works", "task": "Development" }
## Me [/me]
Information about yourself
## Retrieve your user object [GET]
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{ "name": "Luke", "email": "luke@gmailx.com" }
# Group Authentication
Authentication endpoints
## Token [/token]
Authentication Endpoint to get a bearer token for use in other api endpoints.
## Retrieve a token via SAML [POST]
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Body
{ "grant_type": "saml", "token": "--base64 encoded token--" }
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{ "access_token": "--bearer token--", "token_type": "bearer", "name": "Luke Vader", "email": "a@b.c" }
## Retrieve a token via Password [POST]
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Body
{ "grant_type": "password", "username": "Luke", "password": "theforce" }
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{ "access_token": "--bearer token--", "token_type": "bearer", "name": "Luke Vader", "email": "a@b.c" }
# Group Notifications
## Your Notifications [/me/notifications]
## List your device registrations [GET]
List all of your device registrations, deviceToken means it is apple, gcmRegistrationId indicates google
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Response 200 (application/json)
+ Header
Request-Id: <UUID>
+ Body
[{"id":"123","deviceToken":"4456588DEAR", "gcmRegistrationId": "123456","expires":"2015-06-10T03:54:34.282Z"}]
## Your Apple Devices [/me/notifications/apns]
## Register new Apple device [POST]
Registers a new APNS device
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Body
{"deviceToken": "4456588DEAR"}
+ Response 201 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{"id":"123","deviceToken":"4456588DEAR","expires":"2015-06-10T03:54:34.282Z"}
## Your Google Devices [/me/notifications/gcm]
## Register new Google device [POST]
Registers a new GCM device
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Body
{"gcmRegistrationId": "4456588DEAR"}
+ Response 201 (application/json)
+ Header
Request-Id: <UUID>
+ Body
{"id":"123","gcmRegistrationId":"4456588DEAR","expires":"2015-06-10T03:54:34.282Z"}
## Device Registration [/me/notifications/{id}]
## Delete device [DELETE]
Delets a registered device
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Response 204 (application/json)
+ Header
Request-Id: <UUID>
## Test Notification [/me/notifications/actions/send]
## Send Test Notification [POST]
Sends a test notification to all of your registered devices
+ Request
+ Header
Accept: vnd.intertech.v1+json
Content-Type: application/json
+ Body
{"message": "test notification","count": 100}
+ Response 204 (application/json)
+ Header
Request-Id: <UUID>