Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API (server): getting attachments for a page and all its subpages?

PietroR June 6, 2023

Hi,

I use the REST API to scan through our document libraries. However, currently the performance of my system is very slow because I have to call a function getAttachments for every page I load (and its subpages).

Isn't there a better solution, something like getting all attachments in the hierarchy of the provided page? 

Or at least  when getting subpages (with expand&children.page) getting also attachment titles?

1 answer

1 accepted

0 votes
Answer accepted
Matt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2023

Based off of this solution - Solved: REST API call to return page attachments (created ... (atlassian.com)

 

You can use the 'api/content/search' endpoint and pass along the following CQL query:

type = attachment and container = <PARENT-PAGE-ID>

ex: https://<SERVER>/rest/api/content/search?cql=type%20%3D%20attachment%20and%20container%20%3D%20<PARENT-PAGE-ID>&expand=container

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events