如何使用trellorestapi将卡移动到新列表?

2024-05-16 15:57:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用Python通过restapi与Trello进行交互。我可以从特雷洛那里得到。但是,我想把一张卡移到另一张列表中,但是我无法使请求保持不变。在

我的网址是:https://api.trello.com/1/cards/[card_id]/[list_id]?key=[api_key]&token=[token]

我试过这样称呼它:

import requests
requests.put(url)

还有这个

^{pr2}$

以及

from urllib.requests import Request
Request(url, method="PUT")

但是前两个错误是404,第三个没有。我肯定我做错了什么,但我不确定是什么。你知道吗?在


Tags: keyhttpsimportcomtokenapirestapiid
1条回答
网友
1楼 · 发布于 2024-05-16 15:57:22

在搜索了python-trello-api-pip安装包(https://pythonhosted.org/trello/index.html)中的代码之后,我似乎不得不这样做:

 import requests
 requests.put(https://api.trello.com/1/cards/[card_id], 
              params=dict(key=self._key, token=self._token), 
              data=dict(idList=listID))

请注意,要跨线路板移动,还需要提供线路板ID:

^{pr2}$

这对我有用,希望对你也一样!在

相关问题 更多 >