Unable to access Twitter media API

oauth
media-upload
api

#1

Hi,

I am trying to send image through automated DM using my twitter application.

I am following this documentation - https://developer.twitter.com/en/docs/media/upload-media/api-reference

and using below API with request params -

https://upload.twitter.com/1.1/media/upload.json?command=INIT&total_bytes=10240&media_type=image/jpeg&media_category=dm_image&shared=true

but I am getting this error response -
{
“errors”: [
{
“code”: 32,
“message”: “Could not authenticate you.”
}
]
}

I checked/regenrated my app consumer and access key secret, but error remains.

Any help regarding this will be much appreciated.

Thanks,
Sharad