我正在使用Trello API,并且我想在特定列表上创建一张新卡。
我做了,但不是我想要的方式
https://api.trello.com/1/lists/idList/cards?key=<myKey>&token=<myToken>&name=My+new+card+name&desc=My+new+card+description我想在我的列表中创建一张新的卡片,但我想使用以下命令来完成:
newCard = [
{
name: "myname",
idList: "myIdList",
desc: "mydesc",
pos: "top",
due: null
};
]因为在第一种方法中,当我尝试在名称或描述中添加空格时,我会出现错误(这是正常的,url中不能有空格)
然而,当我试图实现newCard变量时,它会抛出一个错误,比如“idList的值无效”,我不知道为什么?
也许有人可以给我一个如何做到这一点的例子?
发布于 2016-09-26 20:27:03
你有没有试过没有"[]“?在https://developers.trello.com/get-started/start-building#create接口文档中:
var newCard = {
name: 'New Test Card',
desc: 'This is the description of our new card.',
// Place this card at the top of our list
idList: myList,
pos: 'top'
};对于列表ID,它必须类似于"https://trello.com/c/DcqBrqdx/1-target-card.json“
https://stackoverflow.com/questions/39700405
复制相似问题