Get-or-create an authorization for a specific app and fingerprint
将废弃
PUT
/authorizations/clients/{client_id}/{fingerprint}
oauth-authorizations
fingerprint
is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.github.com/authorizations/clients//' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_secret": "string",
"note": "Update all gems",
"note_url": "string",
"scopes": [
"public_repo",
"user"
]
}'
响应示例响应示例
200 - 示例 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"
}
}
请求参数
Path 参数
client_id
string
必需
fingerprint
string
必需
Body 参数application/json