Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

[API question] Confluence pages which are created in certain period.

Hi, 

I want to know to find which confluence pages created in some period.

For example,

I create many pages this month (2021-04) and

I want to know which Pages I created this week. (2021-04-12 ~ 2021-04-16).

 

Is there any API to filter create date(or modified date) for all pages in a specific space?

1 answer

1 accepted

1 vote
Answer accepted
Diego Atlassian Team Apr 20, 2021

Hello @조성진(상연)! We sure have a way to filter your content via API.

You can use REST API to filter this content in Confluence. The search would look like this:

https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page+and+created>="2021/04/12"+and+created<="2021/04/16"+and+space="spacename"

 

You can check more details about REST API and how to perform advanced searches with it here:

 

I hope this helps!

Hi, @Diego  Thank you for your answer,

I tried your suggestion, but it seems not working

I'm sure I have created many pages, but the result is empty.

I get my space name from this api

  •  /wiki/rest/api/space?limit=100

(space name is Korean word)

 

I've searched many hours for this api, and really delighted to see your answer.

Could you give me more ideas to solve this problem?

res.png

Diego Atlassian Team Apr 23, 2021

Yes sure!

I, incorrectly, used "spacename" value in the space field. The call would look like this:

https://yoursite.atlassian.net/wiki/rest/api/content/search?cql=type=page+and+created>="2021/04/12"+and+created<="2021/04/16"+and+space=spacekey

 

So, if your space's space key is SPC, the value for space would look like this:

space=SPC

Let me hear from you!

@Diego My team have serveral spaces 

and results is below

 

1. when spacekey is just consist of alphabets : works

2. when spacekey is ~number format : not work

 

most of spaces are seconde type (ex. spacekey :"~12345678"

(below screenshot, I delete partially id, name, key )

 qu1.png

 

 

Do you know how to use ~{number} style in spacekey query? 

Best regards

Diego Atlassian Team Apr 26, 2021

Interesting. It looks like that you are trying to query a Personal Space for the pages.

In that case, the Space Key value must be escaped with "", like this:

space="~12345678" 

The query would look like this:

https://yoursite.atlassian.net/wiki/rest/api/content/search?cql=type=page+and+created>="2021/04/12"+and+created<="2021/04/16"+and+space="~12345678"

I tested this on my own personal space and the expected results are present.

I hope this helps!

@Diego oh, You are really awesome!!

tons of thanks for your effort, Finally I got what I want from this API.

Again Thanks!

Like Diego likes this

Glad to help!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Confluence

🥓🙅🏻‍♀️ Meet-less May Badge!

Hello Confluence Community!  What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. We la...

158 views 2 13
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