What is my GitHub REST API endpoint?

I want to use Groovy, HttpBuilder and the REST API to access our onsidte GitHub company. GitHub developer site: https://developer.github.com/v3/ , shows this URL: https://api.github.com . So if my company’s GitHub URL is: http://github.mycompany.com , what is the REST API endpoint URL? for example, if I want to list all users, what is the correct URL?

When I access this url: https://github.mycompany.com/api/v3 , it gives me an error:

github.mycompany.com refused to connect. ERR_CONNECTION_REFUSED

+4
source share
3 answers

According to " API Enterprise 2.5 :

All API endpoints except the Management Console API endpoints are prefixed with the following URL:

http(s)://hostname/api/v3/

But you need to authenticate:

Authentication

Enterprise installation API endpoints accept the same authentication methods as the GitHub.com API. In particular, you can authenticate using OAuth tokens (which can be created using the authorization API) or basic authentication .

Enterprise API GitHub Enterprise, API , .

+2

, .

, , .

, ( ) , :

`url -k -H "Authorization: token xxxxxx...xxx" \ https://git.acme.com/api/v3/organizations`

Note that xxxxx ... xxx is the owner of the access token space that I created with read-only access to my repositories. Documents refer to this as OAUTH_TOKEN. You can choose to insert a token into the query string. In the case of neither you need to enter a username, because the server shows this from the token.

+1
source

All Articles