-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints-routes-v1.0.yml
183 lines (175 loc) · 5.25 KB
/
endpoints-routes-v1.0.yml
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
#####################################################################
# Description: schematics for provided endpoints by the server
# Version: 1.0
#
# Changes:
# 11.09.2018 - file creation. version: 1.0 @Markus Jacobsen
# 13.09.2018 - added endpoint for updating a user. Added more response options for createUser
# 13.09.2018 - added endpoints for uploading a file
# 14.09.2018 - added endpoint for deleting a user and getting a user
# 27.09.2018 - added endpoint for showing a list of tracks
# 27.09.2018 - added endpoint for inserting a track record in DB
# 04.10.2018 - added correct header for /insertTrack + private field
# 05.11.2018 - removed user paths
#####################################################################
/getTracks:
method: GET
summary: Get list of IGC tracks
params:
- name: token
type: string
description: IDToken provided by Firebase Auth
required: true
- name: timeSkip
type: string
description: Skip to after this timestamp
required: false (default = 1)
- name: queryType
type: string
description: Type of query to be made
available: Private, Public
required: false (default = Public)
- name: orderDirection
type: string
description: Direction of the order
required: false (default = Asc)
response:
- code: 200
description: List fetched successfully
content-type: application/json
- code: 400
description: bad request, cannot handle the request
content-type: application/json
- code: 403
description: unauthorized, user id cannot be authenticated
content-type: application/json
/insertTrack:
method: POST
header: multipart/form-data
summary: Upload a IGC file to the server
params:
- name: token
type: string
description: IDToken provided by Firebase Auth, put in Header
required: true
- name: private
type: boolean, form-data
description: file private/public
required: true
- name: file
type: string, form-data
description:
required: true
responses:
- code: 200
reason: File successfully processed
content-type: application/json
- code: 400
reason: something went wrong in processing the file or no supplied uid
content-type: application/json
- code: 415
reason: File not off correct mime. We only support .IGC
content-type: application/json
/getTrack:
method: GET
summary: Get an IGC file from the server based on TrackID
params:
- name: token
type: string
description: IDToken provided by Firebase Auth
required: true
- name: trackID
type: string
description: Track ID to get
required: true
response:
- code: 200
description: File fetched successfully
content-type: text/plain
- code: 400
description: bad request, cannot handle the request
content-type: application/json
/deleteTrack:
method: DELETE
summary: Deletes an IGC file from the server based on TrackID
params:
- name: token
type: string
description: IDToken provided by Firebase Auth
required: true
- name: trackID
type: string
description: Track ID to get
required: true
response:
- code: 200
description: File deleted successfully
content-type: text/plain
- code: 400
description: bad request, cannot handle the request
content-type: application/json
/updatePrivacy:
method: PUT
summary: Changes privacy setting of TrackID to new setting
params:
- name: token
type: string
description: IDToken provided by Firebase Auth
required: true
- name: trackID
type: string
description: Track ID to modify
required: true
- name: private
type: string
description: true/false
required: true
response:
- code: 200
description: Privacy updated successfully
content-type: text/plain
- code: 400
description: bad request, cannot handle the request
content-type: application/json
/takeOwnership:
method: PUT
summary: Takes ownership of a trackID that was uploaded by the scraper
params:
- name: token
type: string
description: IDToken provided by Firebase Auth
required: true
- name: trackID
type: string
description: Track ID to take ownership of
required: true
response:
- code: 200
description: Privacy updated successfully
content-type: text/plain
- code: 400
description: bad request, cannot handle the request
content-type: application/json
/insertTrackPoint:
method: PUT
summary: Inserts trackpoint data to a certain track
params:
- name: token
type: string
description: IDToken provided by Firebase Auth
required: true
- name: trackID
type: string
description: Track ID to add trackpoints to
required: true
- name: trackPoints
type: json array with models.TrackPoint
description: Trackpoints to add
required: true
response:
- code: 200
description: Privacy updated successfully
content-type: text/plain
- code: 400
description: bad request, cannot handle the request
content-type: application/json