Accessing twitters api throws an error at me

im trying to access twitters api for a verification thing in my game. However, when I try and access it, I get an error which says: Header “bearer_token” has unallowed character “_” "

I’ve tried searching everywhere and couldn’t find anything of help. Heres my code (its dumbed down and I’ve taken out my tokens and keys for security reasons)

local HttpService = game:GetService("HttpService")

local Link = "https://api.twitter.com/2/users/%s/following"
local Username = "luadev896"

local BearerToken -- my token here
local ApiKey  --my key here
local ApiKeySecret  -- also my key
local AccessToken  --another key :)
local AccessTokenSecret --the last key



local JsonData = HttpService:RequestAsync(
	{
		Url = "https://api.twitter.com/2/users/by/username/" .. Username,
		Method = "GET",
		Headers = {
			["bearer_token"] = BearerToken, 
			["api_key"] = ApiKey,
			["api_key_secret"] = ApiKeySecret
		}
	}
)

when this code runs, I get an error saying that “_” is an unallowed character.
image
I honestly don’t know what to do.

1 Like