Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

cURL command to fetch AEM data between two specific dates

Avatar

Level 2

Hi Team,

I want to write a curl command to fetch data from AEM between two specific dates. 

 

Would be very helpful if i can get the command for the same.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Community Advisor

Hi @Arindam15 ,

 

Try with Querybuilder to get the results, http://localhost:4502/libs/cq/search/content/querydebug.html  , 

 

path=/content/wknd
type=cq:Page
daterange.property=jcr:created
daterange.lowerBound=2022-01-30
daterange.upperBound:2022-02-02
p.limit=-1

Then use the query result json with Curl

 

curl -u admin:admin GET "http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=path%3D%2Fcontent%2Fwknd%0D%0Atype%3Dcq%3APage%0D%0Adaterange.property%3Djcr%3Acreated%0D%0Adaterange.lowerBound%3D2022-01-30%0D%0Adaterange.upperBound%3A2022-02-02%0D%0Ap.limit%3D-1"

Avatar

Level 2

its showing that, -bash: daterange.property=jcr%3acreated: command not found

-bash: daterange.upperBound=2021-05-01T00%3a00%3a00Z: command not found

 

Please help me out.

Avatar

Correct answer by
Community Advisor