Last updated Jun 6, 2023

Pagination for Security Vulnerability API

Parameters

Pagination for the Security Vulnerability API is handled via the optional query parameter, page_id, for supported endpoints.

If page_id is given, no other query parameters are needed or considered. The pagination is created based on the initial response. The API caches the pages for 24 hours, so any queries for paginated results must be resubmitted after the cache expires.

Response body

If the request requires pagination due to the size of the data, the response body contains the following objects:

  • prev_page_id: The uuid index of the previous page. This object will not be included in the initial request, as there is no previous page. To be used as the page_id query parameter with the following request.
  • next_page_id: The uuid index of the start of the next page. To be used as the page_id query parameter with the following request.

Additionally, the response always includes some helpful metadata to make your position within the pagination a bit easier to understand:

  • resources_count: The count of resources returned in this response.
  • total_count: The total count of all resources for this query.

Complete examples of the response body are in the REST API documentation

Example

  1. Make an initial request
1
2
# Request
curl --request GET \
  --url 'https://api.atlassian.com/vuln-transparency/v1/cves' \
  --header 'Accept: application/json'
  
#  Response
{
  ... # Truncated for brevity
  "resources_count": 1,
  "next_page_id": "f6a75fba-55f3-4027-b2a2-8a5cca898670", # Page 2
  "total_count": 25
}
  1. Make a new request, with the appropriate page_id
1
2
# Request
curl --request GET \
  --url 'https://api.atlassian.com/vuln-transparency/v1/cves' \
  --data-urlencode "page_id=f6a75fba-55f3-4027-b2a2-8a5cca898670" \ # Page ID from `next_page_id` in the previous step. Page 2
  --header 'Accept: application/json'
  
#  Response
{
  ... # Truncated for brevity
  "resources_count": 1,
  "prev_page_id": "41d4ad13-7ae6-41d1-8810-60a201521ebc", # The last page we were on. In this case, the initial page, Page 1
  "next_page_id": "5c11f073-23ca-4faa-b058-cea60ac351e4", # Page 3
  "total_count": 25
}

Rate this page: