Tweet with media using REST API


I’m using REST API 1.1 , I would like send binary image along with status. May I know is that possible using twitter API.

If yes, Please provide me an example.



There’s details on how media uploads work in the developer documentation. It might be an idea to find a library for your chosen platform / language which supports this, too.


@andypiper, I am using a TIBCO designer tool. Below is my request, Please let me know were exactly im going wrong.



		<media>Binary Data</media>


<ns0:RESTOutput xmlns:ns0 = “”>
{“errors”:[{“message”:“Could not authenticate you”,“code”:32}]}

I even tried with media endpoint…but no luck.


This looks like an authentication problem. I’m not familiar with the tool you’re using, how are you getting the OAuth tokens?


@andypiper… I got from my twitter account and pasted manually. My guess is…may be cookies problem or call back url but not sure.

I could send status using ‘‘’’ perfectly but could not upload images using ‘’ .

I am confident that OAuth Details are right because as it is working to update status.


@andypiper If possible, Can you please provide an example in SOAP UI.


@andypiper Its working…fine…Problem was with Multipart

<?xml version="1.0" encoding="UTF-8"?>
<ns2:Parameters xmlns:pd="" xmlns:ns2="" xmlns:xsl="" xmlns:ns="" xmlns:xsd="">
                <xsl:value-of select="'media'"/>
                <xsl:value-of select="'multipart/form-data'"/>
                    <xsl:value-of select="binaryContent"/>


Aha that is great news! Glad you were able to resolve it, and thanks for sharing your knowledge here for others.