gpt4 book ai didi

google-apps-script - Trello API : How to POST a Card from Google Apps Script (GAS)

转载 作者:行者123 更新时间:2023-12-03 22:24:46 25 4
gpt4 key购买 nike

Google Apps脚本具有UrlFetchApp方法,可以在Trello中创建卡。

如何在trello中使用它创建/修改卡?

最佳答案

使用docs中的sendHttpPost示例表示UrlFetchAppdocs for the Trello API,我想到了这一点:

 // This sample sends POST payload data in the style of an HTML form, including
// a file.

function createTrelloCard() {

//POST [/1/cards], Required permissions: write
var payload = {"name":"apiUploadedCard", //(required) Valid Values: a string with a length from 1 to 16384
"desc":"description", //(optional)Valid Values: a string with a length from 0 to 16384
"pos":"top", //(optional) Default: bottom Valid Values: A position. top, bottom, or a positive number.
"due": "", //(required) Valid Values: A date, or null
"idList":"52017776e823fa1d51000819", //(required)Valid Values: id of the list that the card should be added to
//"labels": ,//(optional)
//"idMembers": ,//(optional)Valid Values: A comma-separated list of objectIds, 24-character hex strings
//"idCardSource": ,//(optional)Valid Values: The id of the card to copy into a new card.
//"keepFromSource": ,//(optional)Default: all Valid Values: Properties of the card to copy over from the source.
};

// Because payload is a JavaScript object, it will be interpreted as
// an HTML form. (We do not need to specify contentType; it will
// automatically default to either 'application/x-www-form-urlencoded'
// or 'multipart/form-data')
var url = 'https://api.trello.com/1/cards?key=[YourAppKey]&token=[UserToken]' //optional... -&cards=open&lists=open'-
var options = {"method" : "post",
"payload" : payload};

UrlFetchApp.fetch(url, options);
}

免责声明:我尚未对此进行测试。我从未编写过Google App脚本,也从未使用过Trello API。

关于google-apps-script - Trello API : How to POST a Card from Google Apps Script (GAS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18710641/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com