How to resolve error [HTTP 400]

I have this error in my output. What should I do?

My script;

function onChatted(msg, recipient, speaker)
	if speaker:GetRankInGroup(groupId) >= adminRank then
	if blacklistedUsers[speaker.Name] == true or onCooldown == true then
	else
		local longReason = msg:sub(4):find(" ");
		if (longReason ~= nil) then
			local Reason =  longReason + 3;
			local info = string.split(msg,' ')
			if string.lower(info[1]) == string.lower(logCommands) and msg:sub(Reason + 1) ~= nil then
					local TeamsService = game:GetService("Teams")
					local Trainers = TeamsService["Trainers 🗣️"] -- Trainers team
					local CoHost = TeamsService["Co-Host 🌟"] -- Co-Host team
					local Helpers = TeamsService["Helpers ✏️"] -- Helpers team
					local Spectators = TeamsService["Spectators 👀"] -- Spectators team


					local Team1MembersString = " "
					local Team2MembersString = " "
					local Team3MembersString = " "
					local Team4MembersString = " "
				
				local function GetPlayersStringFromTeam(Team)
				    local TeamSize = #Team:GetPlayers()
				    local PlayersString = ""
				
				    for Index, Player in ipairs(Team:GetPlayers()) do
				        if (Index < TeamSize) then
								PlayersString = PlayersString .. Player.Name .. " (".. Player:GetRoleInGroup(groupId) .. ")\n➜ "
				        else
				            PlayersString = PlayersString .. Player.Name
				        end
				    end
				
				    return PlayersString 
				end
				
					Team1MembersString = Team1MembersString ..  GetPlayersStringFromTeam(Trainers)
					Team2MembersString = Team2MembersString ..  GetPlayersStringFromTeam(CoHost)
					Team3MembersString = Team3MembersString ..  GetPlayersStringFromTeam(Helpers)
					Team4MembersString = Team4MembersString ..  GetPlayersStringFromTeam(Spectators)


					local data = {
						['embeds'] = {{
							['title'] = '**📚 Training 🏫**',
							['description'] = "\n\n👑 Host:\n➜ **"..speaker.Name.."** ( **"..speaker:GetRoleInGroup(groupId).."** )\n\n🌟 Co-Host:\n➜ **"..Team2MembersString.."**\n\n🗣️ Trainers:\n➜ **"..Team1MembersString.."**\n\n✏️ Helpers:\n➜ **"..Team3MembersString.."**\n\n👀 Spectators:\n➜ "..Team4MembersString.."\n\n",
							['color'] = colorCodeRandom,
							['url'] = 'https://www.roblox.com/users/' .. speaker.UserId .. '/profile',		
							['avatar_url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=%s&width=150&height=150&format=png", speaker.UserId,

							['thumbnail'] = {
								["url"] = Players:GetUserThumbnailAsync(speaker.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
							},

							['footer'] = {
								['text'] = 'Session Logger || Embassy Resorts',
								['icon_url'] = 'https://cdn.discordapp.com/attachments/731887873875247188/793004831400263700/EmbassyResortsGFX.png',
							},

							["fields"] = {
								{
									["name"] = "CSIH",
									["value"] = msg:sub(Reason + 1),
									["inline"] = true
								}
							}
						}},
						['content'] = '<@&732536046360985630>'
					}
					
				local logData = HttpService:JSONEncode(data)
				HttpService:PostAsync(webhook, logData) --HTTP 400 ERROR
				addCooldown()
			end
		end
	end
	end
end

Is HTTP turned on in the games settings?

Yes it is. Still doesn’t work. I think the error is in the message data.

Probable won’t fix it but try API requests with HTTP on, also may not fix it: publishing the game.

I looked into a post like this before, which I used to help myself in another topic. Ensure this is fine on your side.