Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problems with Trello PostAsync ?

Asked by
Griffi0n 315 Moderation Voter
6 years ago

When I run this:

game:GetService("HttpService"):PostAsync("https://api.trello.com/1/cards/?key=Imnotgivingyoumykeyasanexample&token=Imnotgivingyoumytokenasanexample", "Hello Example")

It just errors this:

HTTP 400 (HTTP/1.1 400 Bad Request)

And when I go to the actual website

Cannot GET /1/cards/?key=Imnotgivingyoumykeyasanexample&token=Imnotgivingyoumytokenasanexample

I did the key and token thing by going to https://trello.com/app-key and clicking the authorize token and accepting it. I did replace the key and token in my PostAsync request and I didn't leave it as "Imnotgivingyoumykeyasanexample". Help!

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

It's trying to look for a list. Also make sure HTTPEnabled is on.

Run; game.HTTPService.HTTPEnabled = true

I just finished up with PostAsync. Feel free to look at mine.

local Trello = "no"
local Key = "no"
local Token = "no"
local http = game:GetService("HttpService")
local get = http:GetAsync('https://api.trello.com/1/boards/'..Trello..'/lists?key='..Key..'&token='..Token,true)
local tab=http:JSONDecode(get)

for _,v in pairs(tab) do
    if v.name:match('^Banlist%s?$') then
        boardid = v.id
    end
end

game.ReplicatedStorage.bannary.OnServerEvent:Connect(function(player, bann, banner, reason)
    local pla = game.Players:WaitForChild(bann)
    pla:Kick("Permanently Banned: " .. reason)
    local musget = http:PostAsync('https://api.trello.com/1/cards/?key='..(Key)..'&token='..(Token), http:JSONEncode({["name"]=(pla.Name .. " | " .. pla.userId), ["desc"]=("Reason: " .. reason .. "\nBanned by: " .. banner.Name), ["due"]=nil,["idList"]=boardid,["urlSource"]=nil}))
end)
Ad

Answer this question