Expand my Community achievements bar.

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