Missing required parameter: status


#1

A lot of people that are using LINQ to Twitter are getting the a 403 Forbidden on statuses/update. Setting Content-Type to “application/x-www-form-urlencoded” results in a 401. Here’s what I’m sending and a response:

POST https://api.twitter.com/1.1/statuses/update.json HTTP/1.1
Authorization: OAuth oauth_consumer_key=“x”,oauth_nonce=“x”,oauth_signature_method=“HMAC-SHA1”,oauth_timestamp=“1374531506”,oauth_token=“x”,oauth_version=“1.0”,oauth_signature="x"
User-Agent: LINQ to Twitter v2.1
Accept-Encoding: gzip, deflate
Host: api.twitter.com
Content-Length: 14

status=Testing

HTTP/1.1 403 Forbidden
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-length: 72
content-type: application/json;charset=utf-8
date: Mon, 22 Jul 2013 22:18:27 GMT
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Mon, 22 Jul 2013 22:18:27 GMT
pragma: no-cache
server: tfe
set-cookie: lang=en
set-cookie: guest_id=v1%3A137453150704803142; Domain=.twitter.com; Path=/; Expires=Wed, 22-Jul-2015 22:18:27 UTC
status: 403 Forbidden
strict-transport-security: max-age=631138519
x-access-level: read-write-directmessages
x-frame-options: SAMEORIGIN
x-transaction: a08555d57927eece
x-xss-protection: 1; mode=block

{“errors”:[{“code”:170,“message”:“Missing required parameter: status”}]}


#2

I’m running into the same issue. Note that it isn’t with every account. Doing a “Testing” status update for one account is successful, yet doing the same status update for a different account results in a code 170 missing required parameter: ‘status’.

Yet status is most definitely supplied in both cases. I also checked that the OAuth tokens are correct with the verify_credentials.json call.

Perhaps there is some other error, and the api is incorrectly identifying it as missing the status parameter?


#3

Thanks for the report. As mentioned on Twitter, I believe it is due to the lack of a Content-Type HTTP header to indicate which kind of data you are POSTing. All of v1.1 is more strict with HTTP, but statuses/update was among a few methods still served from older infrastructure and has been made as strict as other write methods moved over to the new infrastructure.

So that we know the full impact of this change, can you let me know the additional things you had to fix in your library? Thanks!


#4

This is now fixed in LINQ to Twitter. The problem happened gradually over a number of days. People were reporting that the problem was intermittent. I wasn’t seeing it with my tests. Today, a lot of applications using LINQ to Twitter broke, including my own.

The root cause of the problem was that LINQ to Twitter wasn’t including a Content-Type header of “application/x-www-form-urlencoded”. I changed that, but started getting 401’s. The 401’s occurred because of the way LINQ to Twitter was working with parameters. That’s all resolved now and I’ll be re-deploying LINQ to Twitter soon.

Thanks for your help. :slight_smile:


#5

Thanks for the update guys!


#6

Hi JoeMayo,

Thanks for this update. But do we need to download latest DLL for this fix?

Because, I am still getting the same error:
Missing required parameter: status.
The remote server returned an error: (403) Forbidden.

Here is my code:

Dim auth As New SingleUserAuthorizer
Dim Credentials As New InMemoryCredentials

If (Credentials.AccessToken Is Nothing) Or (Credentials.ConsumerSecret Is Nothing) Then
Credentials.ConsumerKey = "ConsumerKey"
Credentials.ConsumerSecret = "ConsumerSecret"
Credentials.OAuthToken = "OAuthToken"
Credentials.AccessToken = "AccessToken"
End If

        auth.Credentials = Credentials
        Dim twitterCtx As TwitterContext = New TwitterContext(auth)

        twitterCtx.UpdateStatus("Status update test") </code>

But I can send the Direct Message successfully.

Thanks
AmitG


#7

Yes, you should download the latest DLL or add a NuGet Package reference (http://www.nuget.org/packages/linqtotwitter).


#8

Thanks JoeMayo, It works.
Here are the steps I have done:
Installed NuGet from VS2010 Tools --> Extension Manager --> Online --> Download NuGet Package & installed.

Restart VS2010 to get effect of installation. But still error was appearing.

Again VS2010 Tools --> Library Package Manager --> Package Manager Console --> “Install-Package linqtotwitter” from package manager command promt.

And the error has gone.

Thanks!