-
Notifications
You must be signed in to change notification settings - Fork 1
/
sol-search-1.0.0-swagger.yaml
403 lines (401 loc) · 10.5 KB
/
sol-search-1.0.0-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
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
swagger: '2.0'
info:
description: Remote storage and filtering for groups' smallads
version: 1.0.0
title: Solsearch API
contact:
url: http://matslats.net/contact
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
# all paths will be relative to the basePath specified
# basePath: /v1
tags:
- name: admin
description: Secured Admin-only calls
schemes:
- https
paths:
/{type}:
get:
summary: Get a selection of ads
operationId: filterads
consumes:
- application/json
produces:
- application/json
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- name: type
in: path
description: the type of ad, e.g. offer, want
type: string
required: true
- name: limit
default: 10
in: query
description: number of results to return, defaults to 10
required: false
type: integer
- name: offset
default: 0
in: query
description: Position of first search result to show.
required: false
type: integer
- name: fragment
in: query
description: String on which to filter the transaction description
required: false
type: string
- name: circle
in: query
description: The circle around which to search (array of lat, lon, radius in km)
required: false
type: number
format: string
- name: sortby
in: query
description: "Fieldname to sort by from the list of transaction fields, optionally followed by a comma and asc or desc e.g. title,desc. Note special value: distance"
required: false
type: string
- name: directexchange
in: query
description: "Include ads where barter is expected"
required: false
type: boolean
default: true
- name: indirectexchange
in: query
description: "include ads where community currency is expected"
required: false
type: boolean
default: true
- name: money
in: query
description: "Include ads where money is equired"
required: false
type: boolean
default: true
- name: lang
in: query
description: "Filter using 2 letter language code"
required: false
type: string
responses:
200:
description: List of full ad objects
schema:
$ref: '#/definitions/Result'
options:
summary: A list of the ad types
operationId: listAdTypes
produces:
- application/json
responses:
200:
description: an array of type names
/{type}/{uuid}:
put:
summary: Insert or update an existing ad
operationId: upsertAd
consumes:
- application/json
produces:
- application/json
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- name: type
in: path
description: The unique ID of the client
required: true
type: string
- name: uuid
in: path
description: The unique ID of the client
required: true
type: string
- in: body
name: body
description: Ad object to be stored
required: true
schema:
$ref: '#/definitions/Ad'
responses:
400:
description: Invalid ID supplied
404:
description: Ad not found
405:
description: Validation exception
delete:
summary: Delete an ad
operationId: deleteAd
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- name: uuid
in: path
description: The unique ID of the ad
required: true
type: integer
responses:
200:
description: no body
/client:
get:
summary: Get a list of all the groups
operationId: getClient
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
responses:
200:
description: List of registered clients with stats..
schema:
type: array
items:
$ref: '#/definitions/Client'
post:
summary: Add a client
operationId: addClient
consumes:
- application/json
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- in: body
name: client
description: CLient to add
schema:
$ref: '#/definitions/Client'
responses:
201:
description: Successful addition
/client/{id}:
put:
summary: Edit a client
operationId: editClient
consumes:
- application/json
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- name: id
in: path
description: The unique ID of the client
required: true
type: integer
- in: body
name: transaction
description: Inventory item to add
schema:
$ref: '#/definitions/Client'
responses:
200:
description: The full transaction object
schema:
$ref: '#/definitions/Ad'
delete:
summary: Delete a client
operationId: deleteClient
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- name: id
in: path
description: The unique ID of the client
required: true
type: integer
responses:
200:
description: no body
/bulk/{type}:
post:
summary: upload many ads
operationId: bulkAdd
consumes:
- application/json
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- name: type
description: the typeof ad
in: path
type: string
required: true
- in: body
name: body
description: the ads to be uploaded
required: true
schema:
type: array
items:
$ref: '#/definitions/Ad'
responses:
200:
description: no body
/:
delete:
summary: delete many ads
operationId: bulkDelet
consumes:
- application/json
parameters:
- name: apikey
in: header
description: API key identifying and logging in
required: true
type: string
- in: body
name: body
description: array of the uuids of the ads to be deleted
required: true
schema:
type: array
items:
type: string
responses:
200:
description: no body
definitions:
Ad:
type: object
properties:
id:
type: integer
format: int64
description: the unique ID
example: 999
group_id:
type: integer
format: int64
description: the unique ID of the group
example:
type:
type: string
description: either 'offer' or 'want'
example: offer
uuid:
type: integer
format: int64
description: the unique ID
example: 999
title:
type: string
description: headline or strapline
example: 'Man + van'
body:
type: string
description: Full HTML description
example: 'Available office hours within 20km'
keywords:
type: string
description: some other words to search by
example: "transport lift carry"
created:
type: string
format: date
description: The unixtime this smallad was created
example: 2017-04-27T19:24:30 Z
expires:
type: string
format: date
description: "when the ad reverts to private scope https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14"
example: 2017-10-27T19:24:30 Z
image:
type: string
format: url
description: the file in base64 or filename, not sure which
example: http://example.com/image.jpg
scope:
type: integer
description: How widely this ad can be seen
enum:
- private
- group
- community
- network
- public
example: community
location:
type: string
format: point
description: Approx location of the advertiser's home
example: POINT(1 60.082736)
directexchange:
type: boolean
description: true if direct barter exchange is acceptable
indirectexchange:
type: boolean
description: true if in-kind reciprocation or community currency is acceptable
money:
type: boolean
description: true if costs would be covered by money
path:
type: string
description: the path to the canonical ad, relative to the hosting site root, without leading slash (to server)
url:
type: string
description: the absolute url (from server)
lang:
type: string
description: The two letter language code
Client:
type: object
properties:
apikey:
type: string
description: a secret string
example: 90df8afmmaskskk7756bdkdd
name:
type: string
description: The friendly name of the group
example: My happy group
url:
type: string
description: The base url of the group
example: myhappygroup.net
Result:
type: object
properties:
total:
type: integer
description: The total number of results
example: 33
items:
type: array
description: The total number of results
items:
$ref: '#/definitions/Ad'
# Added by API Auto Mocking Plugin
host: virtserver.swaggerhub.com
# basePath: /matslats/transaction-storage/1.0.0
# Added by API Auto Mocking Plugin
basePath: /matslats/sol-search/1.0.0