Hello, I was wondering how I fix this error. Here's the error http 401 (http/1.1 401 unauthorized)
Here's the script:
local board = "GHJ4Iw8A"
--------------------------------------------------------------------------------------------------------------------------------------------------------------
local Songs = {}
local http = game:GetService('HttpService')
local lists = http:JSONDecode(http:GetAsync("https://api.trello.com/1/boards/"..board.."/lists"))
for _,v in pairs(lists) do
if v.name == "Music List" then
local items = http:JSONDecode(http:GetAsync("https://api.trello.com/1/lists/"..v.id.."/cards"))
print(#items)
for _,v in pairs(items) do
if v.name:match(":") ~= nil then
local s,f = string.find(v.name,":")
table.insert(Songs, string.sub(v.name,f+1))
end
end
end
end
math.randomseed( os.time() )
_G.Skip = function()
if workspace:FindFirstChild("Sound") ~= nil then
workspace.Sound:Stop()
end
end
function shuffleTable(t)
math.randomseed(tick())
assert(t, "shuffleTable() expected a table, got nil" )
local iterations = #t
local j
for i = iterations, 2, -1 do
j = math.random(i)
t[i], t[j] = t[j], t[i]
end
end
shuffleTable(Songs)
local songnum = 0
game.Players.PlayerAdded:connect(function(p)
if p:GetRankInGroup(2833043) >= 40 or p.Name == "Player1" then
p.Chatted:connect(function(msg)
if string.lower(msg) == ":skipsong" then
_G.Skip()
spawn(function()
local h = Instance.new("Hint", p.PlayerGui)
h.Text = "Audio skipped."
wait(5)
h:Destroy()
end)
end
end)
end
end)
local Market = game:GetService("MarketplaceService")
local PlayerChosen = {}
local NotPlaying = false
local LastSong;
local SongNum = 0
while wait() do
SongNum = SongNum+1
local RawSong = Songs[SongNum]
local Song = "http://www.roblox.com/asset/?id="..Songs[SongNum]
if Song ~= LastSong then
game:GetService("ContentProvider"):Preload(Song)
local Sound = Instance.new("Sound", game.Workspace)
Sound.Volume = 1
Sound.SoundId = Song
Sound:Play()
game.ReplicatedStorage.Events.SongChanged:FireAllClients(game:service('MarketplaceService'):GetProductInfo(tonumber(RawSong)).Name)
wait(120)
Sound:Stop()
wait()
Sound:remove()
NotPlaying = false
else
NotPlaying = false
end
end

Copy that code (Ctrl+C)!
Then, add the following to each of the URLs you are requesting:
2 comments
https://support.microsoft.com/en-us/help/902160/you-receive-http-error-401-error-messages-and-you-intermittently-canno
Request denied usually means that you did not send credentials. Make sure you take a look at the Trello api for examples on how to send requests with proper authentication (the website won't trust just any request). Maybe make your board publicly visible?