【问题标题】:How do I set a card in trello to be archived using httppost?如何在 trello 中设置卡片以使用 httppost 归档?
【发布时间】:2015-08-20 11:04:18
【问题描述】:

我希望能够在 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/ 并尽我所能使用这些资源,但我就是不明白如何调用“删除”或如何将“操作”设置为存档。

【问题讨论】:

  • 你使用的是PostAsync,意思是发出一个POST请求。也许有类似DeleteAsync 的东西来发出删除请求?

标签: trello roblox


【解决方案1】:

The only metods that roblox currently allows are GET and POST. 这通常就足够了,但是在这种情况下,这意味着您不能使用任何使用 PUT 和 DELETE 的 Trello API 调用。

在您的情况下,deletion of a card requires the DELETE methodarchiving of a card requires the PUT method

但是,这并不意味着您不走运。您可以让自己的服务器(或第三方)从 ROBLOX 获取正常的 POST 请求,并使用正确的方法将它们发送到 Trello。

【讨论】:

    猜你喜欢
    • 2021-04-30
    • 2015-03-23
    • 2016-12-14
    • 2018-09-02
    • 2015-03-29
    • 2021-09-04
    • 1970-01-01
    • 1970-01-01
    • 2020-03-08
    相关资源
    最近更新 更多