@@ -47,6 +47,22 @@ When a user is trying to authenticate via session,
47
47
Resources
48
48
---------
49
49
50
+ This section shows all the resources that are currently available in APIv3.
51
+ There are some URL attributes that applies to all of these resources:
52
+
53
+ :?fields=:
54
+
55
+ Specify which fields are going to be returned in the response.
56
+
57
+ :?omit=:
58
+
59
+ Specify which fields are going to be omitted from the response.
60
+
61
+ :?expand=:
62
+
63
+ Some resources allow to expand/add extra fields on their responses (see _`Project details ` for example).
64
+
65
+
50
66
Projects
51
67
~~~~~~~~
52
68
@@ -74,21 +90,8 @@ Projects list
74
90
"results": ["PROJECT"]
75
91
}
76
92
77
- :>json integer count: total number of projects.
78
- :>json string next: URI for next set of projects.
79
- :>json string previous: URI for previous set of projects.
80
- :>json array results: array of ``project `` objects.
81
-
82
- :query string name: name of the project.
83
- :query string name__contains: part of the name of the project.
84
- :query string slug: slug of the project.
85
- :query string slug__contains: part of the slug of the project.
86
93
:query string language: language code as ``en ``, ``es ``, ``ru ``, etc.
87
- :query string privacy_level: one of ``public ``, ``private ``, ``protected ``.
88
94
:query string programming_language: programming language code as ``py ``, ``js ``, etc.
89
- :query string repository_type: one of ``git ``, ``hg ``, ``bzr ``, ``svn ``.
90
-
91
- :requestheader Authorization: token to authenticate.
92
95
93
96
94
97
Project details
@@ -166,23 +169,17 @@ Project details
166
169
}
167
170
}
168
171
169
- :>json string name: The name of the project.
170
- :>json string slug: The project slug (used in the URL).
171
-
172
- .. TODO: complete the returned data docs once agreed on this.
173
-
174
- :requestheader Authorization: token to authenticate.
175
-
176
- :statuscode 200: Success
177
- :statuscode 404: There is no ``Project `` with this slug
172
+ :query string expand: allows to add/expand some extra fields in the response.
173
+ Allowed values are ``active_versions ``, ``active_versions.last_build `` and
174
+ ``active_versions.last_build.config ``. Multiple fields can be passed separated by commas.
178
175
179
176
180
177
Project create
181
178
++++++++++++++
182
179
183
180
.. http :post :: /api/v3/projects/
184
181
185
- Import a project into Read the Docs .
182
+ Import a project under authenticated user .
186
183
187
184
**Example request **:
188
185
@@ -213,11 +210,6 @@ Project create
213
210
214
211
`See Project details <#project-details >`_
215
212
216
- :requestheader Authorization: token to authenticate.
217
-
218
- :statuscode 201: Created
219
- :statuscode 400: Some field is invalid
220
-
221
213
222
214
Versions
223
215
~~~~~~~~
@@ -255,17 +247,8 @@ Versions listing
255
247
"results": ["VERSION"]
256
248
}
257
249
258
- :>json integer count: Total number of Projects.
259
- :>json string next: URI for next set of Projects.
260
- :>json string previous: URI for previous set of Projects.
261
- :>json array results: Array of ``Version `` objects.
262
-
263
- :query integer limit: limit number of object returned
264
- :query integer offset: offset from the whole list returned
265
- :query boolean active: whether return active versions only
266
- :query boolean built: whether return only built version
267
-
268
- :requestheader Authorization: token to authenticate.
250
+ :query boolean active: return active versions only
251
+ :query boolean built: return only built version
269
252
270
253
271
254
Version detail
@@ -312,21 +295,16 @@ Version detail
312
295
}
313
296
}
314
297
315
- :>json integer id: ID for this version on the database
316
- :>json string slug: The slug for this version
317
- :>json string verbose_name: The name of the version
318
- :>json string identifier: A version control identifier for this version (eg. the commit hash of the tag)
319
- :>json string ref: tag or branch pointed by this version (available only when version is ``stable `` or ``latest ``)
320
- :>json string built: Whether this version has been built
321
- :>json string active: Whether this version is active
322
- :>json string type: The type of this version (typically "tag" or "branch")
323
- :>json string last_build: Build object representing the last build of this version
324
- :>json array downloads: URLs to downloads of this version's documentation
325
298
326
- :requestheader Authorization: token to authenticate.
299
+ :>json string ref: the version slug where the ``stable `` version points to.
300
+ ``null `` when it's not the stable version.
301
+ :>json string build: the version has at least one successful build.
302
+ :>json string uploaded: the version was uploaded manually.
303
+
327
304
328
- :statuscode 200: Success
329
- :statuscode 404: There is no ``Version `` with this slug for this project
305
+ :query string expand: allows to add/expand some extra fields in the response.
306
+ Allowed values are ``last_build `` and ``last_build.config ``.
307
+ Multiple fields can be passed separated by commas.
330
308
331
309
332
310
Version update
@@ -347,10 +325,7 @@ Version update
347
325
348
326
:requestheader Authorization: token to authenticate.
349
327
350
- :statuscode 204: Edited successfully
351
- :statuscode 400: Some field is invalid
352
- :statuscode 401: Not valid permissions
353
- :statuscode 404: There is no ``Version `` with this slug for this project
328
+ :statuscode 204: Updated successfully
354
329
355
330
356
331
Builds
@@ -440,22 +415,14 @@ Build details
440
415
}
441
416
}
442
417
443
- :>json integer id : The ID of the build
444
- :>json string date : The ISO-8601 datetime of the build.
418
+ :>json string created : The ISO-8601 datetime when the build was created.
419
+ :>json string finished : The ISO-8601 datetime when the build has finished .
445
420
:>json integer duration: The length of the build in seconds.
446
421
:>json string state: The state of the build (one of ``triggered ``, ``building ``, ``installing ``, ``cloning ``, or ``finished ``)
447
- :>json boolean success: Whether the build was successful
448
422
:>json string error: An error message if the build was unsuccessful
449
- :>json string commit: A version control identifier for this build (eg. the commit hash)
450
- :>json string builder: The hostname server that built the docs
451
- :>json string cold_storage: Whether the build was removed from database and stored externally
452
423
453
- :query boolean include_config: whether or not include the configs used for this build. Default is ``false ``
454
-
455
- :requestheader Authorization: token to authenticate.
456
-
457
- :statuscode 200: Success
458
- :statuscode 404: There is no ``Build `` with this ID
424
+ :query string expand: allows to add/expand some extra fields in the response.
425
+ Allowed value is ``config ``.
459
426
460
427
461
428
Builds listing
@@ -483,9 +450,7 @@ Builds listing
483
450
}
484
451
485
452
:query string commit: commit hash to filter the builds returned by commit
486
- :query boolean running: whether or not to filter the builds returned by currently building
487
-
488
- :requestheader Authorization: token to authenticate.
453
+ :query boolean running: filter the builds that are currently building/running
489
454
490
455
491
456
Build triggering
@@ -508,11 +473,7 @@ Build triggering
508
473
509
474
`See Build details <#build-details >`_
510
475
511
- :requestheader Authorization: token to authenticate.
512
-
513
- :statuscode 202: Accepted
514
- :statuscode 400: Some field is invalid
515
- :statuscode 401: Not valid permissions
476
+ :statuscode 202: the build was triggered
516
477
517
478
518
479
Subprojects
@@ -549,13 +510,6 @@ Subprojects listing
549
510
"results": ["PROJECT"]
550
511
}
551
512
552
- :>json integer count: total number of projects.
553
- :>json string next: URI for next set of projects.
554
- :>json string previous: URI for previous set of projects.
555
- :>json array results: array of ``project `` objects.
556
-
557
- :requestheader Authorization: token to authenticate.
558
-
559
513
560
514
Translations
561
515
~~~~~~~~~~~~
@@ -588,13 +542,6 @@ Translations listing
588
542
"results": ["PROJECT"]
589
543
}
590
544
591
- :>json integer count: total number of projects.
592
- :>json string next: URI for next set of projects.
593
- :>json string previous: URI for previous set of projects.
594
- :>json array results: array of ``project `` objects.
595
-
596
- :requestheader Authorization: token to authenticate.
597
-
598
545
599
546
Redirects
600
547
~~~~~~~~~
@@ -690,10 +637,7 @@ Redirect create
690
637
691
638
`See Redirect details <#redirect-details >`_
692
639
693
- :requestheader Authorization: token to authenticate.
694
-
695
- :statuscode 201: Created
696
- :statuscode 400: Some field is invalid
640
+ :statuscode 201: redirect created successfully
697
641
698
642
699
643
Redirect update
@@ -727,12 +671,6 @@ Redirect update
727
671
728
672
`See Redirect details <#redirect-details >`_
729
673
730
- :requestheader Authorization: token to authenticate.
731
-
732
- :statuscode 200: Success
733
- :statuscode 400: Some field is invalid
734
-
735
-
736
674
Redirect delete
737
675
++++++++++++++++
738
676
@@ -748,9 +686,7 @@ Redirect delete
748
686
-X DELETE \
749
687
-H "Authorization: Token <token>" https://readthedocs.org/api/v3/projects/pip/redirects/1/
750
688
751
- :requestheader Authorization: token to authenticate.
752
-
753
- :statuscode 204: Deleted successfully
689
+ :statuscode 204: Redirect deleted successfully
754
690
755
691
756
692
Environment Variables
@@ -845,10 +781,7 @@ Environment Variable create
845
781
846
782
`See Environment Variable details <#environmentvariable-details >`_
847
783
848
- :requestheader Authorization: token to authenticate.
849
-
850
- :statuscode 201: Created
851
- :statuscode 400: Some field is invalid
784
+ :statuscode 201: Environment variable created successfully
852
785
853
786
854
787
Environment Variable delete
@@ -868,4 +801,4 @@ Environment Variable delete
868
801
869
802
:requestheader Authorization: token to authenticate.
870
803
871
- :statuscode 204: Deleted successfully
804
+ :statuscode 204: Environment variable deleted successfully
0 commit comments