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
7 years ago

When I run this:

It just errors this:

1HTTP 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 7 years ago
Edited 7 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.

01local Trello = "no"
02local Key = "no"
03local Token = "no"
04local http = game:GetService("HttpService")
05local get = http:GetAsync('https://api.trello.com/1/boards/'..Trello..'/lists?key='..Key..'&token='..Token,true)
06local tab=http:JSONDecode(get)
07 
08for _,v in pairs(tab) do
09    if v.name:match('^Banlist%s?$') then
10        boardid = v.id
11    end
12end
13 
14game.ReplicatedStorage.bannary.OnServerEvent:Connect(function(player, bann, banner, reason)
15    local pla = game.Players:WaitForChild(bann)
16    pla:Kick("Permanently Banned: " .. reason)
17    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}))
18end)
Ad

Answer this question