1

我正在尝试向预先创建的 Trello 卡添加附件

我知道如何创建卡片,但到目前为止我无法找到如何在不提供 ID 的情况下添加附件(因为尚未创建卡片)

如有需要:https ://developers.trello.com/advanced-reference/card

我正在使用它来创建卡:

https://api.trello.com/1/cards?key=<myKey>&token=<myToken>&name=My+new+card+name&desc=My+new+card+description&idList=<myIdList>
4

2 回答 2

3

好的,我找到了答案!

创建卡片 -> 在过程中获取卡片的 ID -> 添加附件!

于 2016-09-27T14:00:10.597 回答
1

我使用过 Python 3.5,它是这样工作的:

#python 3.5.2

import requests

params = (
    ('key', 'yourkey'),
    ('token', 'yourtoken'),
)

files = {
    'file': ('C:\\Users\\mcronje\\Pictures\\Picture.png', open('C:\\Users\\Pictures\\Picture.png', 'rb')),
}

response = requests.post('https://api.trello.com/1/cards/ {cardidnumber}/attachments', params=params, files=files)


print(response.text)
于 2019-11-01T20:17:21.900 回答