ZAF request failed with form data got 400 bad request | Community
Skip to main content

ZAF request failed with form data got 400 bad request

  • October 15, 2025
  • 2 replies
  • 0 views

 

So i try to get looker api token using these options


const loginOptions = {
	type: "POST",
	url: "https://domain.cloud.looker.com/api/4.0/login/",
	contentType: 'application/x-www-form-urlencoded',
	data: "client_id=id&client_secret=secret",
};
const response = await zafClient.request(loginOptions);

i got 400 bad request, when i am trying with curl/postman it's worked, currently i'm using zaf sdk version 2.0.11, anyone can help me?

this is what i got in chrome dev tools:
 

request actually go to the looker side, but it returns bad request

2 replies

Greg29
  • October 15, 2025

Hi Rizal!

 

I'm not familiar with Looker, I tried finding the API documentation, but it was proving difficult to get to the actually specs for that endpoint. Could you share the documentation that you use for this endpoint in Looker so that I can see what's expected and what may be causing the issue here?


  • Author
  • October 15, 2025

Hi Greg,

Thank you for your support. It turns out that the issue is on Looker’s side, the API does not support CORS requests by design. The API is intended for service-to-service communication, not for direct calls from the browser.