rud
rud3d ago

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
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
ZITADEL Docs
List all matching projects. By default all projects of the instance that the caller has permission to read are returned.
6 Replies
rud
rudOP3d ago
For anyone not versed in ruby, it's the same as this with the shell: wget --no-check-certificate --quiet \ --method POST \ --timeout=0 \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <token>' \ --body-data '{}' \ 'http://$CUSTOM-DOMAIN/v2beta/projects/search' is there something that needs to be enabled to activate the /v2beta/ API endpoints. Searched through discord, didn't find anything.
Rajat
Rajat3d ago
hey there @rud thanks for pointing it out, it seems to me like a biug, I just tried it and it is indeed resulting in 404!. I will discuss it with my team internally and will get back to you.
rud
rudOP3d ago
thank you for the quick update @Rajat ! I'm also trying to call /v2beta/projects/#{project_id}/grants/#{target_org_id}, does that have the same problem? I'm getting consistent 404s from that endpoint too
Rajat
Rajat3d ago
hey @rud can you link the api endpoint doc here?. I will test it and will get back to you
rud
rudOP3d ago
ZITADEL Docs
List all matching projects. By default all projects of the instance that the caller has permission to read are returned.
ZITADEL Docs
Change the roles of the project that is granted to another organization.
rud
rudOP3d ago
I found links to those two pages from deprecated v1 API endpoints, they're missing navigation edit: removing off-topic text

Did you find this page helpful?