Last Updated: February 25, 2016
·
3.283K
· Dieterbe

easiest way to create a user for github enterprise API usage

 ~ ❯ curl -i -X POST -u $your_github_user -k -d '{"note": "read-only for monitoring stuff"}' https://github.local.com/api/v3/authorizations
Enter host password for user 'dieter':
HTTP/1.1 201 Created
Server: nginx/1.0.13
Date: Fri, 19 Oct 2012 19:18:41 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 201 Created
ETag: "4ddea0d3c08914c1224b115b28a3aa25"
Location: https://github.local.com/api/v3/authorizations/1
X-GitHub-Media-Type: github.beta
Content-Length: 440
Cache-Control: max-age=0, private, must-revalidate
X-Content-Type-Options: nosniff

{
  "app": {
    "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api",
    "name": "read-only for monitoring stuff (API)"
  },
  "scopes": [

  ],
  "note_url": null,
  "url": "https://github.local.com/api/v3/authorizations/1",
  "updated_at": "2012-10-19T19:18:41Z",
  "token": "274f0284ca8f9e9f0ccfc81b7a33f89bb628398b",
  "created_at": "2012-10-19T19:18:41Z",
  "id": 1,
  "note": "read-only for monitoring stuff"
}

for non-readonly, select scopes from http://developer.github.com/v3/oauth/#scopes