Expand my Community achievements bar.

SOLVED

Querybuilder API 401 Error

Avatar

Level 1

Hi-

I am using the AEM provided wknd starter site to create a demo environment and I am trying to use the Querybuilder API for a list of pages. I have sent a request with basic authentication using my AEM credentials but continue to get a 401 unauthorized error. 

https://author-p92367-e844390.adobeaemcloud.com/bin/querybuilder.json?type=cq:PageContent&path=/content/wknd/us/en/adventures&p.limit=-1

Am I missing a step? Do I need to "turn on" or configure the Querybuilder API to get started? I was under the impression this was available out-of-the-box. I am sure that my username and password are correct because I am signed in to my author environment already. 

 

I appreciate any advice! thank you!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Postman is primarily designed for invoking API calls. In the event that there is a need to invoke a query builder in order to access any cloud-based API, it is imperative to provide authentication information. The AEM Cloud service offers a solution to this requirement by utilizing token-based authentication for HTTP requests originating from external applications, services, or systems.

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/a...

I was able to invoke the querybuilder API using authentication token(bearer token, generated using Node.js app).

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @mattmalone212 Think of integrating with Adobe Experience Manager (AEM) as a Cloud Service as entering a secure castle. AEM's Developer Console acts as the key to the castle, granting access to Service Credentials, which allow external applications, systems, and services to communicate with AEM's Author or Publish services over HTTP

check this out for more details -

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/a...

Avatar

Level 1

Thanks @Nitin_laad - I think this may be separate from what I am looking for. I'm looking to use the Querybuilder API and use basic auth credentials and not use an access token retrieved through JWT.

Additionally, my request URL works in my browser that I have logged into AEM with but it returns the 401 from Postman. Any further ideas?


Thanks,

Avatar

Correct answer by
Community Advisor

Postman is primarily designed for invoking API calls. In the event that there is a need to invoke a query builder in order to access any cloud-based API, it is imperative to provide authentication information. The AEM Cloud service offers a solution to this requirement by utilizing token-based authentication for HTTP requests originating from external applications, services, or systems.

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/a...

I was able to invoke the querybuilder API using authentication token(bearer token, generated using Node.js app).