Querybuilder API 401 Error | Community
Skip to main content
February 13, 2023
Solved

Querybuilder API 401 Error

  • February 13, 2023
  • 1 reply
  • 1686 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nitin_laad

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/authentication/overview.html?lang=en

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

1 reply

Nitin_laad
Community Advisor
Community Advisor
February 13, 2023

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/authentication/service-credentials.html

February 14, 2023

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,

Nitin_laad
Community Advisor
Nitin_laadCommunity AdvisorAccepted solution
Community Advisor
February 15, 2023

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/authentication/overview.html?lang=en

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