Twitter HTTP Authentication - Need Help - {"errors":[{"code":215,"message":"Bad Authentication data."}]}

Hello, I am relatively new to make and I want to upload an image to my tweets, but since make removed the image support for twitter I was thinking i can upload it via twitter API with a http post command. But I cant seem to get it past the auth stage.

As I know twitter provides me with

Access Token
Access Token Secret
API Key
API Key Secret

I tried doing it with some chatgpt help, but to no avail.

for the URL i am using https://upload.twitter.com/1.1/media/upload.json

METHOD: POST

Chat gpt tells me

I need to put in the headers

“Authorization” in the name

and the below value with the filled in values at the value for the 1st header in my request

oauth_consumer_key=“API Key”
oauth_token=“Access Token”
oauth_signature_method=“HMAC-SHA1”,
oauth_timestamp=“{{timestamp}}”,
oauth_nonce=“{{now}}”,
oauth_version=“1.0”,
oauth_signature=“generated_signature”

for the timestamp I am using the timestamp variable from make
for the nonce I am using now variable from make
I am leaving the version untouched
and for the signature GPT suggested running this python script

import hashlib
import hmac
import base64

signature_base_string = “…” # Your constructed base string
signing_key = “API_Secret&Access_Token_Secret”

hashed = hmac.new(signing_key.encode(), signature_base_string.encode(), hashlib.sha1)
oauth_signature = base64.b64encode(hashed.digest()).decode()

which i did and i also got my signature.

But sadly its not working.

Can someone help me ?