diff --git a/cl/api/templates/pacer-api-docs-vlatest.html b/cl/api/templates/pacer-api-docs-vlatest.html index ef67587ad7..b4fbc8d9ce 100644 --- a/cl/api/templates/pacer-api-docs-vlatest.html +++ b/cl/api/templates/pacer-api-docs-vlatest.html @@ -95,6 +95,23 @@
{% url "docketen
"{% get_full_host %}{% url "docketentry-list" version=version %}?docket=4214664"
Such a request will return up to 20 docket entries per page. Each docket entry returned can contain a number of nested documents in the recap_document
key, including their full extracted text (see details in the next section below). As a result, this response can be quite large.
+ You can also order the results using specific fields. To order results, use the order_by
query parameter. For example, to order docket entries by their filing date in ascending order:
+
+ curl -v \
+ --header 'Authorization: Token {% if user.is_authenticated %}{{ user.auth_token }}{% else %}<your-token-here>{% endif %}' \
+ "{% get_full_host %}{% url "docketentry-list" version=version %}?order_by=date_filed"
+ To order in descending order, prepend a -
to the field name. For example, ?order_by=-date_filed
will order by filing date in descending order.
+
+ The following fields can be used for ordering:
+
+ id
+ date_created
+ date_modified
+ date_filed
+ recap_sequence_number
+ entry_number
+
+ To order using multiple fields simultaneously, separate the field names with commas. For example, ?order_by=recap_sequence_number,entry_number
will use the default website order for Docket Entries.
A few field-level notes:
diff --git a/cl/search/api_views.py b/cl/search/api_views.py
index ce40d58635..21011af363 100644
--- a/cl/search/api_views.py
+++ b/cl/search/api_views.py
@@ -115,7 +115,14 @@ class DocketEntryViewSet(LoggingMixin, viewsets.ModelViewSet):
permission_classes = (RECAPUsersReadOnly, V3APIPermission)
serializer_class = DocketEntrySerializer
filterset_class = DocketEntryFilter
- ordering_fields = ("id", "date_created", "date_modified", "date_filed")
+ ordering_fields = (
+ "id",
+ "date_created",
+ "date_modified",
+ "date_filed",
+ "recap_sequence_number",
+ "entry_number",
+ )
# Default cursor ordering key
ordering = "-id"
# Additional cursor ordering fields