rudR
ZITADEL8mo ago
14 replies
rud

Only getting 404 from /v2beta/projects/search in v3.2.2?

Following the docs at https://zitadel.com/docs/apis/resources/project_service_v2/project-service-list-projects

The query is simply a POST to /v2beta/projects/search with a Bearer token.

Grabbed from the docs. What am I missing?

 ruby
BEARER_TOKEN = "QYxS....laRik"
CUSTOM_DOMAIN = "localhost:8080"

require "uri"
require "json"
require "net/http"

url = URI("http://#{CUSTOM_DOMAIN}/v2beta/projects/search")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer #{BEARER_TOKEN}"
request.body = JSON.dump({})

response = http.request(request)
puts response.read_body
=> {"code":5,"message":"Not Found"}
puts response.code
=> 404
List all matching projects. By default all projects of the instance that the caller has permission to read are returned.
ZITADEL Docs
Was this page helpful?