twurl is getting "Read-only application cannot POST"

219 views
Skip to first unread message

TJ Luoma

unread,
Jan 3, 2011, 10:01:24 AM1/3/11
to twitter-deve...@googlegroups.com
I have authorized twurl successfully but when I try to create a block,
it tells me that it's read only


# twurl -t -d "screen_name=dwikirowi" "/1/blocks/create.xml"
opening connection to api.twitter.com...
opened
<- "POST /1/blocks/create.xml HTTP/1.1\r\nAccept: */*\r\nConnection:
close\r\nUser-Agent: OAuth gem v0.4.4\r\nContent-Type:
application/x-www-form-urlencoded\r\nAuthorization: OAuth
oauth_consumer_key=\"EK9yzQy6K8gqzAg0pCaQug\",
oauth_nonce=\"TpGOfe8bnzD74N5Ixrpjaip1PfscSkxTYLlYvXqzs14\",
oauth_signature=\"yX1suHCZxeGf3pyjNCdkOE5F7rw%3D\",
oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1294066225\",
oauth_token=\"7344012-fsOhwagPQXaz627NUEI9jbxUFyF4QBQakZeikJsoIA\",
oauth_version=\"1.0\"\r\nContent-Length: 21\r\nHost:
api.twitter.com\r\n\r\n"
<- "screen_name=dwikirowi"
-> "HTTP/1.1 401 Unauthorized\r\n"
-> "Date: Mon, 03 Jan 2011 14:50:25 GMT\r\n"
-> "Server: hi\r\n"
-> "Status: 401 Unauthorized\r\n"
-> "WWW-Authenticate: Basic realm=\"Twitter API\"\r\n"
-> "Content-Type: application/xml; charset=utf-8\r\n"
-> "Content-Length: 147\r\n"
-> "Cache-Control: no-cache, max-age=1800\r\n"
-> "Set-Cookie: k=99.174.173.56.1294066225492468; path=/; expires=Mon,
10-Jan-11 14:50:25 GMT; domain=.twitter.com\r\n"
-> "Set-Cookie: guest_id=129406622564378748; path=/; expires=Wed, 02
Feb 2011 14:50:25 GMT\r\n"
-> "Set-Cookie:
_twitter_sess=BAh7CDoHaWQiJTc1YmY4YzA2YTZiNmE1MWIzZjI5N2M2NmQ4MjEyODE4Igpm%250AbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAG%250AOgpAdXNlZHsAOg9jcmVhdGVkX2F0bCsI95FbTC0B--0032072eac8637c5b993db5512109cee00605655;
domain=.twitter.com; path=/\r\n"
-> "Expires: Mon, 03 Jan 2011 15:20:25 GMT\r\n"
-> "Vary: Accept-Encoding\r\n"
-> "Connection: close\r\n"
-> "\r\n"
reading 147 bytes...
-> ""
-> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<hash>\n
<request>/1/blocks/create.xml</request>\n <error>Read-only
application cannot POST</error>\n</hash>\n"
read 147 bytes
Conn close
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<request>/1/blocks/create.xml</request>
<error>Read-only application cannot POST</error>
</hash>

Tom van der Woerdt

unread,
Jan 3, 2011, 10:08:46 AM1/3/11
to twitter-deve...@googlegroups.com
It means that your application and tokens are read-only... obviously :-)
You can't write anything when you have a read-only app.

Tom

Matt Harris

unread,
Jan 3, 2011, 7:14:05 PM1/3/11
to twitter-deve...@googlegroups.com
Hi TJ,

To be able to send POST requests to the API you need to ensure your application is of access type: Read & Write
The message you are getting means your application is Read Only. To change this you need to visit http://dev.twitter.com/apps and then edit the details of your application so that the access type is Read & Write. 

This will only change access tokens issues from then on so any users who have already authorised your application will need to be sent through the OAuth process again.

Hope that helps,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris


--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

Abraham Williams

unread,
Jan 3, 2011, 7:32:45 PM1/3/11
to twitter-deve...@googlegroups.com
Unless things have changed recently users who have already authorized the application will first have to visit https://twitter.com/settings/connections and revoke access before being sent through the OAuth process again.

Abraham
-------------
Abraham Williams | Hacker Advocate | abrah.am
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.

TJ Luoma

unread,
Jan 4, 2011, 1:59:43 PM1/4/11
to twitter-deve...@googlegroups.com
On Mon, Jan 3, 2011 at 7:14 PM, Matt Harris <themat...@twitter.com> wrote:
> To be able to send POST requests to the API you need to ensure your
> application is of access type: Read & Write
> The message you are getting means your application is Read Only. To change
> this you need to visit http://dev.twitter.com/apps and then edit the details
> of your application so that the access type is Read & Write.
> This will only change access tokens issues from then on so any users who
> have already authorised your application will need to be sent through the
> OAuth process again.

My app is Read & Write and has been Read & Write since day 1 since
pretty much everything it does was obviously going to require 'write'
access.

When I pull up my app on the dev page it is shown as being Read & Write.

I read somewhere else that someone else had this problem & so they
deleted their app and re-created it. I've tried that for two days now,
but whenever I try to delete it, I get the "twitter is over capacity"
message.

Still need ideas.
TjL

TJ Luoma

unread,
Jan 4, 2011, 2:00:59 PM1/4/11
to twitter-deve...@googlegroups.com
On Mon, Jan 3, 2011 at 10:08 AM, Tom van der Woerdt <in...@tvdw.eu> wrote:
> It means that your application and tokens are read-only... obviously :-)

Except that they aren't. I never have read-only tokens or application.

So it's "obviously" a problem with Twitter.

Remember when twurl was going to be as easy as curl? Yeah. Me too. What a crock.

TjL

Matt Harris

unread,
Jan 4, 2011, 5:13:15 PM1/4/11
to twitter-deve...@googlegroups.com
Deleting applications is a known issue at the moment being tracked on our issue tracker:

Regarding your application. Can you check under:
That your application is read and write. The error message is very specific and is only triggered by an application which is read only. If it is read and write, try changing it to read only and then back again.

Best,

@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris


TJ Luoma

unread,
Jan 4, 2011, 9:40:52 PM1/4/11
to twitter-deve...@googlegroups.com
On Tue, Jan 4, 2011 at 5:13 PM, Matt Harris <themat...@twitter.com> wrote:
> Deleting applications is a known issue at the moment being tracked on our
> issue tracker:
>     http://code.google.com/p/twitter-api/issues/detail?id=2040

Why is the 'delete' button still shown if you know it isn't working?


> Regarding your application. Can you check under:
>     http://dev.twitter.com/apps
> That your application is read and write. The error message is very specific
> and is only triggered by an application which is read only. If it is read
> and write, try changing it to read only and then back again.

It was set to read & write, as previously stated, but since you don't
believe me, here's a screenshot:

https://img.skitch.com/20110105-e7439ygif6i6yiiwuir244itnp.jpg

I did as you suggested, toggling the app to read only, (and then saved
& saw it listed as read only), and then changed it back to read&write,
as shown here:

https://img.skitch.com/20110105-urh375rhp1bfmgu463pbtwc3b.jpg

Then re-authorized (which I'll now have to do on 4 different computers
since the keys changed):

# twurl authorize --consumer-key 6meHNyaircETFgqObTAkQ
--consumer-secret qqKvuCRyNBGrYMPQIUyhZiOU8sLdlKS9Mo7Edx70Uk

and then pasted the PIN from my web browser. It said it authorized.

I tried my script again:

# twit.sh --block @dwikirowi

failed, as did

# twurl -d "screen_name=dwikirowi" "/1/blocks/create.xml"


<?xml version="1.0" encoding="UTF-8"?>
<hash>
<request>/1/blocks/create.xml</request>
<error>Read-only application cannot POST</error>
</hash>

Actually, now that I think about it… isn't that suggesting that
*twurl* is Read-Only, not my app? I don't know. All I know is that we
never had these problems with curl and I've wasted far too long on
this when I could have been actually improving my program :-/

Would xAuth make this any easier?

TjL

Abraham Williams

unread,
Jan 4, 2011, 10:06:04 PM1/4/11
to twitter-deve...@googlegroups.com
Go to https://twitter.com/settings/connections and find the application you are testing with. Coffee says that next to it will be "read-only access". You will have to revoke access then a new authorization should work.

Actually, now that I think about it… isn't that suggesting that *twurl* is Read-Only, not my app?

No. It Twurl is just acting like a library that is using your applications consumer key and secret. (Which you should reset if those are you real values in the emails). 

Abraham
-------------
Abraham Williams | Hacker Advocate | abrah.am
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.




TjL

TJ Luoma

unread,
Jan 5, 2011, 2:05:16 AM1/5/11
to twitter-deve...@googlegroups.com
On Tue, Jan 4, 2011 at 10:06 PM, Abraham Williams <4br...@gmail.com> wrote:
> Go to https://twitter.com/settings/connections and find the application you
> are testing with. Coffee says that next to it will be "read-only access".
> You will have to revoke access then a new authorization should work.

Can I get that coffee via PayPal?

https://img.skitch.com/20110105-mr9ydhi9uh6yr2e6mkpjy26gaq.jpg

Again, the app has NEVER BEEN Read Only, so the app could never have
requested Read Only access to my account.


>> Actually, now that I think about it… isn't that suggesting that *twurl* is
>> Read-Only, not my app?
>
> No. It Twurl is just acting like a library that is using your applications
> consumer key and secret. (Which you should reset if those are you real
> values in the emails).

Will do.


I appreciate folks willingness to help, but so far everything has
resolved around the idea that I must be wrong about the app being
"read only." I don't know how else to prove that it isn't now and it
never was.

TjL

Abraham Williams

unread,
Jan 5, 2011, 2:31:40 AM1/5/11
to twitter-deve...@googlegroups.com
I don't think PayPal sends coffees...

At this point I would recommend creating a new application. If you are still having issues deleting the existing one you should be able to rename it to something else and delete it later.


Abraham
-------------
Abraham Williams | Hacker Advocate | abrah.am
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.






TjL

Reply all
Reply to author
Forward
0 new messages