-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathswagger.yaml
2179 lines (2102 loc) · 64.1 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
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
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
swagger: '2.0'
info:
description: >-
The web application that brokers snapshots of webpages archived by various
third parties and 'diffs' between these versions.
version: v0
title: web-monitoring-db
license:
name: GPL 3
url: >-
https://github.com/edgi-govdata-archiving/web-monitoring-db/blob/main/LICENSE
basePath: /api/v0
tags:
- name: pages and versions
description: Logical Pages tracked and their Versions (snapshots)
- name: changes
description: comparisons between two Versions
- name: imports
description: Bulk-importing Versions
securityDefinitions:
BasicAuth:
type: basic
# Technically this should be "bearerAuth", but this is Swagger 2, and that's
# only supported in OpenAPI (Swagger 3).
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
parameters:
sort:
name: sort
in: query
required: false
type: string
description: >
Sort the results. This should be a comma-separated list of sort
values, where each value is in the form `field:order`, e.g.
`title:asc,url:desc`. You can sort by any field on the result
objects.
chunk:
name: chunk
in: query
description: pagination parameter
required: false
type: integer
default: 1
chunk_size:
name: chunk_size
in: query
description: number of items per chunk
required: false
type: integer
default: 100
include_total:
name: include_total
in: query
required: false
type: boolean
default: false
description: >
If true, inlude the number of total results across all chunks as a field
called `meta.total_results`. For example, querying
`/api/v0/pages?include_total` would show the total number of page
records in the database in that field.
Note that `links.last` will only be populated if you are already on the
last chunk *unless this parameter is set to true* (the URL of the
“last” chunk can’t be determined without counting all possible results).
paths:
/pages:
get:
tags:
- pages and versions
summary: List tracked Pages
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- $ref: '#/parameters/chunk'
- $ref: '#/parameters/chunk_size'
- $ref: '#/parameters/include_total'
- $ref: '#/parameters/sort'
- name: url
in: query
description: Match Page url (may include wildcard *).
required: false
type: string
- name: title
in: query
description: >-
Filter results by title. Exact matches only. Unoptimized
performance.
required: false
type: string
- name: include_earliest
in: query
description: >-
If true, add an `earliest` key to each page with the earliest version of it. (Note this is not affected by `capture_time`, which only modifies which *pages* are returned.)
required: false
type: boolean
default: false
- name: include_latest
in: query
description: >-
If true, add a `latest` key to each page with the latest version of it. (Note this is not affected by `capture_time`, which only modifies which *pages* are returned.)
required: false
type: boolean
default: false
- name: source_type
in: query
description: >-
Only include pages with at least one versions of this source type.
required: false
type: string
- name: hash
in: query
description: >-
Only include the pages that have at least one version with this hash.
required: false
type: string
- name: capture_time
type: string
in: query
description: >
Only retrieve pages with versions captured during this time frame. Should be in the format `{start date}..{end date}`, where dates are ISO 8601 formatted. Either date can be left out to make the query open-ended.
**Examples…**
- `capture_time=2017-02-01..2017-03-01` for all of February
- `capture_time=2017-02-01T10:00:00Z..2017-02-01T12:00:00` for February 1st between 10am and noon UTC
- `capture_time=2017-02-01..` for all versions from February on
- `capture_time=..2017-02-01` for all versions before February
- name: 'maintainers[]'
type: string
in: query
description: >
Only retreive pages with maintainers whose `name`
matches the value of this field. You can repeat
this parameter multiple times to match more than one
maintainer, e.g…
?maintainers[]=EPA&maintainers[]=DOE
The values here are not case-sensitive. Repeated
matches are a *UNION* or *OR* style grouping; that
is, you get all pages that have any of the maintainers
requested, not only pages that have all of the
maintainers listed.
- name: 'tags[]'
type: string
in: query
description: >
Only retreive pages with tags whose `name`
matches the value of this field. You can repeat
this parameter multiple times to match more than one
tag, e.g…
?tags[]=site:EPA&tags[]=frequently_updated
The values here are not case-sensitive. Repeated
matches are a *UNION* or *OR* style grouping; that
is, you get all pages that have any of the tags
requested, not only pages that have all of the
tags listed.
- name: active
in: query
description: >-
If set, only include pages that are either active (when set to
`true`) or inactive (when set to `false`). (If unset, you get all
pages.) “Inactive” pages are pages that are no longer updated with
new versions in the database.
required: false
type: boolean
- name: status
in: query
type: string
required: false
description: >-
Include only pages with the given HTTP status code, e.g. `200` or
`404`. You may also specify a range using standard mathematical
notation for intervals. For example, to get pages with 4XX statuses:
?status=[400,500)
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfPages'
'/pages/{page_id}':
get:
tags:
- pages and versions
summary: Get a specific Page
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return
required: true
type: string
format: uuid4
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SinglePage'
'/pages/{page_id}/versions':
get:
tags:
- pages and versions
summary: Get all the Versions for a specific Page
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return
required: true
type: string
format: uuid4
- $ref: '#/parameters/chunk'
- $ref: '#/parameters/chunk_size'
- $ref: '#/parameters/sort'
- name: capture_time
in: query
description: >-
filter by capture time; may also be specified as a range given as
time..time such as 2017-04-01T10:00Z..2017-04-01T12:00Z
required: false
type: string
- name: source_metadata[:key]
type: string
in: query
description: >-
Filter results by a given `key` in the `source_metadata` field. You
can include this parameter multiple times to filter by more than
one `key`. *Note that this field is not indexed, so these queries
can be slow.* Examples…
- `/api/v0/versions?source_metadata[version_id]=12345678`
- `/api/v0/versions?source_metadata[account]=versionista1&source_metadata[has_content]=true`
🚫 You must be logged in to use this parameter!
- name: different
in: query
description: >-
If false, include all versions, not just ones that are different from their preceding version.
required: false
type: string
default: true
- name: include_change_from_previous
in: query
type: boolean
required: false
default: false
description: >
If present, include a `change_from_previous` field in the result
that represents a change object between this version and the
previous version of this page.
🚫 You must be logged in to use this parameter!
- name: include_change_from_earliest
in: query
type: boolean
required: false
default: false
description: >
If present, include a `change_from_earliest` field in the result
that represents a change object between this version and the
earliest version of this page.
- name: status
in: query
type: string
required: false
description: >-
Include only versions with the given HTTP status code, e.g. `200` or
`404`. You may also specify a range using standard mathematical
notation for intervals. For example, to get all 4XX status versions:
?status=[400,500)
🚫 You must be logged in to use this parameter!
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfVersions'
post:
tags:
- pages and versions
summary: Submit one new Version (see also imports)
description: >-
Add a single new version of a page to the database. For importing
multiple versions at a time, use the `/imports` API.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return
required: true
type: string
format: uuid4
- name: uuid
in: query
description: uuid of new Version to store
required: true
type: string
format: uuid4
- name: capture_time
in: query
description: capture_time new Version to store
required: true
type: string
format: datetime
- name: body_url
in: query
description: URL of content of new Version to store
required: true
type: string
- name: body_hash
in: query
description: sha256 hash of Version content
required: true
type: string
- name: source_type
in: query
description: 'source, such as internet_archive'
required: true
type: string
- name: source_metadata
in: query
description: >-
A JSON blob containing extra source specific information. This
field is free-form, but we generally expect the data will follow
one of the formats documented under the models section that has a
name starting with "source_metadata_" For example:
source_metadata_versionista
type: string
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleVersion'
'/pages/{page_id}/sampled':
get:
tags:
- pages and versions
summary: Get one version per day of a specific page.
description: >
⚠️ This endpoint is experimental, and may change!
Use this endpoint to get a lighter-weight history of a page's versions
by sampling at most one version per day. The result is an array of
objects representing each day, each with a complete Version object and a
count of versions on that day. Only days with captured versions are
included.
If you are displaying a history for a particular page (particularly a
frequently captured page, like `https://www.epa.gov/`), this can be a
more efficient and quick way to load the relevant information you might
need, rather than requesting every version of the page from
`/pages{page_id}/versions`.
As with other list endpoints, results are chunked. Follow the
`links.next` property of the response to get the next chunk of results.
(You can also iterate by manually making requests with sequential
`capture_time` parameters, but the `links.next` property willskip past
empty time ranges automatically for more efficient querying.)
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return
required: true
type: string
format: uuid4
- name: capture_time
in: query
description: >-
filter by capture time; may also be specified as a range given as
time..time such as 2017-04-01T10:00Z..2017-04-01T12:00Z
required: false
type: string
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfVersionDateSample'
'/pages/{page_id}/versions/{version_id}':
get:
tags:
- pages and versions
summary: Get a specific Version
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose Version this is
required: true
type: string
format: uuid4
- name: version_id
in: path
description: ID of the Version to show
required: true
type: string
format: uuid4
- name: include_change_from_previous
in: query
type: boolean
required: false
default: false
description: >
If present, include a `change_from_previous` field in the result
that represents a change object between this version and the
previous version of this page.
🚫 You must be logged in to use this parameter!
- name: include_change_from_earliest
in: query
type: boolean
required: false
default: false
description: >
If present, include a `change_from_earliest` field in the result
that represents a change object between this version and the
earliest version of this page.
🚫 You must be logged in to use this parameter!
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleVersion'
'/pages/{page_id}/changes':
get:
tags:
- changes
summary: List Changes between two Versions on a page
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose Change this is
required: true
type: string
format: uuid4
- $ref: '#/parameters/chunk'
- $ref: '#/parameters/chunk_size'
- $ref: '#/parameters/include_total'
- $ref: '#/parameters/sort'
- name: priority
in: query
description: Only include changes with a matching `priority`. This can be a number (to get an exact match) or an interval using standard mathematical syntax, e.g. `[0.3,0.6)` for `0.3 <= priority < 0.6`. You can leave out the start or end, e.g. `[0.3,]` for `priority >= 0.3`.
required: false
type: number
- name: significance
in: query
description: Only include changes with a matching `significance`. This can be a number (to get an exact match) or an interval using standard mathematical syntax, e.g. `[0.3,0.6)` for `0.3 <= significance < 0.6`. You can leave out the start or end, e.g. `[0.3,]` for `significance >= 0.3`.
required: false
type: number
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfChanges'
'/pages/{page_id}/changes/{from_version}..{to_version}':
get:
tags:
- changes
summary: Get a Change between two Versions
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose Change this is
required: true
type: string
format: uuid4
- name: from_version
in: path
description: ID of the "before" Version. If omitted, it will be treated as the version immediately prior to `to_version`.
required: false
type: string
format: uuid4
- name: to_version
in: path
description: ID of the "after" Version
required: true
type: string
format: uuid4
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleChange'
'/pages/{page_id}/changes/{from_version}..{to_version}/annotations':
get:
tags:
- changes
summary: List Anonotations for a Change between two Versions
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose Version this is
required: true
type: string
format: uuid4
- name: from_version
in: path
description: >-
ID of the "before" Version. If omitted, it will be treated as the
version immediately prior to `to_version`.
required: false
type: string
format: uuid4
- name: to_version
in: path
description: ID of the "after" Version
required: true
type: string
format: uuid4
- $ref: '#/parameters/chunk'
- $ref: '#/parameters/chunk_size'
- $ref: '#/parameters/include_total'
- $ref: '#/parameters/sort'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfAnnotations'
post:
tags:
- changes
summary: Add/update an annotation on a Change between two versions
description: >-
The POST body should be a JSON object containing any data desired.
Users can only make one annotation per Change. If the currently
signed-in user has not annotated the change between these two versions,
a new annotation will be created, otherwise their previous annotation
will be replaced.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose Change this is
required: true
type: string
format: uuid4
- name: from_version
in: path
description: >-
ID of the "before" Version. If omitted, it will be treated as the
version immediately prior to `to_version`.
required: false
type: string
format: uuid4
- name: to_version
in: path
description: ID of the "after" Version
required: true
type: string
format: uuid4
- name: annotation
in: body
required: true
schema: {}
description: >-
The body is the annotation you wish to add to the change. It is a
JSON object with keys and values desired.
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Annotation'
'/pages/{page_id}/changes/{from_version}..{to_version}/annotations/{annotation_id}':
get:
tags:
- changes
summary: Single Anonotations for a Change between two Versions
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose Version this is
required: true
type: string
format: uuid4
- name: from_version
in: path
description: >-
ID of the "before" Version. If omitted, it will be treated as the
version immediately prior to `to_version`.
required: false
type: string
format: uuid4
- name: to_version
in: path
description: ID of the "after" Version
required: true
type: string
format: uuid4
- name: annotation_id
in: path
description: ID of the annotation
required: true
type: string
format: uuid4
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleAnnotation'
'/pages/{page_id}/changes/{from_version}..{to_version}/diff/{diff_type}':
get:
tags:
- changes
summary: Generate a diff between the two versions in a change.
description: >-
The system can generate diffs according to a variety of algorithms. Most of these are provided by the `web-monitoring-processing` project. Some diffs can take query parameters for greater customization.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page whose versions are being diffed
required: true
type: string
format: uuid4
- name: from_version
in: path
description: >-
ID of the "before" Version. If omitted, it will be treated as the
version immediately prior to `to_version`.
required: false
type: string
format: uuid4
- name: to_version
in: path
description: ID of the "after" Version
required: true
type: string
format: uuid4
- name: diff_type
in: path
description: >
Type of diff to generate. Possible values are…
* `length` - the difference between length, in bytes, of each version
* `identical_bytes` - a boolean indicating whether the two versions are identical
* `side_by_side_text` - the visible text of each version formatted as
```
{a_text: "string", b_text: "string"}
```
* `links` - changes to the text or URL of links on the page. This generates an HTML page describing the changes.
* `links_json` - the same as `links` but the changes in JSON format:
```
{
change_count: integer,
diff: [
[0, {text: "Text of an unchanged link", href: "/unchanged/url"}],
[-1, {text: "Text of removed link", href: "/removed/url"}], // Removed
[1, {text: "Text of added link", href: "/added/url"}],
[
// Changed links have `100` for the first item, and the second part has
// a diff in the same format as `html_source_dmp` for each of the
// `text` and `href` properties.
100,
{
text: [[0, "Unchanged text"], [-1, "Removed text"], [1, "Added text"], ...],
href: [[0, "/unchaged"], [-1, "/old-part"], [1, "/new-part"], ...]
}
]
]
}
```
* `html_source_dmp` - additions and removals to the actual source code, formatted as:
```
[
[-1, "some text that was removed"],
[1, "some text that was added"],
[0, "some text that was not changed"],
[1, "some text that was added"],
// and so on
]
```
* `html_text_dmp` - additions and removals to the visible text on the page, formatted as:
```
[
[-1, "some text that was removed"],
[1, "some text that was added"],
[0, "some text that was not changed"],
[1, "some text that was added"],
// and so on
]
```
* `html_token` - an HTML page with differences marked up. This is meant to be rendered directly in a web browser.
required: true
type: string
enum:
- length
- identical_bytes
- side_by_side_text
- links
- links_json
- html_source_dmp
- html_text_dmp
- html_token
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Diff'
'/pages/{page_id}/maintainers':
get:
tags:
- pages and versions
summary: Get all the maintainers of a specific Page
description: >
Maintainers are individuals or organizations who manage
or publish a Page.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return maintainers for
required: true
type: string
format: uuid4
- $ref: '#/parameters/chunk'
- $ref: '#/parameters/chunk_size'
- $ref: '#/parameters/include_total'
- $ref: '#/parameters/sort'
- name: parent
in: query
description: >-
Only return maintainers whose parent has this UUID.
required: false
type: string
format: uuid4
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfMaintainerships'
post:
tags:
- pages and versions
summary: Add a maintainer to a page
description: >
Add a maintainer to a page. The maintainer can be a pre-existing one attached to another page or it can be a completely new maintainer.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return maintainers for
required: true
type: string
format: uuid4
- name: '[body]'
in: body
description: >
The request body should be a JSON object. If the
`uuid` parameter is specified, all others will be
ignored.
required: true
schema:
$ref: '#/definitions/MaintainerPost'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleMaintainership'
'/pages/{page_id}/maintainers/{maintainer_id}':
get:
tags:
- pages and versions
summary: Get a maintainer as attached to a page
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return maintainers for
required: true
type: string
format: uuid4
- name: maintainer_id
in: path
description: ID of the maintainer to get
required: true
type: string
format: uuid4
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleMaintainership'
delete:
tags:
- pages and versions
summary: Remove a maintainer from a page
description: >-
Removes a maintainer from a page. This does not actually
delete the maintainer itself.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to remove the maintainer from
required: true
type: string
format: uuid4
- name: maintainer_id
in: path
description: ID of the maintainer to remove
required: true
type: string
format: uuid4
responses:
'302':
description: On success, you will be redirected to the list of all maintainers on the page.
'/pages/{page_id}/tags':
get:
tags:
- pages and versions
summary: Get all the tags on a specific Page
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return tags for
required: true
type: string
format: uuid4
- $ref: '#/parameters/chunk'
- $ref: '#/parameters/chunk_size'
- $ref: '#/parameters/include_total'
- $ref: '#/parameters/sort'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/PageOfTaggings'
post:
tags:
- pages and versions
summary: Add a tag to a page
description: >
Add a tag to a page. The tag can be a pre-existing one attached to another page or it can be a completely new tag.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to add the tag to
required: true
type: string
format: uuid4
- name: '[body]'
in: body
description: >
The request body should be a JSON object. If the
`uuid` parameter is specified, all others will be
ignored.
required: true
schema:
$ref: '#/definitions/TagPost'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleTagging'
'/pages/{page_id}/tags/{tag_id}':
get:
tags:
- pages and versions
summary: Get a tag as attached to a particular page.
description: ''
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to return tags for
required: true
type: string
format: uuid4
- name: tag_id
in: path
description: ID of the tag to get
required: true
type: string
format: uuid4
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/SingleTagging'
delete:
tags:
- pages and versions
summary: Remove a tag from a page
description: >-
Removes a tag from a page. This does not actually
delete the tag itself.
consumes:
- application/json
produces:
- application/json
parameters:
- name: page_id
in: path
description: ID of Page to remove the tag from
required: true
type: string
format: uuid4
- name: tag_id
in: path
description: ID of the tag to remove
required: true
type: string