API to Get ACL(Permissions attached) for Cookbooks returns error

Hi,
I am trying to call API https://api.chef.io/organizations/dnow/acls/cookbooks/<cookbook_name> to get the permissions attached the cookbook through my java code which gives me the following error.

Chef - 404 Not Found

404 - Not Found

Sorry, I can't find what you are looking for.

© 2010 – 2017 Chef Software, Inc. All Rights Reserved

I am able to call all other API’s like getting cookbooks, groups etc.

The same API works perfectly fine through browser if I am already logged in to chef management consoles

The Management UI is not an API but a web interface (effectively a client) to the chef-server API. In order to communicate with the chef-server API you need credentials in the form of a client-key and you can see the layout of the API here.

There appears to be an old pass at a Java client for Chef API here and a more up-to-date Ruby version as reference.

Hi thank you for the quick Reply. I am using the same Java client you have mentioned https://github.com/charleyw/chef-api-java for calling API’s. But it is not working for getting the ACL information. All other API’s I am able to call perfectly fine. My sample code is like bellow

ChefApiClient cac = new ChefApiClient(“ganeshkhakare”, “/Users/ganeshkhakare/Downloads/ganeshkhakare.pem”, “https://api.chef.io”);
ApiMethod execute = cac.get("/organizations/dnow/acls/cookbooks/ganesh-test").execute();
System.out.println(execute.getResponseBodyAsString());

This is great as an API reference. Do you have this for Chef Automate as well?

Sorry I dint get what it mean by “Do you have this for Chef Automate as well?”

That comment was meant for @cheeseplus. I noticed that the API reference given seems to target Chef Server specifically; I was inquiring about an API reference for Chef Automate as well.

Unfortunately @ganeshkhakare that might be a limitation of the old and unmaintained library being used and there isn’t much we have in the way of advice short of fixing the actual API client.

@stankmaster I don’t believe that an API has been published but if you talk to your account manager they might be able to share more information re: Automate.