This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger_spec.json
593 lines (593 loc) · 22.2 KB
/
swagger_spec.json
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
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
{
"info": {
"title": "Meltwater Streaming API v2",
"description": "The Meltwater Streaming API provides the needed resources for Meltwater clients to create & delete REST Hooks and stream Meltwater search results to your specified destination.",
"contact": {
"name": "The Meltwater API Team",
"email": "support@api.meltwater.com"
},
"version": "2.0.0"
},
"swagger": "2.0",
"produces": ["application/xml", "application/json", "application/octet-stream", "text/plain"],
"host": "api.meltwater.com",
"tags": [{
"name": "hooks",
"description": "Operations about hooks"
}, {
"name": "searches",
"description": "Operations about searches"
}, {
"name": "admin",
"description": "Operations about admins"
}, {
"name": "clients",
"description": "Operations about clients"
}, {
"name": "oauth2",
"description": "Operations about oauth2s"
}, {
"name": "_health",
"description": "Operations about _healths"
}, {
"name": "schemas",
"description": "Operations about JSON schemas"
}, {
"name": "_health",
"description": "Operations about _healths"
}, {
"name": "swagger_doc",
"description": "Meltwater API Swagger Spec"
}],
"paths": {
"/v2/hooks": {
"post": {
"summary": "Creates a hook for one of your predefined searches.",
"description": "Creates a hook for one of your predefined searches.\n Delivers search results for the query referenced by the `search_id` to the `target_url` via HTTP POST. Note that a `hook_id` will be returned on successful creation, this id is needed to delete the hook.\n\n We are also returning the header: `X-Hook-Secret`, a shared secret used to sign the document body pushed to your `target_url`.\n\n\n Requires an OAuth access token.",
"produces": ["application/json"],
"consumes": ["application/json"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`Oauth Access Token`\n\n\n\nOAuth access token (RFC 6749). Must contain the access token type `Bearer`\n followed by an OAuth access token.\n\n\n\n#### Example:\n\n\n\n Bearer KKwmfHwxsEoeMDTMAfxOpO...",
"type": "string",
"required": true
}, {
"in": "header",
"name": "X-Hook-Secret",
"description": "Shared secret for content signing/verification.\n\n\n\nThe shared secret header is optional and can be provided by the user or will\n be set by the API. Must be between 16 and 64 characters.\n Obtain the shared secret from the response header `X-Hook-Secret`.\n\n\n\n#### Example:\n\n\n\n e2d264b524240b9572ebc2fc7eebd980",
"type": "string",
"required": false
}, {
"name": "V2Hooks",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/postV2Hooks"
}
}],
"responses": {
"201": {
"description": "Successfully Created",
"schema": {
"$ref": "#/definitions/Hook"
}
},
"400": {
"description": "Missing required parameters."
},
"401": {
"description": "Invalid or expired token."
},
"403": {
"description": "Not entitled to the service"
},
"404": {
"description": "The search you are trying to create a REST\nhook for was not found.",
"schema": {
"$ref": "#/definitions/ErrorsCollection"
}
},
"500": {
"description": "Something went wrong while trying to create\nyour REST hook.",
"schema": {
"$ref": "#/definitions/ErrorsCollection"
}
}
},
"tags": ["hooks"],
"operationId": "createHook"
},
"get": {
"summary": "List all hooks.",
"description": "List all hooks.\n \n\n Delivers all previously generated hooks.\n\n\n\nRequires an OAuth access token.",
"produces": ["application/json"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`Oauth Access Token`\n\n\n\nOAuth access token (RFC 6749). Must contain the access token type `Bearer`\n followed by an OAuth access token.\n\n\n\n#### Example:\n\n\n\n Bearer KKwmfHwxsEoeMDTMAfxOpO...",
"type": "string",
"required": true
}],
"responses": {
"200": {
"description": "List all hooks.",
"schema": {
"$ref": "#/definitions/HooksCollection"
}
},
"401": {
"description": "Invalid or expired token."
},
"403": {
"description": "Not entitled to the service"
},
"500": {
"description": "Something went wrong while trying\nto fetch your hooks. "
}
},
"tags": ["hooks"],
"operationId": "getAllHooks"
}
},
"/v2/hooks/{hook_id}": {
"delete": {
"summary": "Delete an existing hook.",
"description": "Delete an existing hook.\n Removes the hook and stops sending any search results to the target_url.\n\n\n\nRequires an OAuth access token.",
"produces": ["application/json"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`Oauth Access Token`\n\n\n\nOAuth access token (RFC 6749). Must contain the access token type `Bearer`\n followed by an OAuth access token.\n\n\n\n#### Example:\n\n\n\n Bearer KKwmfHwxsEoeMDTMAfxOpO...",
"type": "string",
"required": true
}, {
"in": "path",
"name": "hook_id",
"description": "Hook ID received from creating a hook",
"type": "string",
"required": true
}],
"responses": {
"204": {
"description": "Successfully Deleted"
},
"400": {
"description": "Missing required parameters."
},
"401": {
"description": "Invalid or expired token."
},
"403": {
"description": "Not entitled to the service"
},
"404": {
"description": "The REST hook you are trying to delete was\nnot found"
},
"500": {
"description": "Something went wrong while trying to delete\nyour hook(-s)."
}
},
"tags": ["hooks"],
"operationId": "deleteHook"
}
},
"/v2/searches": {
"get": {
"summary": "List your saved searches.",
"description": "List your saved searches.",
"produces": ["application/json"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`Oauth Access Token`\n\n\n\nOAuth access token (RFC 6749). Must contain the access token type `Bearer`\n followed by an OAuth access token.\n\n\n\n#### Example:\n\n\n\n Bearer KKwmfHwxsEoeMDTMAfxOpO...",
"type": "string",
"required": true
}],
"responses": {
"200": {
"description": "List your saved searches.",
"schema": {
"$ref": "#/definitions/SearchesCollection"
}
},
"400": {
"description": "Missing required parameters."
},
"401": {
"description": "Invalid or expired token."
},
"403": {
"description": "Not entitled to the service"
},
"500": {
"description": "Something went wrong when listing your\nsearches",
"schema": {
"$ref": "#/definitions/ErrorsCollection"
}
}
},
"tags": ["searches"],
"operationId": "getAllSearches"
}
},
"/v2/clients": {
"post": {
"summary": "Register new client",
"description": "Register new client\n \n\n\n Creates a new pair of client credentials (`client_id`/`client_secret`\n pair). Requires your Meltwater credentials (`email`:`password`)\n to authenticate.\n \n\n#### Appendix\n\n\n\nThe Base64-encoded `email`:`password` string can be generated in a terminal\n with following command:\n\n\n\n $ echo -n \"your_email@your_domain.com:your_secret_password\" | base64\n\n\n\n<i>You will need `base64` installed.</i>",
"produces": ["application/json"],
"consumes": ["application/json"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`email`:`password`\n\n\n\nBasic Auth (RFC2617) credentials. Must contain the realm `Basic` followed by a\n Base64-encoded `email`:`password` pair using your Meltwater credentials.\n\n\n\n#### Example:\n\n\n\n Basic bXlfZW1haWxAZXhhbXJzZWNyZXQ=",
"type": "string",
"required": true
}],
"responses": {
"201": {
"description": "Client was successfully created.",
"schema": {
"$ref": "#/definitions/ClientCredentials"
}
},
"400": {
"description": "Client creation failed. Invalid Request"
},
"401": {
"description": "Invalid credentials."
},
"409": {
"description": "Client already exists."
},
"500": {
"description": "Internal failure."
}
},
"tags": ["clients"],
"operationId": "createClientCredentials"
}
},
"/v2/clients/{client_id}": {
"delete": {
"summary": "Delete client.",
"description": "Delete client.\n \n\nDeletes your current client credentials consisting\n of client_id and client_secret. After calling this resource,\n you will not be able to use the Meltwater API unless you create\n a new set of client credentials! Requires your Meltwater\n credentials (`email`:`password`) to authenticate.\n \n\n#### Appendix\n\n\n\nThe Base64-encoded `email`:`password` string can be generated in a terminal\n with following command:\n\n\n\n $ echo -n \"your_email@your_domain.com:your_secret_password\" | base64\n\n\n\n<i>You will need `base64` installed.</i>",
"produces": ["application/json"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`email`:`password`\n\n\n\nBasic Auth (RFC2617) credentials. Must contain the realm `Basic` followed by a\n Base64-encoded `email`:`password` pair using your Meltwater credentials.\n\n\n\n#### Example:\n\n\n\n Basic bXlfZW1haWxAZXhhbXJzZWNyZXQ=",
"type": "string",
"required": true
}, {
"in": "path",
"name": "client_id",
"description": "Client ID",
"type": "string",
"required": true
}],
"responses": {
"204": {
"description": "Client was successfully deleted."
},
"400": {
"description": "Client deletion failed. Invalid Request"
},
"401": {
"description": "Invalid credentials."
},
"404": {
"description": "Client was not found."
},
"500": {
"description": "Internal failure."
}
},
"tags": ["clients"],
"operationId": "deleteClientCredentials"
}
},
"/oauth2/token": {
"post": {
"summary": "Create an access token",
"description": "Create an OAuth2 access token based on the provided\n`client_id` and `client_secret`.\n\n#### Appendix\n\n\n\nThe Base64-encoded `client_id`:`client_secret` string can be generated in a\n terminal with following command:\n\n\n\n $ echo -n \"your_client_id:your_client_secret\" | base64\n\n\n\n<i>You will need `base64` installed.</i>",
"produces": ["application/json"],
"consumes": ["application/x-www-form-urlencoded"],
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}, {
"in": "header",
"name": "Authorization",
"description": "`client_id:client_secret`\n\nBasic Auth (RFC2617)\ncredentials. Must contain the realm `Basic` followed by a Base64-encoded\n`client_id`:`client_secret` pair.\n\n\n#### Example:\n\n Basic aAlfbb1haWxDSXhhDXxxZWKJAyZXQ=",
"type": "string",
"required": true
}, {
"in": "formData",
"name": "grant_type",
"description": "OAuth2 grant type, use `client_credentials`",
"type": "string",
"required": true
}, {
"in": "formData",
"name": "scope",
"description": "OAuth2 scope, use `search`",
"type": "string",
"required": true
}],
"responses": {
"201": {
"description": "Create an access token",
"schema": {
"$ref": "#/definitions/OAuth2Token"
}
}
},
"tags": ["oauth2"],
"operationId": "createToken"
}
},
"/v2/schemas/social_streaming.json": {
"get": {
"summary": "Social Streaming JSON schema",
"description": "Get the JSON schema describing the layout of Social Streaming documents.",
"produces": ["application/json"],
"responses": {
"200": {
"description": "JSON schema for Social Streaming documents"
}
},
"tags": ["schemas"],
"operationId": "getSocialStreamingJsonSchema",
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}]
}
},
"/v2/schemas/editorial_streaming.json": {
"get": {
"summary": "Editorial Streaming JSON schema",
"description": "Get the JSON schema describing the layout of Editorial Streaming documents.",
"produces": ["application/json"],
"responses": {
"200": {
"description": "JSON schema for Editorial Streaming documents"
}
},
"tags": ["schemas"],
"operationId": "getEditorialStreamingJsonSchema",
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}]
}
},
"/v2/swagger_doc": {
"get": {
"summary": "Meltwater API Swagger Spec",
"description": "Get the complete Swagger Spec that describes all Meltwater API endpoints.",
"produces": ["application/json"],
"responses": {
"200": {
"description": "Swagger spec for all Meltwater API endpoints"
}
},
"tags": ["swagger_doc"],
"operationId": "getCompleteSwaggerSpec",
"parameters": [{
"in": "header",
"name": "user-key",
"description": "The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).",
"type": "string",
"required": true
}]
}
}
},
"definitions": {
"postV2Hooks": {
"type": "object",
"properties": {
"target_url": {
"type": "string",
"description": "Target URL to send article results"
},
"search_id": {
"type": "integer",
"format": "int32",
"description": "Search ID"
}
},
"required": ["target_url", "search_id"],
"description": "Creates a hook for one of your predefined searches."
},
"Hook": {
"type": "object",
"properties": {
"search_id": {
"type": "integer",
"format": "int32",
"description": "Search id"
},
"target_url": {
"type": "string",
"description": "The URL that results from the search will be posted to"
},
"updated": {
"type": "string"
},
"search_type": {
"type": "string",
"description": "The type of search the hook is for"
},
"hook_id": {
"type": "string"
}
},
"description": "Creates a hook for one of your predefined searches.\n Delivers search results for the query referenced by the `search_id` to the `target_url` via HTTP POST. Note that a `hook_id` will be returned on successful creation, this id is needed to delete the hook.\n\n We are also returning the header: `X-Hook-Secret`, a shared secret used to sign the document body pushed to your `target_url`.\n\n\n Requires an OAuth access token."
},
"ErrorsCollection": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"$ref": "#/definitions/Error"
}
}
},
"description": "List your saved searches."
},
"Error": {
"type": "object",
"properties": {
"details": {
"type": "string",
"description": "Human-readable error message."
},
"title": {
"type": "string",
"description": "Error title"
},
"type": {
"type": "string",
"description": "Error category"
},
"meta": {
"type": "object",
"description": "Additional meta-information to qualify error"
}
}
},
"HooksCollection": {
"type": "object",
"properties": {
"hooks": {
"type": "array",
"items": {
"$ref": "#/definitions/Hook"
}
}
},
"description": "List all hooks.\n \n\n Delivers all previously generated hooks.\n\n\n\nRequires an OAuth access token."
},
"SearchesCollection": {
"type": "object",
"properties": {
"searches": {
"type": "array",
"items": {
"$ref": "#/definitions/Search"
}
}
},
"description": "List your saved searches."
},
"Search": {
"type": "object",
"properties": {
"search_id": {
"type": "integer",
"format": "int32",
"description": "Search id"
},
"name": {
"type": "string",
"description": "Name of the search"
},
"updated": {
"type": "string",
"description": "Date time of the last update of the search"
},
"type": {
"type": "string",
"description": "The type of results the search returns"
}
}
},
"ClientCredentials": {
"type": "object",
"properties": {
"client_id": {
"type": "string",
"description": "Id of the client"
},
"client_secret": {
"type": "string",
"description": "The secret of the client"
}
},
"description": "Register new client\n \n\n\n Creates a new pair of client credentials (`client_id`/`client_secret`\n pair). Requires your Meltwater credentials (`email`:`password`)\n to authenticate.\n \n\n#### Appendix\n\n\n\nThe Base64-encoded `email`:`password` string can be generated in a terminal\n with following command:\n\n\n\n $ echo -n \"your_email@your_domain.com:your_secret_password\" | base64\n\n\n\n<i>You will need `base64` installed.</i>"
},
"OAuth2Token": {
"type": "object",
"properties": {
"access_token": {
"type": "string",
"description": "The oauth2 access token to use for subsequent API calls"
},
"expires_in": {
"type": "integer",
"format": "int32",
"description": "Time until the token expires in seconds"
},
"scope": {
"type": "string",
"description": "The type of oauth2 scope the token is valid for"
},
"token_type": {
"type": "string",
"description": "The type/realm of the access token"
}
},
"description": "Create an OAuth2 access token based on the provided\n`client_id` and `client_secret`.\n\n#### Appendix\n\n\n\nThe Base64-encoded `client_id`:`client_secret` string can be generated in a\n terminal with following command:\n\n\n\n $ echo -n \"your_client_id:your_client_secret\" | base64\n\n\n\n<i>You will need `base64` installed.</i>"
}
},
"schemes": ["https"]
}