Endpoints developer portal "Try this API" and permissions

Viewed 79

I am working on an API hosted with Cloud Run and Endpoints, and just set up the developer portal in Endpoints. I'm looking to make the Try this API section get working, but it is just giving me the Your client does not have permission to get URL <code>/</code> from this server. message that makes it seem like its not authenticated. I saw this post: GCP Endpoint “Try this API” authorization URL

That makes it look like there is no way to use this feature unless I make the API public? Does anyone else know anymore about this?

1 Answers

Yes, it's correct, in general, the Endpoints must public, for you to use the "Try this API" panel in your site. Considering that the users will probably not be authenticate, this is the reason why it needs to be public.

However, per the official documentation Trying out the API, in case you use API key or authentication for your developers to access your portal, you can configure the requirements needed for the "Try this API" work properly without being publicly. You can follow the steps provided in the official documentation, as long as you have the below prerequisites already done within your application.

  • You must have already deployed your API to the App Engine standard environment. The gcloud app deploy command automatically creates a DNS entry on the appspot.com domain for your API so that it is reachable by the Endpoints Portal.
  • If your API requires an API key: check here for Java and here for Python, on how to have your code noted.
  • If your API requires authentication: check here for Java and here for Python, on how to have your code noted.

To summarize, it should be possible and straightforward, once you follow the official tutorial, to have your "Try this API" configured.

Related