Calling users/lookup with more than one user id results in authentication error code 32


#1

Hi,

I’m calling the users lookup method [1] to fetch a list of users who are following me. When I call this method with exactly one user_id or screen_name, everything works fine, which seems that the oauth code is ok.
When there are more than one (as in the example call on [1]) I get an authorisation error code 32.
I get a list of ids from the followers/ids method, and I concatenate each in a loop with the comma as delimiter before I call users/lookup.

Has someone an idea? I’m using the Qt Oauth library for authentication in version 1.0.

Greetings
Daniel

[1]https://dev.twitter.com/docs/api/1.1/get/users/lookup


#2

Take a look at how your setup is encoding the “,” character that separates each ID or screen name.

You should encode it as “%2C” and by the time it gets to the OAuth signature base string it should be encoded once again, resulting in “%252C”

Some OAuth and HTTP libraries handle this normalization for you, some do not, and some might even do it half-way.