我希望能够在 trello 中存档(或删除)一张卡片,但使用 httppost。我在他们的 HTTPService 上使用 ROBLOX。这是我想出来的,但它似乎不起作用。
function DeleteCard(cardid)
local url
local cardi = tostring(cardid)
url="https://api.trello.com/1/cards/"..cardi.."/actions"..getAddon() -- getAddon() is a function that returns the key to allow me to make modifications on the board. This works, I'm able to create lists/cards fine.
local dat = {
closed=true
}
local data = HS:JSONEncode(dat)
local delc = HS:PostAsync(url,data)
print(tostring(delc))
end
我尝试了许多不同的方法来做到这一点,但我似乎无法设置任何操作。它通常以 404 或 400 响应。使用此函数正确收集 cardid:
function GetCardID(name,boardid)
local url
url="https://api.trello.com/1/boards/"..boardid.."/cards"..getAddon()
local tab=HS:GetAsync(url,true)
local tabl=HS:JSONDecode(tab)
for k,ta in pairs(tabl) do
for p,t in pairs(ta) do
if p=="name" and t==name then
return ta.id
end
end
end
end
它确实可以正确获取卡ID,我已经测试过了。
我查看了https://trello.com/docs/api/card/并尽力使用这些资源,但我就是不明白如何调用“删除”或如何将“操作”设置为存档.