Tweet status text not url decoded


Hi All,

So for the couple of days we are having the strange problme eavry time we send a status text to tweeter it is show in Tweet with text still url encoded. We are sending the text in this format for the past 5 months and did not have any promlesm until now. So here is an example

Original text
Hi! - perfect tool for connecting with people and business partners #EXPOREAL #networking

we do this in PHP status = urlencode(text);

And we get on twitte

I do not know why is tihs happening since as I said all was working fine for the last 5 months


Is this in the Ads API? If so, we rolled out a fix for a defect last week which would have affected this.


Yes this is the ADS API this has happend today on 4 tweets at this time


Check the link I just posted for more information on what changed here.


We are looking at it but as we see text needs to be URL encoded as stated in that post we are doing that but it seams that it is not url decoded on other end. We have also tried sending with and with no HEAD parametar.


I think you should use:

$status = rawurlencode($text);

Try it!


Hi this also does not work

we get tweet with this


We still can not see what exact problem is since it work for good part of this year


Few months ago with an update we had a problem with the encode of special characters like “%”, before, it worked well.

Now, they have fixed that.

Which lib are you using?


We have our in house solution. We did not have problems with “%” since it was working when we send text as url encoded it was always url decoded on Twitter side now it seams that they do not url decode it


I’ve tryed few seconds ago, with rawurlencode, with your tweet text and another with %, and all works fine for us.


Do you send some aditional parametars in header or some extra filed on tweet endpoint


Our request params:

"request":{ "params":{ "status":"Hi! - perfect tool for connecting with people and business partners #EXPOREAL #networking", "account_id":"18ce53yv4fv" } }


{ "data_type":"status", "data":{ "created_at":"Mon Aug 22 15:16:48 +0000 2016", "text":"Hi! - perfect tool for connecting with people and business partners #EXPOREAL #networking", "truncated":false, "entities":{ ............

We send it as POST

with cURL, using CURLOPT_POSTFIELDS and encoding all params as

$output = rawurlencode($input);


The only differenc I see is that you urlencode all of the parameters and we only urlencode status. I still do no see what is change since it all work untill today


Ok for some reason if we send text with no urlencode it all works including “%”


@esome: It’s likely that the library you’re using to make the request is also encoding the input text.

For example, if status=hello%20there is passed in when making a request to the POST accounts/:account_id/tweet endpoint and the library encodes the input text, the result will be something like: hello%2520there.

Using twurl and the -t flag, you can compare the outcome using -d, which auto-encodes the text:

$ twurl -t -H "/1/accounts/xxxxx/tweet" -d "status=hello there"

$ twurl -t -H "/1/accounts/xxxxx/tweet" -d "status=hello%20there"

Using twurl, if you want to pass in encoded data, you could use the --raw-data option:

$ twurl -t -H "/1/accounts/xxxxx/tweet" --raw-data "status=hello%20there"

The announcement that @andypiper posted relates to a fix of a double-decoding issue. Because we were decoding text twice, your previous requests worked. Moving forward, please pass in non-encoded text.

Hope this helps!


@esome: Did this clear things up?


yes thanks