rud
rud•4mo 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.
11 Replies
rud
rudOP•4mo 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
Rajat•4mo 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
rudOP•4mo 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
Rajat•4mo ago
hey @rud can you link the api endpoint doc here?. I will test it and will get back to you
rud
rudOP•4mo 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
rudOP•4mo ago
I found links to those two pages from deprecated v1 API endpoints, they're missing navigation edit: removing off-topic text @Rajat did you have any luck chasing this around?
Rajat
Rajat•4mo ago
hey @rud apologies I got busy, pls go ahead and a open a bug for List Projects returning 404, I can confirm that it still exist, also please document all the findings that you/we had here on the channel, after that, I'd loop an backend engineer on it to get it merged/fixed. 🙂
Rajat
Rajat•4mo ago
No description
rud
rudOP•3mo ago
I ended up implementing the functionality using/management/v1/projects/_search and /management/v1/projects/ endpoints, so no bug-report will be forthcoming from me, sorry. Hopefully this will be caught as a part of upgrading /v2beta to a tested and stable endpoint.
Rajat
Rajat•3mo ago
hey @rud happy to hear that, I will close this thread in that case 🙂
Gigi the Giraffe (Zitadel)
🎉 Looks like you just helped out another community member! Thanks for being so helpful <@1179168518801981572>! You're now one step closer to leveling up—keep up the amazing peer support! 🚀

Did you find this page helpful?