Forums

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

How to get count of attachment via rest API?

YongDeokAhn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 13, 2020

I wonder How to get count of attachment via rest API.

1 answer

0 votes
Pavel Potcheptsov
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.
July 15, 2020 edited
# echo -e "\nNumber of attachment is" && curl -s -n http://localhost:8090/rest/api/content/26477449/child/attachment | python -mjson.tool | tail -3 | head -1 | tr -dc '0-9' && echo

Number of attachment is
4

# echo -e "\nNumber of attachment is" && curl -s -n http://localhost:8090/rest/api/content/11048040/child/attachment | python -mjson.tool | tail -3 | head -1 | tr -dc '0-9' && echo

Number of attachment is
13

Screenshot1.png Screenshot2.png

Steffen Müller March 2, 2021

Hey Pavel, your code only works if there are max 50 attachments (or what you passed as a limit query parameter). The Rest endpoint you used only returns how many attachments it returned, not how many attachments exist.

Pavel Potcheptsov
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.
April 1, 2021

Want me to fix that?

I've to find page with more than 50 files first)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events