Report system - Help needed!

Hello!

I am trying to make a report system (that goes to trello) for my upcoming game. Right now everything works but when I try to submit the request it keeps giving me an error "HTTP 401 (Unauthorized). I have looked on youtube and looked around the developer forum for ways I can fix this error. Can anybody help?

game.ReplicatedStorage.Events.ReportUser.OnServerEvent:Connect(function(Reporter, Requested, Reason)
	local data = {
		["name"] = "Ban Report - "..tostring(Reporter),
		["desc"] = tostring(Reporter).." has requested to have action taken against this person: "..tostring(Requested).." because: "..tostring(Reason),
		["key"] = "",
		["token"] = "",
		["pos"] = "bottom",
		["idlist"] = "63b8a5dcf328d800f315ad8f"
	}
	data = HttpService:JSONEncode(data)
	HttpService:PostAsync(link, data)
end)

Here is the error I am getting:
image

1 Like

your token/key is invalid, you do not have authentication to make this request

How could I fix it? Is there some way in particular I need to?

@dwustpan is Correct, it means that the request (or user) doesn’t have valid authentication,

This means that you don’t have permission to send this request to the targeted link, You will need to get permissions to do so.

It could Also be an Error with sending data to the link.

Here is a list of HTTP status Codes if thats helpful:

Thanks, but what is the best way to fix it?

Sorry I was afk, what was the best way to fix it?

Depends, where are you trying to send the data to?

I need to send this data over to a Trello list

I’ve went through the Trello API and found the following:

If you want to send webhooks to Trello you must authroize them with a key you are given.
You can find your Trello API-Key here

Insert that into ["key"] = "" inside of the table data.

Let me know if this fixed your issue!

Here is the rest of my code:

–Code by F3X
https://f3x.tech

–Config
local link = “https://api.trello.com/1/cards?key=&token=” – Insert your link here

–Code

game.ReplicatedStorage.Events.ReportUser.OnServerEvent:Connect(function(Reporter, Requested, Reason)
local data = {
[“name”] = "Ban Report - “…tostring(Reporter),
[“desc”] = tostring(Reporter)…” has requested to have action taken against this person: “…tostring(Requested)…” because: "…tostring(Reason),
[“key”] = “”,
[“token”] = “”,
[“pos”] = “bottom”,
[“idlist”] = “63b8a5dcf328d800f315ad8f”
}
data = HttpService:JSONEncode(data)
HttpService:PostAsync(link, data)
end)

It changed the code type from 401 to 400

Seems like my answer wasn’t right.

Try this:

On the API-Key Page, scroll down until you see “create token manually”. Press on it and let Trello generate a token for you. You should get a page that looks like the following:
token

Copy your token and insert it into this following link:

https://api.trello.com/1/cards?key=&token=” (add it at the end)

Now use that link as argument for HttpService:PostAsync()

What do you mean? I’m not sure what you mean

On the API-Key page I have linked (https://trello.com/app-key), there should be a text saying you can generate your token manually. It should look like following:
token2
Press on the underlined “token”. This should create a token for you.

Paste the token you then received into the link that you send the data to.

still gave error 400

Did you remove the key inside of ["key"]?

no, I didn’t. Was I supposed to?

Yeah, try removing it. should look like this: ["key"] = ""

brings me back to error 401

(30-characters)

I am using a webhook and this is what it looks like:

If somebody could help me with this that would be greatly appreciated!