When I run this:
1 | game:GetService( "HttpService" ):PostAsync( "https://api.trello.com/1/cards/?key=Imnotgivingyoumykeyasanexample&token=Imnotgivingyoumytokenasanexample" , "Hello Example" ) |
It just errors this:
1 | 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!
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.
01 | local Trello = "no" |
02 | local Key = "no" |
03 | local Token = "no" |
04 | local http = game:GetService( "HttpService" ) |
05 | local get = http:GetAsync( 'https://api.trello.com/1/boards/' ..Trello.. '/lists?key=' ..Key.. '&token=' ..Token, true ) |
06 | local tab = http:JSONDecode(get) |
07 |
08 | for _,v in pairs (tab) do |
09 | if v.name:match( '^Banlist%s?$' ) then |
10 | boardid = v.id |
11 | end |
12 | end |
13 |
14 | game.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 } )) |
18 | end ) |