Question about "parameters"


#1

How do I specify parameters on my REST-API call?

Specifically, I am trying to call https://api.twitter.com/1.1/account/verify_credentials.json and add the skip_status=true parameter.

I can call the verify_credentials endpoint with no errors. However, when I add skip_status=true, I get a 401 not authorized error. I guess I’m adding the parameter incorrectly? I just added it to the end of the URL as a querystring. Is this not correct?

https://api.twitter.com/1.1/account/verify_credentials.json?skip_status=true

Does the parameter need to be added to the header?

TIA,
Owen


#2

That’s exactly how you should be specifying parameters, as a query string. I’m surprised you’re seeing a 401 error with that parameter. Is your OAuth header setup correctly?


#3

As far as I know the header is right (should the header be different after I add the querystring parameter?). Using the same code without the querystring, I get a response with the data I expect. With the querystring, I get the 401 error.


#4

The oauth_signature will be unique between the calls, since it is calculated based on the URL and parameters. What language / Twitter library are you using?


#5

Followup- with the parameter added to the URL both before the URL is encoded and put in the header OR just appended to the URL when the web-request is made, I get a 401 error.


#6

Hmm. Very strange. I’ve tested with and without the skip_status parameter using twurl and the two calls work. I can only assume there’s some OAuth signing issue here at the moment. Any chance of trying an alternative library?


#7

wrote my own, based on the OAuthTools project on oauth.net… (The one on oauth.net didn’t do everything we needed, so…)…


#8

Do you know of a way to get twurl to spit out the header and other information to the console (without me digging through the source code to find it - or add it)?


#9

-t option adds trace.