-
Notifications
You must be signed in to change notification settings - Fork 0
/
webserver_api_spec.yaml
195 lines (193 loc) · 5.8 KB
/
webserver_api_spec.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
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
openapi: 3.0.0
info:
title: Marketplace Notifier API
version: 1.0.0
description: API for managing marketplace queries (add, remove, get). Check out the examples.
servers:
- url: http://localhost:5000
paths:
/query/add:
post:
summary: Add a new query
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [query]
properties:
query:
type: string
location_filter:
type: object
properties:
city_or_postal_code:
type: string
radius:
type: integer
price_range:
type: object
properties:
min_price_cents:
type: integer
max_price_cents:
type: integer
examples:
minimal:
summary: minimal example
value:
query: iPad
full:
summary: full example using all properties
value:
query: iPhone 14 Pro
location_filter:
city_or_postal_code: "9000"
price_range:
min_price_cents: 0
max_price_cents: 10000
responses:
'200':
description: Query created successfully
content:
application/json:
schema:
type: object
required: [id, query, browser_query_url, request_query_url]
properties:
id:
type: integer
query:
type: string
browser_query_url:
type: string
location_filter:
type: object
properties:
city:
type: string
postal_code:
type: integer
radius:
type: integer
price_range:
type: object
properties:
min_price_cents:
type: integer
max_price_cents:
type: integer
request_query_url:
type: string
examples:
minimal:
summary: response of minimal request
value:
id: 0
query: iPad
browser_query_url: "https://www.2dehands.be/q/ipad/#Language:all-languages|sortBy:SORT_INDEX|sortOrder:DECREASING|searchInTitleAndDescription:true"
request_query_url: "https://www.2dehands.be/lrp/api/search?attributesByKey[]=Language%3Aall-languages&attributesByKey[]=offeredSince%3AGisteren&limit=30&offset=0&query=ipad&searchInTitleAndDescription=true&sortBy=SORT_INDEX&sortOrder=DECREASING&viewOptions=list-view"
location_filter: null
price_range: null
'500':
description: Query already exists
content:
application/json:
schema:
type: object
properties:
error:
type: string
example:
error: Query already exists
/query:
get:
summary: Get all queries
responses:
'200':
description: A list of queries
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
request_url:
type: string
marketplace:
type: string
query:
type: string
/query/{query_info_id}:
get:
summary: Get a query by ID
parameters:
- in: path
name: query_info_id
schema:
type: integer
required: true
description: The ID of the query
responses:
'200':
description: Query details
content:
application/json:
schema:
type: object
properties:
id:
type: integer
query:
type: string
request_query_url:
type: string
marketplace:
type: string
'404':
description: Query not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
example:
error: Not Found
delete:
summary: Delete a query by ID
parameters:
- in: path
name: query_info_id
schema:
type: integer
required: true
description: The ID of the query
responses:
'200':
description: Query deleted
content:
application/json:
schema:
type: object
properties:
message:
type: string
example:
message: Query deleted
/ping:
get:
summary: Ping the server
responses:
'200':
description: Server is alive
content:
text/plain:
schema:
type: string
example: pong