Twitter+oAuth engine returning 401 when trying to post status

369 views Asked by At

I am using the Twitter+oAuth engine in my iPhone app, and I am able to authenticate the user perfectly. I can get statuses with no issue at all, but when I want to post a status, a 401 error is being returned.

This is how I am sending a tweet: [_engine sendUpdate:@"Testing 101"];

It is returning a "Request failed" message with a HTTP 401 error. When I use the same engine to receive statuses, a request succeeded message is being returned.
Why is this happening?

I can receive statuses perfectly, multiple times a minute. That request is succeeding with no difficulty, but the same engine is returning a 401 when trying to post.

1

There are 1 answers

4
WrightsCS On

Make sure your callback url is not blank. This callback url does't have to be valid, or even exist.

Try not to submit the same update over and over. Twitter sees this as spam and will eventually refuse to post your updates.

Also, see Twitter Error & Response Codes.

401     Unauthorized     Authentication credentials were missing or incorrect.

This leads me to think too, that you aren't logging in or passing the correct credentials before posting.