So I have a trello script that I'm working on for a game, the getasync works fine, but when I try to post a card to a list, it doesn't work.
http = game:GetService("HttpService") lists = "https://api.trello.com/1/lists/" idagentreports = "5a406f099038ed77a724c89a" auth = "&key="..tkey.."&token="..ttoken.."" local namefield = script.Parent.bg.agentreportnamebox.Text local prooffield = script.Parent.bg.agentreportproofbox.Text
Above are my variables, tkey is my trello key and ttoken is my trello token.
script.Parent.bg.agentreportsubmitbtn.MouseButton1Click:connect(function() print("clicked") local postcard = http:PostAsync("https://api.trello.com/1/cards?name="..namefield.."&desc="..prooffield.."&pos=top&idList="..idagentreports..""..auth.."") print("submitted") end)
Above is what I'm trying to submit, but it's not working. I tried adding http:JSONEncode, but that didn't work either.
The output says Argument 2 missing or nil.
As the error says, you are missing an argument. If we take a look at this, we can see that PostAsync() requires TWO arguments. You have supplied one. Post requests are for SENDING data. You have intepreted this the wrong way. Roblox expects you to send data to that link. I would suggest a GetAsync(). I used it for google forms, to submit data. It works quite well. Since the data you are sending is in the link, the "?" and the "&", you only need a GET request.