Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Find the total number of attachments in a page using REST API

Using the REST API - /api/content/{id}/child/attachment, how do I find the total number of attachments? 

I don't see a totalSize in the json response. Irrespective of the limit parameter value, the size of the result set is 200.

Using the UI, I can visually see the number Attachments (650) when looking at the page properties. 

Is there a way to get this number using REST API? 

 

1 answer

0 votes
Thomas Deiler Community Leader Apr 23, 2021

Dear @InfoSec ,

unfortunatelly there is no specific REST request for the amount of attachments of one page, but with GET /rest/api/content/{id}/child/attachment and reading the JSON entity "size" you get the number you want.

If not, you can still do pagination and count JSON array opjects.

So long

Thomas

Thomas Deiler Community Leader Apr 23, 2021

Note: If your array ends at 200 and you have more than 200 attachments, you discovered a bug ;)

Thomas Deiler Community Leader May 05, 2021

Dear @InfoSec ,

don't forget to press the "green accept answer" button to indicate other readers the successful answering of your question.

So long
Thomas

I am also seeing that my array is ending at 200 even though I give a higher limit value.

How can this issue be resolved if this is a bug?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,683 views 7 31
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you