将用户添加到组织存储库github API [英] Add user to organization repository github API

查看:101
本文介绍了将用户添加到组织存储库github API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用curl和github API将多个用户添加到私人小组的团队中。但是,我的语法有些问题,我不确定它是什么。

I'm trying to add multiple users to a team in a private group team using curl and the github API. However, something is off with my syntax and I'm not sure what it is.

我已经尝试过:

curl --user "groupowner:password" -X PUT -d "" "https://api.github.com/orgs/ORGNAME/teams/TEAMNAME/members/USERNAMETOBEADDED/"

github文档,例如此处很有帮助,但我遗漏了一些内容。查找此处,看来另一种语法也是可能的。

The github documentation, e.g., here is helpful, but I'm missing something.Looking here it seems that another syntax may be possible.

推荐答案

摆脱斜杠并使用团队成员资格API应该可以解决问题:

Getting rid of the trailing slash and using the team membership API should do the trick:

curl --user "groupowner:password" -X PUT -d "" "https://api.github.com/teams/TEAMID/memberships/USERNAMETOBEADDED"

这篇关于将用户添加到组织存储库github API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆