forked from onejgordon/flow-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
141 lines (141 loc) · 3.29 KB
/
swagger.yaml
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
swagger: '2.0'
info:
description: |
Flow Dashboard APIs
[http://flowdash.co](http://flowdash.co)
version: "1.2"
title: Flow Dashboard
contact:
name: Jeremy Gordon
url: http://jgordon.io
email: onejgordon@gmail.com
license:
name: MIT
url: https://jeremy.mit-license.org/
host: flowdash.co
basePath: /api
schemes:
- https
securityDefinitions:
basicAuth:
description: base64 encode user_email:user_api_password
type: basic
security:
- basicAuth: []
paths:
/tracking:
post:
summary: Submit arbitrary tracking data for a particular date
operationId: submitTracking
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: date
description: Date (YYYY-MM-DD)
type: string
- in: formData
name: data
description: Stringified simple JSON object (keys and values as strings) Will be merged if any existing data has been posted.
type: string
responses:
200:
description: successful update
schema:
type: object
properties:
success:
type: boolean
example: true
message:
type: string
example: "OK"
tracking_day:
$ref: '#/definitions/tracking_day'
/snapshot:
post:
summary: Submit a snapshot
operationId: submitSnapshot
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: lat
description: Latitude
type: string
- in: formData
name: lon
description: Latitude
type: string
- in: formData
name: place
description: Place
type: string
required: true
- in: formData
name: activity
description: Activity
type: string
required: true
- in: formData
name: people
description: People (comma separated)
type: array
collectionFormat: csv
items:
type: string
required: true
- in: formData
name: metrics
description: Stringified JSON object of metrics (keys - metric names, values - integer)
type: string
required: true
responses:
200:
description: successful submission
schema:
type: object
properties:
success:
type: boolean
example: true
message:
type: string
example: "OK"
snapshot:
$ref: '#/definitions/snapshot'
definitions:
snapshot:
type: object
properties:
id:
type: integer
ts:
type: integer
iso_date:
type: string
pattern: '^(\d\d\d\d\-\d\d\-\d\d)$'
people:
type: array
place:
type: string
activity:
type: string
lat:
type: string
lon:
type: string
tracking_day:
type: object
properties:
id:
type: integer
iso_date:
type: string
pattern: '^(\d\d\d\d\-\d\d\-\d\d)$'
data:
type: object