Create a new authorization
将废弃
POST
/authorizations
oauth-authorizations
fingerprint
to differentiate between them.请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.github.com/authorizations' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "string",
"client_secret": "string",
"fingerprint": "string",
"note": "Update all gems",
"note_url": "string",
"scopes": [
"public_repo",
"user"
]
}'
响应示例响应示例
201 - 示例 1
{
"app": {
"client_id": "string",
"name": "string",
"url": "http://example.com"
},
"created_at": "2019-08-24T14:15:22Z",
"fingerprint": "string",
"hashed_token": "string",
"id": 0,
"installation": {
"account": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
},
"has_multiple_single_files": true,
"permissions": {
"contents": "read",
"deployments": "write",
"issues": "read",
"single_file": "read"
},
"repositories_url": "https://api.github.com/users/octocat/repos",
"repository_selection": "all",
"single_file_name": "config.yaml",
"single_file_paths": [
"config.yml",
".github/issue_TEMPLATE.md"
]
},
"note": "string",
"note_url": "http://example.com",
"scopes": [
"string"
],
"token": "string",
"token_last_eight": "string",
"updated_at": "2019-08-24T14:15:22Z",
"url": "http://example.com",
"user": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
}
}
请求参数
Body 参数application/json