有没有办法使用 Python API for Trello 邀请成员加入看板?
Is there a way to use the Python API for Trello to invite members to a board?
在审查 Python API for Trello 的能力并考虑其功能时,
我正在寻找一个允许将成员添加到董事会的功能 - w./o。成功。
我尝试使用的是以下内容:
trello = TrelloAPI(myAPIKey, myToken)
boardID = myBoardID
fields = {"fullName": "Robo Member",
"email" : myMail}
trello.boards.get_membersInvited(board_id = boardID,
fields = fields)
这是方法实现的样子:
def get_membersInvited(self, board_id, fields=None):
resp = requests.get("https://trello.com/1/boards/%s/membersInvited" %
(board_id), params=dict(key=self._apikey, token=self._token,
fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
我最终收到 404 客户端错误 URL 未找到。
您对调整的内容有什么建议吗?
也许,我使用了错误的字段名称(电子邮件和全名)?
这是一个solution for .NET
自己找了个偏方。来源 --> Trello API Board Put Member
这是我自己的解决方案:
def invite_new_member(self, fullName, email, boardID):
url = self.baseURL + "boards/" + boardID + "/members"
querystring = {"email": email, "key": apikey,
"token": token}
payload = "{\"fullName\":\"" + fullName + "\"}"
headers = {
'type': "normal",
'content-type': "application/json" }
response = requests.request("PUT", url, data=payload, headers=headers,
params=querystring)
在审查 Python API for Trello 的能力并考虑其功能时, 我正在寻找一个允许将成员添加到董事会的功能 - w./o。成功。
我尝试使用的是以下内容:
trello = TrelloAPI(myAPIKey, myToken)
boardID = myBoardID
fields = {"fullName": "Robo Member",
"email" : myMail}
trello.boards.get_membersInvited(board_id = boardID,
fields = fields)
这是方法实现的样子:
def get_membersInvited(self, board_id, fields=None):
resp = requests.get("https://trello.com/1/boards/%s/membersInvited" %
(board_id), params=dict(key=self._apikey, token=self._token,
fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
我最终收到 404 客户端错误 URL 未找到。 您对调整的内容有什么建议吗?
也许,我使用了错误的字段名称(电子邮件和全名)?
这是一个solution for .NET
自己找了个偏方。来源 --> Trello API Board Put Member
这是我自己的解决方案:
def invite_new_member(self, fullName, email, boardID):
url = self.baseURL + "boards/" + boardID + "/members"
querystring = {"email": email, "key": apikey,
"token": token}
payload = "{\"fullName\":\"" + fullName + "\"}"
headers = {
'type': "normal",
'content-type': "application/json" }
response = requests.request("PUT", url, data=payload, headers=headers,
params=querystring)