我希望能夠在trello中存檔(或刪除)一張卡片,但使用httppost。 我在他們的HTTPService上使用ROBLOX。 這是我想出的東西,但它似乎並沒有工作。如何將trello中的卡片設置爲使用httppost存檔?
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/並盡力使用這些資源,但我不明白如何調用「DELETE」,或者如何設置「操作」以進行存檔。
您正在使用'PostAsync',這意味着發出POST請求。也許有'DeleteAsync'來做DELETE請求嗎? –