github获取uid方式

简介: github获取uid方式


不要在已成的事业中逗留着。——巴斯德

首先方式是:

https://api.github.com/users/VampireAchao

例如我访问得到:

{
  "login": "VampireAchao",
  "id": 52746628,
  "node_id": "MDQ6VXNlcjUyNzQ2NjI4",
  "avatar_url": "https://avatars.githubusercontent.com/u/52746628?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/VampireAchao",
  "html_url": "https://github.com/VampireAchao",
  "followers_url": "https://api.github.com/users/VampireAchao/followers",
  "following_url": "https://api.github.com/users/VampireAchao/following{/other_user}",
  "gists_url": "https://api.github.com/users/VampireAchao/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/VampireAchao/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/VampireAchao/subscriptions",
  "organizations_url": "https://api.github.com/users/VampireAchao/orgs",
  "repos_url": "https://api.github.com/users/VampireAchao/repos",
  "events_url": "https://api.github.com/users/VampireAchao/events{/privacy}",
  "received_events_url": "https://api.github.com/users/VampireAchao/received_events",
  "type": "User",
  "site_admin": false,
  "name": "VampireAchao",
  "company": "@apache @dromara @baomidou ",
  "blog": "https://vampireachao.github.io/",
  "location": "Beijing",
  "email": null,
  "hireable": null,
  "bio": "Cover Person of Gitee、Dromara-Stream-Query Author、Dromara-Hutool、Baomidou-Mybatis-Plus Team Member、Apache StreamPark Committer,Apache Shenyu  Contributor",
  "twitter_username": "VampireAchao",
  "public_repos": 83,
  "public_gists": 1,
  "followers": 75,
  "following": 183,
  "created_at": "2019-07-10T12:22:27Z",
  "updated_at": "2024-03-29T06:35:39Z"
}

这里的id就是uid

GitHub REST API文档地址:

GitHub REST API 文档 - GitHub 文档

用户的 REST API 终结点 - GitHub 文档

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/user

对应的状态码说明

“Get the authenticated user”的 HTTP 响应状态代码

状态代码 说明
200 OK
304 Not modified
401 Requires authentication
403 Forbidden


相关文章
|
9月前
github创建token
github创建token
154 0
Github修改仓库的基本信息
我们通常在刚开始了解学习使用github时,一般都是测试的使用,有时我们向里面添加了一些代买,如果想要修改信息并且是删除仓库重新创建提交,可以采用下面方法修改仓库信息,名称、描述等。
301 1
 Github修改仓库的基本信息
|
10月前
|
JavaScript Java 开发工具
Github库中的Languages显示与修改
前言 上传一个项目到GitHub时,发现显示的语言并非是自己项目所示的语言,这样的情况是经常发生的,为了能到达自己所需快速检索,或者是外部访问者能很好的搜索我们的项目,所以我们有必要修改一下语言,github并不支持项目语言的设定,但可以通过小技巧来设成自己想要显示的语言。 【.gitattributes】文件 项目的根目录上创建一个.gitattributes文件; 在本地库新建创建后使用git来push推送到github 或者 直接在GitHub项目上新建都可以; 本地新建的话例如:
266 0
|
Windows
正常访问GitHub的方式
正常访问GitHub的方式
581 0
正常访问GitHub的方式
GitHub英译中设置方法
GitHub英译中设置方法
5916 0
GitHub英译中设置方法
|
开发工具 git
GitHub/GitLab 为不同的项目修改提交名字 user.name 和邮箱 user.email(附:批量处理脚本)
大疫情的背景下,家里的电脑需要同时支撑自己和公司的项目,根据 GitHub/GitLab 网站的提交记录上看,其是根据邮箱来辨识用户的,所以有必要分别针对不同的项目设置不同的 Git 名字(user.name)和邮箱(user.email)。
494 1
Github 如何获取 GitHub Client ID and Client Secret
Github 如何获取 GitHub Client ID and Client Secret
Github 如何获取 GitHub Client ID and Client Secret
|
JavaScript 持续交付 开发工具
操作GitHub(二)
以jQuary为例,对GitHub界面做出解释
93 0
|
数据安全/隐私保护 网络虚拟化
操作GitHub(一)
通过github自己创建一个在线网页
155 0