Tweet media with image using /media/upload endpoint in C#


#1

We were using the endpoint /media/upload_with_media endpiint to upload media. But since this api has got deprecated, now we replaced this api to /media/upload endpoint to get the media id. After this, the response(media id) from this endpoint should be provided to statuses/update endpoint in order to update media with JSON. I hope my understanding here is correct. Plesae correct me if I’. wrong.

But while posting to /media/upload endpoint, I’m always ending up with error code:215, Bad Authentication Data. Not able to figure out why i’m getting this error. Please someone help…


#2

POST signature consists below parameters:


#3

POST request consists endpoint url, media, oauth_consumer_key, oauth_nonce, oauth_signature_methid, oauth_timestamp, oauth_token, oauth_version

and authorisation header for getting the response consists oauth_consumer_key, oauth_nonce, oauth_signature, oauth_signature_method, oauth_timestamp, oauth_token, oauth_version

Content type is set to application/octet-stream

while getting response from this request, I’m getting error code 215.

Also all this I’m doing on .Net 3.5 C# project and I strictly have to use this version of .Net. Please suggest me if there are any third party libraries to integrate with…

Also please share if any one has the working code for this requirement.