1.1/users/lookup.json returns {"errors":[{"message":"Could not authenticate you","code":32}]}


#1

but it works good in 1/users/lookup.json
idk where goes wrong…
my base String is : GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fusers%2Flookup.json&screen_name%3Dcyrussuzhang%26oauth_consumer_key%3DXwJVSMb0eYHccM8LS4C9uw%26oauth_nonce%3DRSOPDE8NwG3tTpx9Uh20W7g5QuAde1La%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1354418941%26oauth_token%3D136214818-ZhFsrS43iS46s4piB6EbVM6KsAphcrdW9L5ahabd%26oauth_version%3D1.0

don’t know what to do, plz help

thank you!


#2

oh, and the query string is : https://api.twitter.com/1.1/users/lookup.json?screen_name=cyrussuzhang


#3

and here is the aouth head :
Authorization:OAuth oauth_consumer_key="${consumer_key}", oauth_nonce="${nonce}", oauth_signature_method="${signature_method}", oauth_timestamp="${timestamp}", oauth_token="${token}", oauth_version="${version}", oauth_signature="${signature}"


#4

From first glance, your signature base string is incorrect. The screen_name parameter should come after the oauth_* parameters, as the signature base string should have all parameters sorted before signing.


#5

yea, it works! thanks Taylor! Thank u so much!!!


#6

I have same issue like the response is HTTP 401:
Base string:
POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fusers%2Flookup.json&oauth_consumer_key%3DvLsFeiLzHBFzkkkWxBHdpw%26oauth_nonce%3DWwykceXMZNdWOXWWWipD%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1355234207%26oauth_token%3D177855597-sgYWNghonTFw0VBMIxWC1eMkEdeHZnmotkhHyQOC%26oauth_version%3D1.0%26user_id%3D813286%2C89692775%2C174561209%2C117182080%2C113419517%2C60937837%2C101311381%2C57928790%2C75854417%2C93640635%2C132385468%2C6253282%2C296201894%2C12925072%2C50374439%2C105001940

Req URL:
https://api.twitter.com/1.1/users/lookup.json?

Strill I’m getting 401 error…I worked fine with v1 APIs


#7

What does your POST body look like? Make sure your POST body has the commas encoded as %2C, and then your signature base string should have them encoded again. Right now it looks like you’re either sending the commas naked in your POST body or already encoded as %2C and aren’t additionally escaping in your signature base string.


#8

HTTP Request URL: https://api.twitter.com/1.1/users/lookup.json
Request Body: user_id=813286,89692775,174561209,117182080,113419517,60937837,101311381,57928790,75854417,93640635,132385468,6253282,296201894,12925072,50374439,105001940

Base String is:
POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fusers%2Flookup.json&oauth_consumer_key%3DvLsFeiLzHBFzkkkWxBHdpw%26oauth_nonce%3DwkuZvVxASygKgaQKJEOT%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1355301057%26oauth_token%3D177855597-sgYWNghonTFw0VBMIxWC1eMkEdeHZnmotkhHyQOC%26oauth_version%3D1.0%26user_id%3D813286%2C89692775%2C174561209%2C117182080%2C113419517%2C60937837%2C101311381%2C57928790%2C75854417%2C93640635%2C132385468%2C6253282%2C296201894%2C12925072%2C50374439%2C105001940

Still I’m getting same 401 error…

I tried with request body as:
user_id=813286%2C89692775%2C174561209%2C117182080%2C113419517%2C60937837%2C101311381%2C57928790%2C75854417%2C93640635%2C132385468%2C6253282%2C296201894%2C12925072%2C50374439%2C105001940
Still got same 401 error…

Please help me where I’m going wrong