How Do You Determine the GitHub Enterprise URL for the API Endpoint?

Problem scenario
You want to run some curl commands to invoke a GitHub Enterprise URL. You tried using "https://api.github.foobar.com/…", but you get a message about the URL not resolving. How can you find out what the API endpoint is?

Possible Solution
Try "https://github.foobar.com/api/v3/…" instead. Although Github.com uses the "api" immediately after the "https://" constructor (and to the left of the "github..." section), your GitHub Enterprise instance may use "http(s)://[hostname]/api/v3" (with the "api" to the right of the hostname in the URL constructor).

To learn more, you may want to see this: https://developer.github.com/enterprise/2.20/v3
Or this: https://docs.github.com/en/enterprise-server@2.20/rest/overview/resources-in-the-rest-api

Leave a comment

Your email address will not be published. Required fields are marked *